org.jdrawing.graphics
Class Group

java.lang.Object
  extended byorg.jdrawing.graphics.GraphicsElement
      extended byorg.jdrawing.graphics.Group

public class Group
extends GraphicsElement

Combines several elements.


Field Summary
 
Fields inherited from class org.jdrawing.graphics.GraphicsElement
BACKGROUND, COLOR, COMPOSITE, FONT, PAINT, parent, position, STROKE, TRANSFORM
 
Constructor Summary
Group()
           
 
Method Summary
 void addElement(GraphicsElement element)
          Append the specified element to the end of this group.
 void addElementAt(GraphicsElement element, int index)
          Adds the element to the group at specified position.
 void elementsChanged(GraphicsElement[] elements)
          Notify parent about elements was changed.
protected  void elementsInserted(GraphicsElement[] elements)
          Notify parent about new elements was inserted.
protected  void elementsRemoved(GraphicsElement[] elements)
          Notify parent about elements was removed.
 GraphicsElement getElementAt(int index)
          Gets the element in this group at specified position.
 int getElementCount()
          Gets the number of elements in this group.
 int indexOf(GraphicsElement element)
          Returns the index of the element in the group.
 void removeAllElements()
          Removes all the elements from this group.
 void removeElement(int index)
          Removes the element, specified by index, from this group.
 
Methods inherited from class org.jdrawing.graphics.GraphicsElement
addStyle, getParent, getStyle, getStyles, getTransform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Group

public Group()
Method Detail

addElement

public void addElement(GraphicsElement element)
Append the specified element to the end of this group.

Parameters:
element - element to be added to the group

addElementAt

public void addElementAt(GraphicsElement element,
                         int index)
Adds the element to the group at specified position.

Parameters:
element - element to be added to the group
index - position for element

removeElement

public void removeElement(int index)
Removes the element, specified by index, from this group.

Parameters:
index - the index of the component to be removed.

removeAllElements

public void removeAllElements()
Removes all the elements from this group.


getElementCount

public int getElementCount()
Gets the number of elements in this group.

Returns:
the number of elements in this group

getElementAt

public GraphicsElement getElementAt(int index)
Gets the element in this group at specified position.

Parameters:
index - index of the element to get
Returns:
the element at specified position

indexOf

public int indexOf(GraphicsElement element)
Returns the index of the element in the group.

Parameters:
element - element to search for
Returns:
index of the element in the group

elementsInserted

protected void elementsInserted(GraphicsElement[] elements)
Notify parent about new elements was inserted.

Parameters:
elements - inserted elements

elementsRemoved

protected void elementsRemoved(GraphicsElement[] elements)
Notify parent about elements was removed.

Parameters:
elements - removed elements

elementsChanged

public void elementsChanged(GraphicsElement[] elements)
Notify parent about elements was changed.

Parameters:
elements - changed elements