Spirograph
Class CodeMerger

java.lang.Object
  |
  +--Spirograph.CodeMerger

public class CodeMerger
extends java.lang.Object
implements java.awt.event.ActionListener

This class implements a listener that is added to the "Load Horizontal Code." and "Load Vertical Code" buttons on the Code Box. The CodeMerger reads the text off the text fields, writes it to a file along with the appropriate headers, compiles the file and creates a new instance of the resulting class. This instance is then passed in to the AccelHandlers as a new Accelerator to use.

Copyright (C) 1998 Massachusetts Institute of Technology.

See Also:
AccelHandler, SpiroUtils

Constructor Summary
CodeMerger(java.lang.String ruleName, java.awt.TextArea myTA, java.awt.TextArea myFields, AccelHandler myAccelHandler, AccelHandler otherAccelHandler)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          Creates a .java file containing the rules and fields written by the students, then compiles it.
 void setBoth(boolean useAsBoth)
          This is used when the option to use the same rule for both the vertical and horizontal acceleration is selected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeMerger

public CodeMerger(java.lang.String ruleName,
                  java.awt.TextArea myTA,
                  java.awt.TextArea myFields,
                  AccelHandler myAccelHandler,
                  AccelHandler otherAccelHandler)
Method Detail

setBoth

public void setBoth(boolean useAsBoth)
This is used when the option to use the same rule for both the vertical and horizontal acceleration is selected

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Creates a .java file containing the rules and fields written by the students, then compiles it. If compiling the file does not cause errors, a new instance of the Class is created, then cast to an Accelerator and passed to the accel handlers.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
See Also:
cs101.util.CompileManager