public interface IlvGraphicBag
IlvGraphic
objects. For instance, it is implemented by the classes
IlvManager
and IlvGraphicSet
.Modifier and Type | Method and Description |
---|---|
void |
addObject(IlvGraphic graphic,
boolean redraw)
Adds a graphic object to the bag.
|
void |
applyToObject(IlvGraphic graphic,
IlvApplyObject f,
Object arg,
boolean redraw)
Applies a method to a graphic object of the bag.
|
IlvGraphicBag |
getGraphicBag()
Returns the
IlvGraphicBag that contains this bag or
null if it is not contained in any bag. |
IlvGraphic |
getObject(String name)
Returns the graphic object with that name if it exists in the bag,
otherwise returns
null . |
IlvGraphicEnumeration |
getObjects()
Returns an enumeration of all the objects in this graphic bag.
|
void |
moveObject(IlvGraphic graphic,
double x,
double y,
boolean redraw)
Changes the location of a graphic object.
|
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.
|
boolean |
setObjectName(IlvGraphic graphic,
String name)
Changes the name of a graphic object.
|
void addObject(IlvGraphic graphic, boolean redraw)
graphic
- The graphic object.redraw
- If true
the object is redrawn.void removeObject(IlvGraphic graphic, boolean redraw)
graphic
- The graphic object.redraw
- If true
the object is redrawn.IlvGraphicEnumeration getObjects()
ConcurrentModificationException
.
For multithread safety, it is useful to lock the manager's
tree lock
for the duration of the use of
this enumeration.IlvGraphic
objects, or
null
.void reDrawObj(IlvGraphic graphic)
graphic
- The graphic object.void reDrawRegion(IlvRegion region)
region
- The region to redraw.void reshapeObject(IlvGraphic graphic, IlvRect newrect, boolean redraw)
graphic
- The graphic object.newrect
- The new desired bounding rectangle.redraw
- If true
the object is redrawn.void moveObject(IlvGraphic graphic, double x, double y, boolean redraw)
graphic
- The graphic object.x
- The new desired x position.y
- The new desired y position.redraw
- If true
the object is redrawn.void applyToObject(IlvGraphic graphic, IlvApplyObject f, Object arg, boolean redraw)
applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
must
call IlvGraphic.setInApplyToObject(boolean)
in the following way:
public void applyToObject(IlvGraphic obj, IlvApplyObject f, Object arg, boolean redraw) { obj.setInApplyToObject(true); try { ... } finally { obj.setInApplyToObject(false); } }If an
IlvGraphic
implements the IlvGraphicBag
interface, the implementation can be done in the following way:
public void applyToObject(IlvGraphic obj, IlvApplyObject f, Object arg, boolean redraw) { boolean needsRecursion = obj.setInApplyToObject(true); try { if (needsRecursion && getGraphicBag() != null) { final IlvGraphic fobj = obj; final IlvApplyObject ff = f; getGraphicBag().applyToObject(this, new IlvApplyObject() { public void apply(IlvGraphic thisObj, Object arg) { doSomething(fobj, ff, arg, false); } }, arg, redraw); } else { doSomething(obj, f, arg, redraw); } } finally { obj.setInApplyToObject(false); } }
graphic
- The graphic object.f
- The method to apply.arg
- The arguments passed to the method f
.redraw
- If true
the object is redrawn.boolean setObjectName(IlvGraphic graphic, String name)
graphic
- The graphic object.name
- The new name.true
if the name can be changed.IlvGraphic getObject(String name)
null
.name
- The graphic object name.IlvGraphicBag getGraphicBag()
IlvGraphicBag
that contains this bag or
null
if it is not contained in any bag.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.