|
Spirograph Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspirograph.CodeMerger
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 from the text fields and arranges for the creation of an Accelerator object that evaluates the code. This is then passed to the AccelHandlers as a new Accelerator to use.
Copyright © 1998 Massachusetts Institute of Technology.
Copyright © 2002-2003 Franklin W. Olin College of Engineering.
DotPanel
Constructor Summary | |
CodeMerger(java.lang.String ruleName,
CodeSource studentInput,
AccelHandler myAccelHandler,
AccelHandler otherAccelHandler)
Create a code merger that can convert student input to working behavior and give it a name. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent ae)
When the event we're registered for is performed, create the Accelerator from the code. |
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 |
public CodeMerger(java.lang.String ruleName, CodeSource studentInput, AccelHandler myAccelHandler, AccelHandler otherAccelHandler)
ruleName
- The name for this code mergerstudentInput
- The code the student wrote that needs to be merged.myAccelHandler
- The object that will contain the behavior for this axisotherAccelHandler
- The object that contians the behavior for the other axisMethod Detail |
public void setBoth(boolean useAsBoth)
useAsBoth
- Is this rule used for both directions?public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
ae
- An event signaling that the code should be merged
|
Spirograph Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |