org.jdrawing.graphics
Class GraphicsModel

java.lang.Object
  extended byorg.jdrawing.AbstractDrawingModel
      extended byorg.jdrawing.graphics.GraphicsModel
All Implemented Interfaces:
DrawingModel

public class GraphicsModel
extends AbstractDrawingModel

The implementation of DrawingModel interface that stores a set of graphics elements. Elements can be grouped.


Constructor Summary
GraphicsModel()
           
 
Method Summary
 java.util.Enumeration elements()
          Returns an enumeration of the elements of this model.
 Group getRootGroup()
          Returns Group that is the root of the model.
 void sortElements(java.lang.Object[] elements)
          Reorder elements to be in down then right order.
 
Methods inherited from class org.jdrawing.AbstractDrawingModel
addDrawingModelListener, fireElementsAdded, fireElementsChanged, fireElementsRemoved, fireModelChanged, getDrawingModelListeners, removeDrawingModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsModel

public GraphicsModel()
Method Detail

getRootGroup

public Group getRootGroup()
Returns Group that is the root of the model. All new elements must be added to this Group or to a Group which is a successor of the Group.

Returns:
Root Group of the model
See Also:
Group

elements

public java.util.Enumeration elements()
Returns an enumeration of the elements of this model. The returned Enumeration object will generate all elements in this model. The elements will be generated by this enumeration in down then right order which is usable for painting.

Returns:
an enumeration of the elements of this model

sortElements

public void sortElements(java.lang.Object[] elements)
Reorder elements to be in down then right order.

Parameters:
elements - the elements to reorder