edu.umd.cfar.lamp.viper.examples.omegahead
Class OmegaNode

java.lang.Object
  extended byedu.umd.cs.piccolo.PNode
      extended byedu.umd.cs.piccolo.nodes.PPath
          extended byedu.umd.cfar.lamp.viper.gui.canvas.AttributablePPathAdapter
              extended byedu.umd.cfar.lamp.viper.examples.omegahead.OmegaNode
All Implemented Interfaces:
Attributable, java.lang.Cloneable, java.awt.print.Printable, java.io.Serializable

public class OmegaNode
extends AttributablePPathAdapter
implements Attributable

Displays an 'omega' shape on the image. Right now, this is just a circle above a line.

See Also:
Serialized Form

Nested Class Summary
static interface OmegaNode.HIGHLIGHT
          Enumeration for the type of highlight currently applied
 
Field Summary
 
Fields inherited from class edu.umd.cs.piccolo.nodes.PPath
PROPERTY_PATH, PROPERTY_STROKE, PROPERTY_STROKE_PAINT
 
Fields inherited from class edu.umd.cs.piccolo.PNode
PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
OmegaNode()
           
OmegaNode(ViperViewMediator mediator)
           
 
Method Summary
 double getAngleInRadians()
           
 Attribute getAttribute()
           
 int getCurrentHightlight()
           
 int getHoverRegion(java.awt.geom.Point2D selectPt)
          Gets the region the point is hovering over.
 java.awt.geom.Point2D getLeftPoint()
           
 java.awt.geom.Line2D getLine()
           
 ViperViewMediator getMediator()
           
 java.awt.geom.Point2D getNorthHandlePoint()
           
 java.awt.geom.Point2D getRightPoint()
           
 int getSelectionThreshold()
           
 double getShapeLineLength()
           
 double getShapeLineOffset()
           
 double getShapeMajorDiameter()
           
 double getShapeMinorDiameter()
           
 double getShapeX()
           
 double getShapeY()
           
 java.lang.Object getUpdatedAttribute()
          synchronize the PNode with the Attribute
 double ptShapeDist(java.awt.geom.Point2D pt)
          Calculates the distance from the point to the shape.
protected  void resetStyle()
          Called by the setDisplayProperties methods, and whenever the style needs changing.
 void setAttribute(Attribute attr)
           
 void setCornerRadius(int val)
           
 void setCurrentHightlight(int currentHightlight)
           
 void setMediator(ViperViewMediator mediator)
          The mediator is required for 'setAttribute' method, and for making sure that the rotation is only changed when there is a large enough change.
 void setSelectionThreshold(int selectionThreshold)
           
 void setShapeAngleInRadians(double angleIn)
           
 void setShapeLineLength(double w)
           
 void setShapeLineOffset(double d)
           
 void setShapeMajorDiameter(double d)
           
 void setShapeMinorDiameter(double d)
           
 void setShapeX(double x)
           
 void setShapeY(double y)
           
 void updateOmega()
           
 
Methods inherited from class edu.umd.cfar.lamp.viper.gui.canvas.AttributablePPathAdapter
getDisplayProperties, getHandleDisplayProperties, getHighlightDisplayProperties, setDisplayProperties, setHandleDisplayProperties, setHighlightDisplayProperties
 
Methods inherited from class edu.umd.cs.piccolo.nodes.PPath
append, closePath, createEllipse, createPolyline, createPolyline, createRectangle, curveTo, endResizeBounds, getPathBoundsWithStroke, getPathReference, getStroke, getStrokePaint, intersects, lineTo, moveTo, paint, paramString, quadTo, reset, setBounds, setPathTo, setPathToEllipse, setPathToPolyline, setPathToPolyline, setPathToRectangle, setStroke, setStrokePaint, startResizeBounds, updateBoundsFromPath
 
Methods inherited from class edu.umd.cs.piccolo.PNode
addActivity, addChild, addChild, addChildren, addClientProperty, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToTransform, animateToTransparency, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperty, getClientPropertyKeysIterator, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInverseTransform, getListenerList, getLocalToGlobalTransform, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, moveToBack, moveToBack, moveToFront, moveToFront, offset, paintAfterChildren, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, position, print, print, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHight, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, toImage, toImage, toString, transformBy, translate, validateFullBounds, validateFullPaint
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.umd.cfar.lamp.viper.gui.canvas.datatypes.Attributable
setDisplayProperties, setHandleDisplayProperties, setHighlightDisplayProperties
 

Constructor Detail

OmegaNode

public OmegaNode()

OmegaNode

public OmegaNode(ViperViewMediator mediator)
Method Detail

resetStyle

protected void resetStyle()
Description copied from class: AttributablePPathAdapter
Called by the setDisplayProperties methods, and whenever the style needs changing.

Specified by:
resetStyle in class AttributablePPathAdapter

setShapeAngleInRadians

public void setShapeAngleInRadians(double angleIn)

getAngleInRadians

public double getAngleInRadians()

updateOmega

public void updateOmega()

getUpdatedAttribute

public java.lang.Object getUpdatedAttribute()
Description copied from interface: Attributable
synchronize the PNode with the Attribute

Specified by:
getUpdatedAttribute in interface Attributable
Returns:

setCornerRadius

public void setCornerRadius(int val)

setAttribute

public void setAttribute(Attribute attr)
Specified by:
setAttribute in interface Attributable

getAttribute

public Attribute getAttribute()
Specified by:
getAttribute in interface Attributable

getCurrentHightlight

public int getCurrentHightlight()
Returns:
Returns the currentHightlight.

setCurrentHightlight

public void setCurrentHightlight(int currentHightlight)
Parameters:
currentHightlight - The currentHightlight to set.

getLeftPoint

public java.awt.geom.Point2D getLeftPoint()

getRightPoint

public java.awt.geom.Point2D getRightPoint()

getHoverRegion

public int getHoverRegion(java.awt.geom.Point2D selectPt)
Gets the region the point is hovering over.

Parameters:
selectPt -
Returns:

ptShapeDist

public double ptShapeDist(java.awt.geom.Point2D pt)
Calculates the distance from the point to the shape. If the point is within the shape, returns zero.

Parameters:
pt -
Returns:

getSelectionThreshold

public int getSelectionThreshold()

setSelectionThreshold

public void setSelectionThreshold(int selectionThreshold)

getLine

public java.awt.geom.Line2D getLine()
Returns:

setShapeX

public void setShapeX(double x)

setShapeY

public void setShapeY(double y)

getShapeX

public double getShapeX()

getShapeY

public double getShapeY()

getShapeMajorDiameter

public double getShapeMajorDiameter()
Returns:

setShapeMajorDiameter

public void setShapeMajorDiameter(double d)
Parameters:
d -

getShapeMinorDiameter

public double getShapeMinorDiameter()
Returns:

setShapeMinorDiameter

public void setShapeMinorDiameter(double d)
Parameters:
d -

getNorthHandlePoint

public java.awt.geom.Point2D getNorthHandlePoint()
Returns:

getShapeLineLength

public double getShapeLineLength()
Returns:

setShapeLineLength

public void setShapeLineLength(double w)
Parameters:
w -

getMediator

public ViperViewMediator getMediator()
Returns:
Returns the mediator.

setMediator

public void setMediator(ViperViewMediator mediator)
The mediator is required for 'setAttribute' method, and for making sure that the rotation is only changed when there is a large enough change.

Parameters:
mediator - The mediator to set.

getShapeLineOffset

public double getShapeLineOffset()
Returns:

setShapeLineOffset

public void setShapeLineOffset(double d)
Parameters:
d -