|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.ZSceneGraphObject | +--edu.umd.cs.jazz.ZHandle
ZHandles are used to modify jazz object using direct manipulation. A scene graph object that wants to supply a set of custom handles should override the method getHandles
. See the class ZRectangle for an example of providing a set of custom handles.
ZHandles should be located on the scene graph object that they manipulate. For example a handle to resize a rectangle might be located on the bottom right corner of that rectangle. Each time a handle is asked to compute its bounds it is expected to relocate itself using the coordinate system of the scene graph object that it is manipulating. To do this it uses a ZLocator object. ZLocators return a point on a scene graph object.
Field Summary | |
static java.awt.Paint |
DEFAULT_FILL_PAINT |
static double |
DEFAULT_HANDLE_SIZE |
static java.awt.Paint |
DEFAULT_HIGHLIGHT_FILL_PAINT |
static java.awt.Paint |
DEFAULT_HIGHLIGHT_PEN_PAINT |
static java.awt.Paint |
DEFAULT_PEN_PAINT |
static java.awt.Stroke |
DEFAULT_STROKE |
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
bounds, inTransaction, invalidBounds, invalidVolatileBounds, listenerList, volatileBounds, volatileBounds_DEFAULT |
Constructor Summary | |
ZHandle(ZLocator aLocator) Create a new handle that will use the aLocator parameter to locate itself. |
Method Summary | |
void |
computeBounds() Compute the bounds of this handle using the handles locator to determine the center point of the bounds and the DEFAULT_HANDLE_SIZE to determine the extent. |
ZHandleGroup |
getHandleGroup() Return the handle group that is managing this handle in the scene graph. |
ZLocator |
getLocator() Return the locator that the handle uses to locate itself when it computes its bounds. |
void |
handleDragged(double dx, double dy) Deprecated. As of Jazz version 1.3, replaced by ZHandle.handleDragged(double x, double y, ZMouseEvent aEvent) . |
void |
handleDragged(double dx, double dy, ZMouseEvent aEvent) Called by the managing ZHandleGroup when appropriate. |
void |
handleEndDrag(double x, double y) Deprecated. As of Jazz version 1.3, replaced by ZHandle.handleEndDrag(double x, double y, ZMouseEvent aEvent) . |
void |
handleEndDrag(double x, double y, ZMouseEvent aEvent) Called by the managing ZHandleGroup when appropriate. |
void |
handleStartDrag(double x, double y) Deprecated. As of Jazz version 1.3, replaced by ZHandle.handleStartDrag(double x, double y, ZMouseEvent aEvent) . |
void |
handleStartDrag(double x, double y, ZMouseEvent aEvent) Called by the managing ZHandleGroup when appropriate. |
boolean |
isHighlighted() Return true if the handle is highlighted. |
void |
render(ZRenderContext aRenderContext) Render the handle using the default values for fill paint, pen paint, size and stroke. |
static void |
setDefaultFillPaint(java.awt.Paint aFillPaint) Set the default fill paint for handles. |
static void |
setDefaultHandleSize(double aHandleSize) Set the default size for all handles. |
static void |
setDefaultHighlightFillPaint(java.awt.Paint aHighlightFillPaint) Set the default highlight paint for handles. |
static void |
setDefaultHighlightPenPaint(java.awt.Paint aHighlightPenPaint) Set the default highlight pen paint for handles. |
static void |
setDefaultPenPaint(java.awt.Paint aPenPaint) Set the default pen paint for handles. |
static void |
setDefaultStroke(java.awt.Stroke aStroke) Set the default stroke for all handles. |
void |
setHandleGroup(ZHandleGroup aHandleGroup) Set the handle group that is managing this handle in the scene graph. |
void |
setIsHighlighted(boolean aBoolean) Mark this handles as highlighted if true, not highlighted if false. |
void |
setLocator(ZLocator aLocator) Set the locator that the handle uses to locate itself when it computes its bounds. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.awt.Paint DEFAULT_FILL_PAINT
public static java.awt.Paint DEFAULT_HIGHLIGHT_FILL_PAINT
public static java.awt.Paint DEFAULT_PEN_PAINT
public static java.awt.Paint DEFAULT_HIGHLIGHT_PEN_PAINT
public static double DEFAULT_HANDLE_SIZE
public static java.awt.Stroke DEFAULT_STROKE
Constructor Detail |
public ZHandle(ZLocator aLocator)
Method Detail |
public static void setDefaultFillPaint(java.awt.Paint aFillPaint)
public static void setDefaultHighlightFillPaint(java.awt.Paint aHighlightFillPaint)
public static void setDefaultPenPaint(java.awt.Paint aPenPaint)
public static void setDefaultHighlightPenPaint(java.awt.Paint aHighlightPenPaint)
public static void setDefaultHandleSize(double aHandleSize)
public static void setDefaultStroke(java.awt.Stroke aStroke)
public void computeBounds()
computeBounds
in class ZSceneGraphObject
public boolean isHighlighted()
public void setIsHighlighted(boolean aBoolean)
public void setLocator(ZLocator aLocator)
public ZLocator getLocator()
public ZHandleGroup getHandleGroup()
public void setHandleGroup(ZHandleGroup aHandleGroup)
public void render(ZRenderContext aRenderContext)
public void handleStartDrag(double x, double y)
ZHandle.handleStartDrag(double x, double y, ZMouseEvent aEvent)
.
public void handleDragged(double dx, double dy)
ZHandle.handleDragged(double x, double y, ZMouseEvent aEvent)
.
public void handleEndDrag(double x, double y)
ZHandle.handleEndDrag(double x, double y, ZMouseEvent aEvent)
.
public void handleStartDrag(double x, double y, ZMouseEvent aEvent)
x
- The x coord of the drag start in local coords of the ZHandleGroup.y
- The y coord of the drag start in local coords of the ZHandleGroup.aEvent
- The source mouse event that caused the start drag.public void handleDragged(double dx, double dy, ZMouseEvent aEvent)
dx
- The change in the x coord of the drag in local coords of the ZHandleGroup.dy
- The change in the y coord of the drag in local coords of the ZHandleGroup.aEvent
- The source mouse event that caused the drag.public void handleEndDrag(double x, double y, ZMouseEvent aEvent)
x
- The x coord of the end drag in local coords of the ZHandleGroup.y
- The y coord of the end drag in local coords of the ZHandleGroup.aEvent
- The source mouse event that caused the end drag.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |