public class Drawingextends Objectimplements Externalizable, ViewableClass Drawing provides a drawing. A drawing consists of a sequence of DrawingItems, which are displayed in order. Thus, a drawing item later in the sequence will obscure a drawing item earlier in the sequence if the items overlap.
A drawing contains a ColorFill object that tells how to color the drawing's background.
A drawing contains the size of the rectangular region within which the drawing items are to be displayed. By default, the display region is just large enough to contain all the drawing items, plus a border. Methods are provided to specify a different display region if desired.
An instance of class Drawing may be serialized. Class Drawing provides static convenience methods to write a drawing to a file and read a drawing from a file. A drawing file is simply a binary file that contains a serialized drawing object. The View program can be used to display the drawing file.
There is a default drawing. Initially, the default drawing is a new drawing object. The default drawing may be changed, or set to null to signify that there is no default drawing. A DrawingItem's add() and addFirst() methods add the drawing item to the default drawing (if there is one).
- See Also:
- Serialized Form