Referencing Objects: IlvGraphicHandle
An IlvGraphicHandle object is used to reference an IlvGraphic object. The IlvGraphicHandle object is called the handle object (or simply handle), and the IlvGraphic object is called the referenced object.
Referencing Objects
This relationship enables you to use the handle object to indirectly access the referenced object. Also, the same referenced object can be shared among several handles. Through handle objects, you can thus reproduce a complex graphic object many times by simply creating new handles that all reference the same original object. Since handles consume much less memory than creating new images, using handle objects is very economical.
Owning Objects
You can decide to make a handle object the owner of the unique referenced object with which it is associated. If you do this, you should no longer access the referenced object directly, but only through its handle.
When a handle owns its referenced object, a delete operation on the handle removes both the handle and the referenced object. On the other hand, when there is no ownership relationship between the handle and its referenced object, a delete operation removes only the handle, leaving the other graphic object intact.
IlvTransformedGraphic
You can use the specialized graphic handle subclass, IlvTransformedGraphic, to display the same object several times with different geometric transformations applied to it.
The IlvTransformedGraphic class is derived from the basic handle class, IlvGraphicHandle. An object of the IlvTransformedGraphic type is a kind of handle that is associated with a certain referenced object of the IlvGraphic class. An IlvTransformedGraphic instance is drawn by applying a graphic transformation to its referenced object.
Object geometry is disturbed by various transformations because of rounding errors. To avoid this, the object can be associated with IlvTransformedGraphic.
IlvFixedSizeGraphic
You can use the specialized graphic handle subclass, IlvFixedSizeGraphic, to always display an object at the same size. For example, suppose there is a map displayed with an IlvButton object used for quitting the map viewer. When the map is zoomed and unzoomed, the button, of course, should stay the same size. To accomplish this, you can reference the button with the specialized IlvGraphicHandle object IlvFixedSizeGraphic.
The IlvFixedSizeGraphic class is derived, like IlvTransformedGraphic, from the IlvGraphicHandle class. An IlvFixedSizeGraphic object is a kind of handle, which is associated with a certain referenced object of the IlvGraphic class. An IlvFixedSizeGraphic instance is drawn by applying a graphic transformation to its referenced object so that the referenced object can never change its visible size.
Whatever the transformation applied, the object keeps the same dimensions and a constant offset relative to a reference point. These values are internally computed by the Views libraries or are specified by the user.
IlvGraphicInstance
You can use the specialized graphic handle subclass, IlvGraphicInstance, to encapsulate an object with a graphic resource modification.
The IlvGraphicInstance references another graphic object so that it can be drawn with another palette attribute. You can use an optional IlvTransformer to apply a geometric transformation to this object.