|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvGraphic
ilog.views.IlvSelection
ilog.views.IlvHandlesSelection
ilog.views.IlvDrawSelection
public class IlvDrawSelection
The IlvDrawSelection class is the default
selection object for graphic objects.
This class draws eight handles around the bounding
rectangle of an object to show that it is selected.
There are four handles on each corner of the bounding rectangle
and four handles in the middle of each side.
The interactor allows you to reshape the object by
dragging a handle, unless the method supportsResize()
returns false.
| Field Summary |
|---|
| Fields inherited from class ilog.views.IlvHandlesSelection |
|---|
CIRCLE_SHAPE, defaultHandleBackgroundColor, defaultHandleColor, defaultHandleShape, defaultHandleSize, FILLED_CIRCLE_SHAPE, FILLED_SQUARE_SHAPE, SQUARE_SHAPE |
| Constructor Summary | |
|---|---|
IlvDrawSelection(IlvGraphic obj)
Creates a new selection object. |
|
| Method Summary | |
|---|---|
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding box of the object. |
int |
direction(IlvPoint tp,
IlvTransformer t)
Returns the direction corresponding to a specified point. |
void |
draw(Graphics dst,
IlvTransformer t)
Draws the object. |
int |
getHandle(IlvPoint p,
IlvTransformer t)
Searches for a handle located at point p, when the object
is drawn with the transformer t. |
IlvPoint |
getHandle(int i,
IlvTransformer t)
Returns the location of a handle. |
int |
getHandleCardinal()
Returns the number of handles (the number here is 8). |
protected IlvRect |
getHandlesRectangle(IlvTransformer t)
Returns the rectangle on which the handles are located. |
boolean |
isOptimizedDrawingEnabled()
Returns true if the drawing optimization is enabled for
the selected graphic object. |
boolean |
supportsResize()
Returns true if this object allows resizing
of the selected graphic object. |
| Methods inherited from class ilog.views.IlvHandlesSelection |
|---|
afterLoopAllHandles, beforeLoopAllHandles, contains, drawWithoutHandles, getActiveHandlesColor, getHandlesColor, getHandlesShape, getHandlesSize, isActive, onEnter, onExit, setActiveHandlesColor, setHandlesColor, setHandlesShape, setHandlesSize, zoomable |
| Methods inherited from class ilog.views.IlvSelection |
|---|
applyTransform, copy, getDefaultInteractor, getObject, isVisible, SetDefaultInteractor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IlvDrawSelection(IlvGraphic obj)
obj - The selected object.| Method Detail |
|---|
public int direction(IlvPoint tp,
IlvTransformer t)
IlvConstants.BAD.
tp - The point.t - The transformer used to draw the object.IlvConstantspublic int getHandleCardinal()
getHandleCardinal in class IlvHandlesSelection
public int getHandle(IlvPoint p,
IlvTransformer t)
p, when the object
is drawn with the transformer t.
getHandle in class IlvHandlesSelectionprotected IlvRect getHandlesRectangle(IlvTransformer t)
IlvGraphic.boundingBox(IlvTransformer),
called on the selected object.
The method can be overridden by subclasses to indicate that the base
rectangle of the handles must be different from the
bounding box of the object. If the rectangle returned
by the overridden implementation does not completely contain
the bounding box of the object, the method isOptimizedDrawingEnabled()
must also be overridden to return always false.
public IlvPoint getHandle(int i,
IlvTransformer t)
getHandle in class IlvHandlesSelectioni - The index of the handle.t - The transformer through which the object is drawn.public IlvRect boundingBox(IlvTransformer t)
boundingBox in class IlvHandlesSelectiont - The transformer used to draw the object. If the
transformer is null, the bounding box for the
identity transformer is returned.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphic
public void draw(Graphics dst,
IlvTransformer t)
draw in class IlvHandlesSelectiondst - The destination Graphics.t - The transformation used to draw the object.IlvGraphic.boundingBox(ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicpublic boolean isOptimizedDrawingEnabled()
true if the drawing optimization is enabled for
the selected graphic object. Returns false otherwise.
The default implementation returns always true.
The method must be overridden to return always false if
the method getHandlesRectangle(ilog.views.IlvTransformer) is overridden and returns
a rectangle which does not completely contain the bounding box
of the selected object.
isOptimizedDrawingEnabled in class IlvSelectionpublic boolean supportsResize()
true if this object allows resizing
of the selected graphic object. Returns false
otherwise.
The default implementation always returns true.
Subclasses can override this method to deal with unresizeable
graphic objects.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||