operations
Class Operation

java.lang.Object
  |
  +--operations.Operation
Direct Known Subclasses:
OpAddAuxiliary, OpAddEnds, OpBar, OpCartesian, OpConstructArc, OpConstructCircle, OpConstructHalfLine, OpConstructInterval, OpConstructLine, OpDelay, OpDelayGoOn, OpDeleteAll, OpDeselectAll, OpDesign, OpDesignAbort, OpDesignChooseTest, OpDesignComplete, OpDesignDump, OpDesignerGrid, OpDesignFinish, OpDesignTest, OpDump, OpDumpTraceTree, OpEnd, OpExamine, OpExamineAbort, OpFindIntersection, OpFinish, OpFreehand, OpGoto, OpHideSecondary, OpHint, OpName, OpNavigate, OpNoBP, OpOkToRedo, OpPrint, OpRedo, OpRefocus, OpRestart, OpSelectRadius, OpSetBookmark, OpSetOrientationBP, OpSetProximityBP, OpSetRadius, OpShowConstruction, OpStep, OpTrigDoubleSelections, OpTrigTargets, OpTrigWarnings, OpUndo, OpUser, OpVisit, OpZoomIn, OpZoomOut

public abstract class Operation
extends java.lang.Object


Field Summary
protected  java.util.Vector constructedObjects
           
 int level
           
protected  java.util.Vector objects
           
protected  java.util.Vector reconstructedObjects
           
 interagents.userLab thisLab
           
protected  boolean undoable
           
protected  interagents.UndoStackElement use
           
 
Constructor Summary
Operation(interagents.userLab lab, int level)
           
 
Method Summary
abstract  boolean can(fundamentals.signature s)
          The following method returns true, if it makes sense to perform this operation on the set of objects given in objs.
 boolean canDefault()
          Returns true if this method can should be used as a default operation.
protected  interagents.ObjectWithStatus construct(objects.EuObject o)
          Use this method to add EuObjects to the lab or, if the object was constructed previously, to make sure the object is shown.
 boolean deselect()
           
 boolean enable(int clearing, fundamentals.signature sgn)
           
protected  void hide(interagents.ObjectWithStatus ows)
          Hides an object and records it for the undo stack.
 boolean isUndoable()
           
 java.lang.String name()
          The following method returns the name of the operation.
abstract  void perform(fundamentals.signature s)
          The following method performs the operation on the objects given in objs.
protected  void record(interagents.EuLab trace)
           
protected  void record(moves.EuMove move)
           
protected  void show(interagents.ObjectWithStatus ows)
          Shows an object and records it for the undo stack.
protected  void start()
          Call this method before any call of the construct-method, hide() or show(), if you want the Operation to be undoable.
protected  void stop()
          Call this method after the last call of any construct-method, hideShadows() or show(), if you want the operation to be undoable.
 java.lang.String submenu(int language)
           
 java.lang.String toNaturalLanguage(int language)
           
protected  void unconstruct(interagents.ObjectWithStatus ows)
           
protected  void undoAll()
           
protected  void undoFirst()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objects

protected java.util.Vector objects

constructedObjects

protected java.util.Vector constructedObjects

reconstructedObjects

protected java.util.Vector reconstructedObjects

thisLab

public interagents.userLab thisLab

level

public int level

use

protected interagents.UndoStackElement use

undoable

protected boolean undoable
Constructor Detail

Operation

public Operation(interagents.userLab lab,
                 int level)
Method Detail

can

public abstract boolean can(fundamentals.signature s)
The following method returns true, if it makes sense to perform this operation on the set of objects given in objs. The signature is redundant, but it's faster to compute it only once.


name

public java.lang.String name()
The following method returns the name of the operation. This is used for the menu.


toNaturalLanguage

public java.lang.String toNaturalLanguage(int language)

perform

public abstract void perform(fundamentals.signature s)
                      throws LeaException
The following method performs the operation on the objects given in objs. It's assumed that it makes sense to perform the operation (this can be checked with the can() method. Some subclasses assume that can() method is always called before the perform() method, and that it's called with the same objs Vector.

LeaException

canDefault

public boolean canDefault()
Returns true if this method can should be used as a default operation. The default is "true", so we only need to override the method for operations that cannot be used as default operations.


start

protected void start()
Call this method before any call of the construct-method, hide() or show(), if you want the Operation to be undoable.


show

protected void show(interagents.ObjectWithStatus ows)
Shows an object and records it for the undo stack.


hide

protected void hide(interagents.ObjectWithStatus ows)
Hides an object and records it for the undo stack.


construct

protected interagents.ObjectWithStatus construct(objects.EuObject o)
Use this method to add EuObjects to the lab or, if the object was constructed previously, to make sure the object is shown.


unconstruct

protected void unconstruct(interagents.ObjectWithStatus ows)

stop

protected void stop()
Call this method after the last call of any construct-method, hideShadows() or show(), if you want the operation to be undoable.


record

protected void record(moves.EuMove move)

record

protected void record(interagents.EuLab trace)

undoFirst

protected void undoFirst()

undoAll

protected void undoAll()

isUndoable

public boolean isUndoable()

deselect

public boolean deselect()

submenu

public java.lang.String submenu(int language)

enable

public boolean enable(int clearing,
                      fundamentals.signature sgn)