The Essential JViews Framework > Graphic Objects > Geometric Properties > The draw Method

The draw method is used to draw the graphic object. The signature of the method is the following:

public void draw(Graphics dst, IlvTransformer t)

The dst parameter is the destination Graphics where the object is drawn. As in the boundingBox method, the IlvTransformer parameter is the 2D transformation matrix used to draw the object in the drawing port.

Note
 Everything that is drawn with this method must be drawn inside the bounding rectangle of the object (the bounding rectangle of the object being the result of the call to the method boundingBox with the same transformation parameter). This is why these two methods should be defined jointly.

In order to draw the object, you will use the drawing methods of the AWT Graphics class. If you use Java 2 and need to perform Java2D drawings, you can cast the dst parameter in a Graphics2D object and then use the drawing methods of this class.