|
||||||||||
| 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.graphic.IlvGraphicHandleSelection
public class IlvGraphicHandleSelection
An IlvGraphicHandleSelection object is a selection that acts
like a handle to another selection. It is used as selection for
subclasses of IlvGraphicHandle.
| 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 | |
|---|---|
IlvGraphicHandleSelection(IlvGraphic object,
IlvSelection selection)
Creates a new IlvGraphicHandleSelection. |
|
| Method Summary | |
|---|---|
void |
addObject(IlvGraphic graphic,
boolean redraw)
Adds a graphic object to the bag. |
protected void |
afterLoopAllHandles()
This is called by this class after iterating over all handles and calling getHandle(int, ilog.views.IlvTransformer). |
void |
applyToObject(IlvGraphic graphic,
IlvApplyObject f,
Object arg,
boolean redraw)
Applies a method to a graphic object of the bag. |
protected void |
beforeLoopAllHandles(IlvTransformer t)
This is called by this class before iterating over all handles and calling getHandle(int, ilog.views.IlvTransformer). |
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object. |
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests whether a point lies within the outline of the object. |
void |
draw(Graphics dst,
IlvTransformer t)
Draws the object. |
void |
drawWithoutHandles(Graphics dst,
IlvTransformer t)
Draws the selection without the handles. |
String |
getDefaultInteractor()
Returns the default interactor class name. |
IlvPoint |
getHandle(int i,
IlvTransformer t)
Returns the location of a handle. |
int |
getHandleCardinal()
Returns the number of handles for this object. |
IlvGraphic |
getObject(String name)
Returns the graphic object with that name if it exists in the bag, otherwise returns null. |
IlvGraphicEnumeration |
getObjects()
Returns the objects of the bag. |
IlvSelection |
getSelection()
Returns the referenced selection. |
protected IlvTransformer |
getVirtualToRealViewTransformer(IlvTransformer t)
Returns the transformer that converts the virtual view coordinate system to the real view coordinate system. |
protected IlvTransformer |
getVirtualViewTransformer(IlvTransformer t)
Returns the transformer that converts the manager coordinate system of the wrapped object into a virtual view coordinate system. |
boolean |
inside(IlvRect rect,
IlvRect trect,
IlvTransformer t)
Tests whether a rectangle contains the object. |
boolean |
intersects(IlvRect rect,
IlvRect trect,
IlvTransformer t)
Tests whether a rectangle overlaps the object. |
boolean |
isOptimizedDrawingEnabled()
This method allows or disables an optimization for drawing a selection object and its selected object. |
boolean |
isPersistent()
If this method returns true the IlvGraphic
instance will be saved in IVL files. |
boolean |
isVisible()
Returns true if the object is visible. |
void |
moveObject(IlvGraphic graphic,
float x,
float y,
boolean redraw)
Changes the location of a graphic object. |
void |
onEnter(IlvObjectInteractorContext context)
Called when the selection is entered. |
void |
onExit(IlvObjectInteractorContext context)
Called when the selection is exited. |
void |
reDrawObj(IlvGraphic graphic)
Redraws a graphic object located in the bag. |
void |
reDrawRegion(IlvRegion region)
Redraws a region of the bag. |
void |
removeObject(IlvGraphic graphic,
boolean redraw)
Removes a graphic object from the bag. |
void |
reshapeObject(IlvGraphic graphic,
IlvRect newrect,
boolean redraw)
Changes the size of a graphic object. |
void |
setBackground(Color c)
Changes the background color of the object. |
void |
setForeground(Color c)
Changes the foreground color of the object. |
boolean |
setObjectName(IlvGraphic graphic,
String name)
Changes the name of a graphic object. |
void |
setSelection(IlvSelection selection)
Sets the referenced selection. |
boolean |
zoomable()
Returns true if the object is zoomable. |
| Methods inherited from class ilog.views.IlvHandlesSelection |
|---|
getActiveHandlesColor, getHandle, getHandlesColor, getHandlesShape, getHandlesSize, isActive, setActiveHandlesColor, setHandlesColor, setHandlesShape, setHandlesSize |
| Methods inherited from class ilog.views.IlvSelection |
|---|
applyTransform, copy, getObject, SetDefaultInteractor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ilog.views.IlvGraphicBag |
|---|
getGraphicBag |
| Constructor Detail |
|---|
public IlvGraphicHandleSelection(IlvGraphic object,
IlvSelection selection)
IlvGraphicHandleSelection.
object - the object that has the selection.selection - the referenced selection.| Method Detail |
|---|
public void setSelection(IlvSelection selection)
public final IlvSelection getSelection()
public boolean isVisible()
isVisible in class IlvSelectiontrue if this graphic object is visible.IlvGraphic.setVisible(boolean),
IlvGraphic.setSelectable(boolean),
IlvGraphic.setMovable(boolean),
IlvGraphic.setEditable(boolean)public boolean isOptimizedDrawingEnabled()
true if the selection object
covers completely the selected objects. In other words if the
bounding box of this selection object is the same or bigger
than the bounding box of the corresponding selected object.
Note that the default value is false.
isOptimizedDrawingEnabled in class IlvSelectionpublic boolean zoomable()
zoomable on the referenced object.
zoomable in class IlvHandlesSelectionIlvGraphic,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.boundingBox(IlvTransformer),
IlvManager
public void draw(Graphics dst,
IlvTransformer t)
draw on the referenced object.
draw in class IlvHandlesSelectiondst - the destination Graphics.t - the transformation used to draw the object.IlvGraphic.boundingBox(ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphic
public void drawWithoutHandles(Graphics dst,
IlvTransformer t)
drawWithoutHandles in class IlvHandlesSelectionpublic IlvRect boundingBox(IlvTransformer t)
boundingBox on the referenced object.
boundingBox in class IlvHandlesSelectiont - the transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphic
public boolean contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
contains on the referenced object.
contains in class IlvHandlesSelectionp - the point to be tested.tp - the point p transformed by the transformer t.t - the transformation applied to the object when it
was drawn.
true if the point lies inside this graphic object.IlvGraphic
public boolean intersects(IlvRect rect,
IlvRect trect,
IlvTransformer t)
intersects on the referenced object.
intersects in class IlvGraphicrect - the rectangle to be tested.trect - the rectangle rect transformed by the transformer t.t - the transformation that was applied to the object when it
was drawn.
true if the rectangle overlaps this graphic object.IlvGraphic
public boolean inside(IlvRect rect,
IlvRect trect,
IlvTransformer t)
inside on the referenced object.
inside in class IlvGraphicrect - the rectangle to be tested.trect - the rectangle rect transformed by the transformer t.t - the transformation that was applied to the object when it
was drawn.IlvGraphicpublic void setForeground(Color c)
setForeground on the referenced object.
setForeground in class IlvGraphicc - the new color.IlvGraphic.draw(Graphics, IlvTransformer),
IlvGraphic.setBackground(Color),
IlvGraphic.setFillOn(boolean),
IlvGraphic.setStrokeOn(boolean),
IlvGraphicpublic void setBackground(Color c)
setBackground on the referenced object.
setBackground in class IlvGraphicc - the new color.IlvGraphic.draw(Graphics, IlvTransformer),
IlvGraphic.setForeground(Color),
IlvGraphic.setFillOn(boolean),
IlvGraphic.setStrokeOn(boolean),
IlvGraphicpublic boolean isPersistent()
true the IlvGraphic
instance will be saved in IVL files.
The method returns true if the referenced object
is persistent.
isPersistent in class IlvGraphicpublic void onEnter(IlvObjectInteractorContext context)
Subclasses can override this method to perform specific tasks when the selection is entered. The default implementation does nothing.
onEnter in class IlvHandlesSelectioncontext - The context for the object interactor.public void onExit(IlvObjectInteractorContext context)
Subclasses can override this method to perform specific tasks when the selection is entered. The default implementation does nothing.
onExit in class IlvHandlesSelectioncontext - The context for the object interactor.public int getHandleCardinal()
getHandleCardinal in class IlvHandlesSelection
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.protected void beforeLoopAllHandles(IlvTransformer t)
getHandle(int, ilog.views.IlvTransformer). Subclasses can override this method
to do preparations so that getHandle(int, ilog.views.IlvTransformer) is fast, e.g. fill
certain caches that are needed by getHandle(int, ilog.views.IlvTransformer).
beforeLoopAllHandles in class IlvHandlesSelectiont - The transformer to draw this object.afterLoopAllHandles()protected void afterLoopAllHandles()
getHandle(int, ilog.views.IlvTransformer). Subclasses can override this method
to do cleanup caches that were needed by getHandle(int, ilog.views.IlvTransformer).
afterLoopAllHandles in class IlvHandlesSelectionbeforeLoopAllHandles(ilog.views.IlvTransformer)protected IlvTransformer getVirtualViewTransformer(IlvTransformer t)
t - The transformer of the real view.
null to indicate identity transformer.protected IlvTransformer getVirtualToRealViewTransformer(IlvTransformer t)
null
or the identity transformer.
It returns null by default.
t - The transformer of the real view.
null to indicate identity transformer.public String getDefaultInteractor()
getDefaultInteractor in class IlvSelectionIlvReshapeSelection,
IlvSelection.SetDefaultInteractor(java.lang.String)
public void addObject(IlvGraphic graphic,
boolean redraw)
IlvGraphicBag interface.
Since the graphic handle selection can contain only one object,
you can add only an object if the currently referenced object is
null. The passed object becomes the new
currently referenced object.
If the graphic handle selection is in a graphic bag, it automatically
calls applyToObject on its graphic bag while adding
the object.
addObject in interface IlvGraphicBaggraphic - The graphic object.redraw - If true the object is redrawn.
public void removeObject(IlvGraphic graphic,
boolean redraw)
IlvGraphicBag interface.
Since the graphic handle selection can contain only one object,
you can remove only the currently referenced object.
If the graphic handle selection is in a graphic bag, it automatically
calls applyToObject on its graphic bag while removing
the object.
removeObject in interface IlvGraphicBaggraphic - The graphic object.redraw - If true the object is redrawn.public IlvGraphicEnumeration getObjects()
IlvGraphicBag interface.
This returns an enumeration with one object: the referenced object.
getObjects in interface IlvGraphicBagpublic void reDrawObj(IlvGraphic graphic)
IlvGraphicBag interface.
If this graphic handle selection is inside a graphic bag, it redraws this
graphic handle selection.
reDrawObj in interface IlvGraphicBaggraphic - The graphic object.public void reDrawRegion(IlvRegion region)
IlvGraphicBag interface.
If this graphic handle selection is inside a graphic bag, it redraws this
graphic handle selection.
reDrawRegion in interface IlvGraphicBagregion - The region to redraw.
public void reshapeObject(IlvGraphic graphic,
IlvRect newrect,
boolean redraw)
IlvGraphicBag interface.
Since the graphic handle selection can contain only one object,
you can reshape only the currently referenced object.
If the graphic handle selection is in a graphic bag, it automatically
calls applyToObject on its graphic bag while reshaping
the object.
reshapeObject in interface IlvGraphicBaggraphic - The graphic object.newrect - The new desired bounding rectangle.redraw - If true the object is redrawn.
public void moveObject(IlvGraphic graphic,
float x,
float y,
boolean redraw)
IlvGraphicBag interface.
Since the graphic handle selection can contain only one object,
you can move only the currently referenced object.
If the graphic handle selection is in a graphic bag, it automatically
calls applyToObject on its graphic bag while moving
the object.
moveObject in interface IlvGraphicBaggraphic - The graphic object.x - The new desired x position.y - The new desired y position.redraw - If true the object is redrawn.
public void applyToObject(IlvGraphic graphic,
IlvApplyObject f,
Object arg,
boolean redraw)
IlvGraphicBag interface.
If the graphic handle selection is in a graphic bag, it automatically
calls applyToObject on its graphic bag while applying
the object.
applyToObject in interface IlvGraphicBaggraphic - The graphic object.f - The method to apply.arg - The arguments passed to the method f.redraw - If true the object is redrawn.
public boolean setObjectName(IlvGraphic graphic,
String name)
IlvGraphicBag interface.
Since the graphic handle selection can contain only one object,
you can only change the name of the currently referenced object.
setObjectName in interface IlvGraphicBaggraphic - The graphic object.name - The new name.
true if the name can be changed.public IlvGraphic getObject(String name)
null.
Since the graphic handle selection can contain only one object,
it returns currently referenced object if this matches the input name,
and null otherwise.
getObject in interface IlvGraphicBagname - The graphic object name.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||