|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | 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, 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)
The handle group that is managing this handle in the scene graph is responsible for calling this method when appropriate. |
void |
handleEndDrag(double x,
double y)
The handle group that is managing this handle in the scene graph is responsible for calling this method when appropriate. |
void |
handleStartDrag(double x,
double y)
The handle group that is managing this handle in the scene graph is responsible for calling this method when appropriate. |
boolean |
isHighlighted()
Return true if the handle is highlighted. |
void |
isHighlighted(boolean aBoolean)
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 |
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 isHighlighted(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)
public void handleDragged(double dx, double dy)
super.handleDragged
so that other handles have a chance to update
their positions.public void handleEndDrag(double x, double y)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |