|
||||||||||
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
edu.umd.cs.piccolox.handles.PBoundsHandle
public class PBoundsHandle
PBoundsHandle a handle for resizing the bounds of another node. If a bounds handle is dragged such that the other node's width or height becomes negative then the each drag handle's locator assciated with that other node is "flipped" so that they are attached to and dragging a different corner of the nodes bounds.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode |
---|
PNode.PSceneGraphDelegate |
Field Summary |
---|
Fields inherited from class edu.umd.cs.piccolox.handles.PHandle |
---|
DEFAULT_COLOR, DEFAULT_HANDLE_SHAPE, DEFAULT_HANDLE_SIZE |
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 | |
---|---|
PBoundsHandle(PBoundsLocator locator)
Creates a bounds handle that will be attached to the provided locator. |
Method Summary | |
---|---|
static void |
addBoundsHandlesTo(PNode node)
Adds bounds handles to the corners and edges of the provided node. |
static void |
addStickyBoundsHandlesTo(PNode node,
PCamera camera)
Adds stick handles (always visible regardless of scale since they are attached to the camera) to the node provided. |
void |
dragHandle(PDimension aLocalDimension,
PInputEvent aEvent)
Is invoked when the handle is being dragged. |
void |
endHandleDrag(Point2D aLocalPoint,
PInputEvent aEvent)
Call back invoked when the drag is finished. |
void |
flipHandleIfNeeded(boolean flipX,
boolean flipY)
Flips this bounds around if it needs to be. |
void |
flipSiblingBoundsHandles(boolean flipX,
boolean flipY)
Moves locators around so that they are still logically positioned. |
Cursor |
getCursorFor(int side)
Returns an appropriate handle for the given side of a node. |
PBasicInputEventHandler |
getHandleCursorEventHandler()
Return the event handler that is responsible for setting the mouse cursor when it enters/exits this handle. |
protected void |
installHandleEventHandlers()
Installs the handlers to this particular bounds handle. |
static void |
removeBoundsHandlesFrom(PNode node)
Removes all bounds from the node provided. |
void |
startHandleDrag(Point2D aLocalPoint,
PInputEvent aEvent)
Is invoked when the a drag starts on this handle. |
Methods inherited from class edu.umd.cs.piccolox.handles.PHandle |
---|
getHandleDraggerHandler, getLocator, parentBoundsChanged, relocateHandle, setLocator, setParent |
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 |
Constructor Detail |
---|
public PBoundsHandle(PBoundsLocator locator)
locator
- locator used to position the nodeMethod Detail |
---|
public static void addBoundsHandlesTo(PNode node)
node
- node to be extended with bounds handlespublic static void addStickyBoundsHandlesTo(PNode node, PCamera camera)
node
- node being extended with bounds handlescamera
- camera onto which handles will appearpublic static void removeBoundsHandlesFrom(PNode node)
node
- node having its handles removed fromprotected void installHandleEventHandlers()
installHandleEventHandlers
in class PHandle
public PBasicInputEventHandler getHandleCursorEventHandler()
public void startHandleDrag(Point2D aLocalPoint, PInputEvent aEvent)
startHandleDrag
in class PHandle
aLocalPoint
- point in the handle's coordinate system that is
pressedaEvent
- event representing the start of the dragpublic void dragHandle(PDimension aLocalDimension, PInputEvent aEvent)
dragHandle
in class PHandle
aLocalDimension
- dimension representing the magnitude of the handle
dragaEvent
- event responsible for the callpublic void endHandleDrag(Point2D aLocalPoint, PInputEvent aEvent)
endHandleDrag
in class PHandle
aLocalPoint
- point on the handle where the drag was endedaEvent
- event responsible for the end of the dragpublic void flipSiblingBoundsHandles(boolean flipX, boolean flipY)
flipX
- whether to allow flipping along the x directionflipY
- whether to allow flipping along the y directionpublic void flipHandleIfNeeded(boolean flipX, boolean flipY)
flipX
- whether to allow flipping along the x directionflipY
- whether to allow flipping along the y directionpublic Cursor getCursorFor(int side)
side
- side given as SwingConstants values.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |