public class IlvDrawSelection extends IlvHandlesSelection
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.CIRCLE_SHAPE, defaultHandleBackgroundColor, defaultHandleColor, defaultHandleShape, defaultHandleSize, FILLED_CIRCLE_SHAPE, FILLED_SQUARE_SHAPE, SQUARE_SHAPE| Constructor and Description |
|---|
IlvDrawSelection(IlvGraphic obj)
Creates a new selection object.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
afterLoopAllHandles, beforeLoopAllHandles, contains, drawWithoutHandles, getActiveHandlesColor, getHandlesColor, getHandlesShape, getHandlesSize, isActive, onEnter, onExit, setActiveHandlesColor, setHandlesColor, setHandlesShape, setHandlesSize, zoomableapplyTransform, copy, getDefaultInteractor, getObject, isVisible, SetDefaultInteractoraddActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, invalidateBidiCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isPersistent, isSelectable, localeChanged, makeSelection, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBaseTextDirection, setBaseTextDirectionDuringConstruction, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setForeground, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved, writepublic IlvDrawSelection(IlvGraphic obj)
obj - The selected object.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 IlvHandlesSelectionpublic 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(),
IlvGraphicpublic void draw(Graphics dst, IlvTransformer t)
draw in class IlvHandlesSelectiondst - The destination Graphics instance.t - The transformation used to draw the object.IlvGraphic.callDraw(Graphics,IlvTransformer),
IlvGraphic.boundingBox(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.
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.