The Essential JViews Framework > Graphic Objects > Introducing Graphic Objects

A graphic object is an object that users can view on their screen. When you display a graphic object, you associate its coordinates with the coordinate system of a particular graphic bag. A graphic bag is an interface that describes the methods to be implemented by a class that contains several graphic objects. An example of a graphic bag is the class IlvManager, which can manage a large number of graphic objects. For more information see Chapter 5, Managers.

Every graphic object has an x value, a y value, and dimensions (that is, width and height). The x and y values define the upper-left corner of the graphic object's bounding box, which is the smallest rectangle containing the entire area of the object. You define the exact shapes of graphic objects in your ILOG JViews-based programs and then build them using various drawing methods. Other methods provide you with information about your graphic objects and let you carry out geometric tests concerning the shapes that you are using. For example, you can check whether or not a point with given coordinates lies inside a certain object form.

The Class IlvGraphic

ILOG JViews graphic objects inherit attributes from the IlvGraphic abstract base class. This class allows an ILOG JViews graphic object to draw itself at a given destination port. If required, the coordinates of the graphic object may also be transformed by an object associated with the IlvTransformer class. The class IlvGraphic has methods that allow you to set and change geometric dimensions but does not actually implement these methods. They are declared as nonfinal methods and are defined to perform various operations in the classes that inherit IlvGraphic attributes. Although the methods to manipulate geometric shapes and graphic attributes exist, their implementations are empty. Several methods are given to set and get user properties that can be associated with an object for application-specific purposes.