The following code gets a reference to an object named test
from
the manager. If the object exists, it is moved to the point (10, 20)
and redrawn (fourth parameter set to true
).
IlvGraphic object = manager.getObject("test");
if (object != null)
manager.moveObject(object, 10, 20, true);
The moveObject
method is equivalent
to the following code:
manager.applyToObject(object,
new IlvApplyObject()
{
public void apply(IlvGraphic obj, Object arg){
IlvPoint p = (IlvPoint) arg;
obj.move(p.x, p.y);
}
},
new IlvPoint(10,20), true);
This code calls the
applyToObject
method
with
object
as a parameter and an anonymous
class that implements the
IlvApplyObject interface. The
arg
parameter
is an
IlvPoint
object that gives the new
location of the object.
The method
applyToObject
is
defined in the
IlvGraphicBag interface, so you may call
applyToObject
directly
from a graphic object using:
obj.getGraphicBag().applyToObject(obj, ...);