|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
backend.MouseHandler
public class MouseHandler
MouseHandler handles mouse clicks by determining the appropriate action to take depending on how it is set It is really only meant to interact with a SphereWorld
Constructor Summary | |
---|---|
MouseHandler(SphereWorldModel theWorldModel,
com.sun.j3d.utils.behaviors.vp.OrbitBehavior theRotator,
InformationModel theInformation,
javax.swing.JPanel theController)
The MouseHandler constructor takes a initalized SphereWorld to play with |
Method Summary | |
---|---|
void |
addCircle(SphereCircleModel addMe)
addCircle will add a SphereCircleModel to the current state of the mouse handler. |
void |
addLine(SphereLineModel addMe)
addLine will add a line to be processed by the mouse handler |
void |
addPoint(float x,
float y,
float z)
addPoints behavior changes based on the current operation that is set for the mouse rotator |
void |
addPoint(SpherePointModel addMe)
addPoint will add a point to be processed by the mouse handler depending on when mode it's set it |
void |
newMouseLoc(java.awt.event.MouseEvent newPt,
javax.vecmath.Point3f worldLoc)
newMouseLoc will update the current MouseHandlerState as to the position of the Mouse |
void |
reset()
reset is used to reset the current state of the MouseHandler |
boolean |
sendMouseLoc()
sendMouseLoc returns true if the current mouse location should be sent to the state |
void |
setOperationAngleMeasure()
setOperationAngleMeasure will set the current operation to get return angle measures |
void |
setOperationDrawCircle()
setOperationDrawCircle will switch the current state to draw circle |
void |
setOperationDrawPoint()
setOperationDrawPoint will set the mouse handler to draw points when a point is passed to it |
void |
setOperationGreatCircle()
setOperationGreatCircle will set the current state to draw great circles on the sphere |
void |
setOperationLineIntersection()
setOperationLineIntersection will set the current state to find the intersection of two lines |
void |
setOperationLineMeasure()
setOperationLineMeasure will set the current state to measure the distance of a line |
void |
setOperationLongLine()
setOperationLongLine will set the current state to draw long lines on the sphere |
void |
setOperationMovePt()
setOperationMovePt will set the current state to one where the moving of points is allowed |
void |
setOperationParaTrans()
setOperationParaTrans will switch the current state to parallel transport |
void |
setOperationPointRename()
setOperationPointRename will switch the current state to the state that lets points to be renamed |
void |
setOperationRemoveObject()
setOperationRemoveObject will set the current state to one where objects can be removed |
void |
setOperationRotatePt()
setOperationRotatePt will switch to point rotation mode |
void |
setOperationRotateSphere()
setOperationRotateSphere will set the mouse handler to allow the sphere to be rotated when a user clicks and holds on the sphere |
void |
setOperationShortLine()
setOperationShortLine will set the current state to draw short line on the sphere |
void |
setOperationTriangleAreaMeasure()
setOperationTriangleAreaMeasure will set the current state to find the area of a triangle |
void |
setOperationZoom()
setOperationZoomState will set the current state to one where the sphere will zoom. |
boolean |
shouldHighlight(SphereBasicObject myObj)
shouldHighlight will let the current state decide whether this object should be highlighted or not |
java.lang.String |
stateName()
stateName returns the name associated with the current state |
Methods inherited from class java.util.Observable |
---|
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MouseHandler(SphereWorldModel theWorldModel, com.sun.j3d.utils.behaviors.vp.OrbitBehavior theRotator, InformationModel theInformation, javax.swing.JPanel theController)
theWorldModel
- the SphereWorldModel for MouseHandler to pass on
to different statestheWorld
- the SphereWorld for MouseHandler to pass on to
different statestheRotator
- is the OrbitBehavior to have the MouseHandler controltheInformation
- is the InformationModel for the MouseHandler to
pass on to different statestheController
- should be the main JFrame so errors can be
displayed correctlyMethod Detail |
---|
public void setOperationDrawPoint()
public void setOperationRotateSphere()
public void setOperationAngleMeasure()
public void setOperationShortLine()
public void setOperationGreatCircle()
public void setOperationLongLine()
public void setOperationLineMeasure()
public void setOperationLineIntersection()
public void setOperationTriangleAreaMeasure()
public void setOperationRemoveObject()
public void setOperationZoom()
public void setOperationMovePt()
public void setOperationRotatePt()
public void setOperationParaTrans()
public void setOperationDrawCircle()
public void setOperationPointRename()
public void addPoint(float x, float y, float z)
x
- is the x point to add to the worldy
- is the y point to add to the worldz
- is the z point to add to the worldpublic void addPoint(SpherePointModel addMe)
addMe
- the point to add in SpheriosityPoint formpublic void addLine(SphereLineModel addMe)
addMe
- is sent to the current state for manipulationpublic void addCircle(SphereCircleModel addMe)
addMe
- the SphereCircleModel to pass along to the current statepublic void newMouseLoc(java.awt.event.MouseEvent newPt, javax.vecmath.Point3f worldLoc)
newPt
- The new location of the mouseworldLoc
- Should be the mouse point converted to world coordinatespublic boolean shouldHighlight(SphereBasicObject myObj)
myObj
- the object to highlight
public void reset()
public java.lang.String stateName()
public boolean sendMouseLoc()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |