|
|||||||||
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.piccolox.swt.PSWTPath
edu.umd.cs.piccolox.swt.PSWTHandle
edu.umd.cs.piccolox.swt.PSWTBoundsHandle
public class PSWTBoundsHandle
PSWTBoundsHandle 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.swt.PSWTHandle |
---|
DEFAULT_COLOR, DEFAULT_HANDLE_SHAPE, DEFAULT_HANDLE_SIZE |
Fields inherited from class edu.umd.cs.piccolox.swt.PSWTPath |
---|
PROPERTY_SHAPE |
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
PSWTBoundsHandle(PBoundsLocator locator)
Creates a bounds handle that will use the provided bounds locator to position itself. |
Method Summary | |
---|---|
static void |
addBoundsHandlesTo(PNode node)
Adds bounds handles to all corners and edges of the provided node. |
static void |
addStickyBoundsHandlesTo(PNode node,
PCamera camera)
Adds sticky bounds handles to all corners and edges of the provided node and for display on the provided camera. |
void |
dragHandle(PDimension aLocalDimension,
PInputEvent aEvent)
Callback invoked when the user is dragging the handle. |
void |
endHandleDrag(java.awt.geom.Point2D aLocalPoint,
PInputEvent aEvent)
Callback invoked when the handle stops being dragged. |
void |
flipHandleIfNeeded(boolean flipX,
boolean flipY)
Flips this particular handle around if needed. |
void |
flipSiblingBoundsHandles(boolean flipX,
boolean flipY)
Iterates over all of this node's handles flipping them if necessary. |
java.awt.Cursor |
getCursorFor(int side)
Returns an appropriate cursor to display when the mouse is over a handle on the side provided. |
PBasicInputEventHandler |
getHandleCursorEventHandler()
Return the event handler that is responsible for setting the mouse cursor when it enters/exits this handle. |
protected void |
installHandleEventHandlers()
Installs handlers responsible for updating the attached node's bounds and for updating the cursor when the mous enters a handle. |
static void |
removeBoundsHandlesFrom(PNode node)
Removes all bounds handles from the specified node. |
void |
startHandleDrag(java.awt.geom.Point2D aLocalPoint,
PInputEvent aEvent)
Callback invoked when the user has started to drag a handle. |
Methods inherited from class edu.umd.cs.piccolox.swt.PSWTHandle |
---|
getHandleDraggerHandler, getLocator, parentBoundsChanged, relocateHandle, setLocator, setParent |
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 java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PSWTBoundsHandle(PBoundsLocator locator)
locator
- locator to use when positioning this handleMethod Detail |
---|
public static void addBoundsHandlesTo(PNode node)
node
- to decorate with bounds handles.public static void addStickyBoundsHandlesTo(PNode node, PCamera camera)
node
- to decorate with bounds handles.camera
- camera onto which the handles should be stuckpublic static void removeBoundsHandlesFrom(PNode node)
node
- node from which to remove bounds handlesprotected void installHandleEventHandlers()
installHandleEventHandlers
in class PSWTHandle
public PBasicInputEventHandler getHandleCursorEventHandler()
public void startHandleDrag(java.awt.geom.Point2D aLocalPoint, PInputEvent aEvent)
startHandleDrag
in class PSWTHandle
aLocalPoint
- point in the handle's coordinate system at which the
drag was startedaEvent
- Piccolo2d Event representing the start of the dragpublic void dragHandle(PDimension aLocalDimension, PInputEvent aEvent)
dragHandle
in class PSWTHandle
aLocalDimension
- magnitude of drag in the handle's coordinate
systemaEvent
- Piccolo2d Event representing the start of the dragpublic void endHandleDrag(java.awt.geom.Point2D aLocalPoint, PInputEvent aEvent)
endHandleDrag
in class PSWTHandle
aLocalPoint
- point in the handle's coordinate system at which the
drag was stoppedaEvent
- Piccolo2d Event representing the stop of the dragpublic void flipSiblingBoundsHandles(boolean flipX, boolean flipY)
flipX
- whether to allow flipping in the horizontal directionflipY
- whether to allow flipping in the vertical directionpublic void flipHandleIfNeeded(boolean flipX, boolean flipY)
flipX
- whether to allow flipping in the horizontal directionflipY
- whether to allow flipping in the vertical directionpublic java.awt.Cursor getCursorFor(int side)
side
- value from SwingConstants
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |