edu.umd.cs.piccolox.swt
Class PSWTHandle

java.lang.Object
  extended by edu.umd.cs.piccolo.PNode
      extended by edu.umd.cs.piccolox.swt.PSWTPath
          extended by edu.umd.cs.piccolox.swt.PSWTHandle
All Implemented Interfaces:
Printable, Serializable, Cloneable
Direct Known Subclasses:
PSWTBoundsHandle

public class PSWTHandle
extends PSWTPath

PSWTHandle is used to modify some aspect of Piccolo when it is dragged. Each handle has a PLocator that it uses to automatically position itself. See PSWTBoundsHandle for an example of a handle that resizes the bounds of another node.

Version:
1.0
Author:
Jesse Grosjean
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode
PNode.PSceneGraphDelegate
 
Field Summary
static Color DEFAULT_COLOR
          The default color to use when drawing a handle.
static Shape DEFAULT_HANDLE_SHAPE
          The default shape to use when drawing handles.
static float DEFAULT_HANDLE_SIZE
          The Default Size of a handle not including its border.
 
Fields inherited from class edu.umd.cs.piccolox.swt.PSWTPath
PROPERTY_SHAPE
 
Fields inherited from class edu.umd.cs.piccolo.PNode
FILL_STRATEGY_ASPECT_COVER, FILL_STRATEGY_ASPECT_FIT, FILL_STRATEGY_EXACT_FIT, PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
PSWTHandle(PLocator aLocator)
          Construct a new handle that will use the given locator to locate itself on its parent node.
 
Method Summary
 void dragHandle(PDimension aLocalDimension, PInputEvent aEvent)
          Override this method to get notified as the handle is dragged.
 void endHandleDrag(Point2D aLocalPoint, PInputEvent aEvent)
          Override this method to get notified when the handle stops getting dragged.
 PDragSequenceEventHandler getHandleDraggerHandler()
          Return the event handler that is responsible for the drag handle interaction.
 PLocator getLocator()
          Get the locator that this handle uses to position itself on its parent node.
protected  void installHandleEventHandlers()
          Installs the handler that will reposition the handle when it is dragged, and invoke appropriate call backs.
 void parentBoundsChanged()
          A notification that the bounds of this node's parent have changed.
 void relocateHandle()
          Force this handle to relocate itself using its locator.
 void setLocator(PLocator aLocator)
          Set the locator that this handle uses to position itself on its parent node.
 void setParent(PNode newParent)
          Set the parent of this node.
 void startHandleDrag(Point2D aLocalPoint, PInputEvent aEvent)
          Override this method to get notified when the handle starts to get dragged.
 
Methods inherited from class edu.umd.cs.piccolox.swt.PSWTPath
cloneShape, createEllipse, createPolyline, createPolyline, createRectangle, createRoundRectangle, getCenter, getStrokePaint, internalUpdateBounds, intersects, paint, setPathToEllipse, setPathToPolyline, setPathToPolyline, setPathToRectangle, setPathToRoundRectangle, setShape, setStrokeColor, updateBoundsFromPath, updateShapePoints
 
Methods inherited from class edu.umd.cs.piccolo.PNode
addActivity, addAttribute, addChild, addChild, addChildren, addClientProperty, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientProperty, getClientPropertyKeysEnumeration, getClientPropertyKeysIterator, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInputEventListeners, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getName, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, 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, moveInBackOf, moveInFrontOf, moveToBack, moveToFront, offset, paintAfterChildren, paramString, 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, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setName, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaint
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HANDLE_SIZE

public static float DEFAULT_HANDLE_SIZE
The Default Size of a handle not including its border.


DEFAULT_HANDLE_SHAPE

public static Shape DEFAULT_HANDLE_SHAPE
The default shape to use when drawing handles. Default is an ellipse.


DEFAULT_COLOR

public static Color DEFAULT_COLOR
The default color to use when drawing a handle. (white)

Constructor Detail

PSWTHandle

public PSWTHandle(PLocator aLocator)
Construct a new handle that will use the given locator to locate itself on its parent node.

Parameters:
aLocator - locator to use when positioning this handle
Method Detail

installHandleEventHandlers

protected void installHandleEventHandlers()
Installs the handler that will reposition the handle when it is dragged, and invoke appropriate call backs.


getHandleDraggerHandler

public PDragSequenceEventHandler getHandleDraggerHandler()
Return the event handler that is responsible for the drag handle interaction.

Returns:
handler responsible for responding to drag events

getLocator

public PLocator getLocator()
Get the locator that this handle uses to position itself on its parent node.

Returns:
locator used to position this handle

setLocator

public void setLocator(PLocator aLocator)
Set the locator that this handle uses to position itself on its parent node.

Parameters:
aLocator - used to position this handle

startHandleDrag

public void startHandleDrag(Point2D aLocalPoint,
                            PInputEvent aEvent)
Override this method to get notified when the handle starts to get dragged.

Parameters:
aLocalPoint - point at which dragging was started relative to the handle's coordinate system
aEvent - event representing the start of the drag

dragHandle

public void dragHandle(PDimension aLocalDimension,
                       PInputEvent aEvent)
Override this method to get notified as the handle is dragged.

Parameters:
aLocalDimension - magnitude of the dragHandle event in the dimensions of the handle's coordinate system.
aEvent - event representing the drag

endHandleDrag

public void endHandleDrag(Point2D aLocalPoint,
                          PInputEvent aEvent)
Override this method to get notified when the handle stops getting dragged.

Parameters:
aLocalPoint - point at which dragging was ended relative to the handle's coordinate system
aEvent - event representing the end of the drag

setParent

public void setParent(PNode newParent)
Set the parent of this node. Note this is set automatically when adding and removing children.

Overrides:
setParent in class PNode
Parameters:
newParent - the parent to which this node should be added

parentBoundsChanged

public void parentBoundsChanged()
A notification that the bounds of this node's parent have changed.

Overrides:
parentBoundsChanged in class PNode

relocateHandle

public void relocateHandle()
Force this handle to relocate itself using its locator.



Copyright © 1995-2011 Piccolo2D. All Rights Reserved.