|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.PNode
edu.umd.cs.piccolo.nodes.PPath
edu.umd.cs.piccolox.handles.PHandle
public class PHandle
PHandle 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 PBoundsHandle for an example of a handle that resizes the bounds of another node.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode |
---|
PNode.PSceneGraphDelegate |
Field Summary | |
---|---|
static Color |
DEFAULT_COLOR
Default color to paint handles. |
static Shape |
DEFAULT_HANDLE_SHAPE
Default shape to use when drawing handles. |
static float |
DEFAULT_HANDLE_SIZE
The default size for a handle. |
Fields inherited from class edu.umd.cs.piccolo.nodes.PPath |
---|
PROPERTY_CODE_PATH, PROPERTY_CODE_STROKE, PROPERTY_CODE_STROKE_PAINT, PROPERTY_PATH, PROPERTY_STROKE, PROPERTY_STROKE_PAINT |
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
PHandle(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 notify its subclasses of handle interaction. |
void |
parentBoundsChanged()
Forces the handles to reposition themselves using their associated locator. |
void |
relocateHandle()
Force this handle to relocate itself using its locator. |
void |
setLocator(PLocator locator)
Set the locator that this handle uses to position itself on its parent node. |
void |
setParent(PNode newParent)
Set's this handle's parent. |
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.piccolo.nodes.PPath |
---|
append, closePath, createEllipse, createLine, createPolyline, createPolyline, createRectangle, createRoundRectangle, curveTo, endResizeBounds, getPathBoundsWithStroke, getPathReference, getStroke, getStrokePaint, internalUpdateBounds, intersects, lineTo, moveTo, paint, quadTo, reset, setPathTo, setPathToEllipse, setPathToPolyline, setPathToPolyline, setPathToRectangle, setStroke, setStrokePaint, startResizeBounds, updateBoundsFromPath |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static float DEFAULT_HANDLE_SIZE
public static Shape DEFAULT_HANDLE_SHAPE
public static Color DEFAULT_COLOR
Constructor Detail |
---|
public PHandle(PLocator aLocator)
aLocator
- locator to use when laying out the handleMethod Detail |
---|
protected void installHandleEventHandlers()
public PDragSequenceEventHandler getHandleDraggerHandler()
public PLocator getLocator()
public void setLocator(PLocator locator)
locator
- the locator to assign to this handlepublic void startHandleDrag(Point2D aLocalPoint, PInputEvent aEvent)
aLocalPoint
- point on the handle at which the event occurredaEvent
- the event responsible for starting the draggingpublic void dragHandle(PDimension aLocalDimension, PInputEvent aEvent)
aLocalDimension
- size of the drag in handle coordinatesaEvent
- event representing the dragpublic void endHandleDrag(Point2D aLocalPoint, PInputEvent aEvent)
aLocalPoint
- point in handle coordinate system of the end of the
dragaEvent
- event responsible for ending the dragpublic void setParent(PNode newParent)
setParent
in class PNode
newParent
- the new parent to assign to this handlepublic void parentBoundsChanged()
parentBoundsChanged
in class PNode
public void relocateHandle()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |