backend.mousehandlerstates
Class MouseHandlerBaseState

java.lang.Object
  extended by backend.mousehandlerstates.MouseHandlerBaseState
Direct Known Subclasses:
AngleMeasureState, DrawCircleState, DrawLineBaseState, DrawLineIntersectionsState, DrawPointState, LabelChangeState, LineMeasureState, MoveState, ParaTransState, RemoveObjectState, RotatePointState, RotateSphereState, TriangleAreaMeasureState, ZoomState

public abstract class MouseHandlerBaseState
extends java.lang.Object

MouseHandlerBaseState is the state which needs to be extended by any state that the MouseHandler will use


Constructor Summary
MouseHandlerBaseState(SphereWorldModel theWorld, java.lang.String theLabel, boolean needMouseLoc)
          MouseHandlerBaseState constructor simply does variable initalization but should be called
 
Method Summary
abstract  void addCircle(SphereCircleModel addMe)
          addCircle will add a circle to be processed by this state
abstract  void addLine(SphereLineModel addMe)
          addLine will add a line to be processed by this state
abstract  void addPoint(float x, float y, float z)
          addPoints behavior changes based on the current state of the MouseHandler
abstract  void addPoint(SpherePointModel addMe)
          addPoint will add a point to be processed by the mouse handler depending on when mode it's set it
abstract  void enter()
          Code in the enter function will be executed when the MouseHandler changes to this state
abstract  void exit()
          The exit function is always called when the state is being changed to a new state
 java.lang.String getStateLabel()
          Returns the label for this state
abstract  void newMouseLoc(java.awt.event.MouseEvent newPoint, javax.vecmath.Point3f worldLoc)
          newMouseLoc will be called when the mouse changes location
abstract  void reset()
          The reset function should reset the state of this state
 boolean sendMouseLoc()
           
 void setSendMouseLoc(boolean newVal)
           
abstract  boolean shouldHighlight(SphereBasicObject highlightMe)
          shouldHighlight will return ture if the given SphereBasicObject should be highlighted
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseHandlerBaseState

public MouseHandlerBaseState(SphereWorldModel theWorld,
                             java.lang.String theLabel,
                             boolean needMouseLoc)
MouseHandlerBaseState constructor simply does variable initalization but should be called

Parameters:
theWorld - Is the SphereWorld we are dealing with
theLabel - is the label corresponding to the button for this state
needMouseLoc - should be set to true if you want to receive the current location of the mouse
Method Detail

enter

public abstract void enter()
Code in the enter function will be executed when the MouseHandler changes to this state


addPoint

public abstract void addPoint(float x,
                              float y,
                              float z)
addPoints behavior changes based on the current state of the MouseHandler

Parameters:
x - is the x point to work with
y - is the y point to add to the world
z - is the z point to add to the world

addPoint

public abstract void addPoint(SpherePointModel addMe)
addPoint will add a point to be processed by the mouse handler depending on when mode it's set it

Parameters:
addMe - the point to add in SpheriosityPoint form

addLine

public abstract void addLine(SphereLineModel addMe)
addLine will add a line to be processed by this state

Parameters:
addMe - a line to add for processing

addCircle

public abstract void addCircle(SphereCircleModel addMe)
addCircle will add a circle to be processed by this state

Parameters:
addMe - a SphereCircleModel to be added for processing

sendMouseLoc

public boolean sendMouseLoc()

setSendMouseLoc

public void setSendMouseLoc(boolean newVal)

newMouseLoc

public abstract void newMouseLoc(java.awt.event.MouseEvent newPoint,
                                 javax.vecmath.Point3f worldLoc)
newMouseLoc will be called when the mouse changes location

Parameters:
newPoint - is the MouseEvent which has the latest mouse position stored in it
worldLoc - will be the mouse point in world coordinantes

exit

public abstract void exit()
The exit function is always called when the state is being changed to a new state


reset

public abstract void reset()
The reset function should reset the state of this state


getStateLabel

public java.lang.String getStateLabel()
Returns the label for this state

Returns:
The label for this state

shouldHighlight

public abstract boolean shouldHighlight(SphereBasicObject highlightMe)
shouldHighlight will return ture if the given SphereBasicObject should be highlighted

Parameters:
highlightMe - the SphereBasicObject to test for highlighting. It will be assumed that the mouse is already hovering over this object. Do not think this function will test for that as well!
Returns:
true if it should be highlighted false if not