fdda.graphics
Interface Container

All Superinterfaces:
Cloneable, Component
All Known Implementing Classes:
Container

public interface Container
extends Component

Container-component which contains other graphical components. Also superclass for specialized containers. Composite pattern is used here.

Author:
Jörg Rüdenauer

Field Summary
 
Fields inherited from interface fdda.graphics.Component
SEL_ALL, SEL_EQUALS, SEL_MOVABLES, SEL_NOTHING
 
Method Summary
 void addElement(Component element)
          Adds an element to the container.
 void clear()
          Removes all elements from the container.
 Component flatten()
          Returns a 'flattened' version of the container.
 ListIterator getIterator()
          Returns an iterator over the container.
 int getSize()
          Returns the current number of elements
 boolean hasElement(Component element)
          Checks whether the container contains a certain element.
 boolean isFlatteningAllowed()
          Returns whether this container allows a 'flattening' operation
 void removeElement(Component element)
          Removes an element from the container.
 
Methods inherited from interface fdda.graphics.Component
clone, deselect, getGraphicalSystem, getShape, getX, getY, isMovable, isSelected, move, recalculateShape, select, selectableWith, setGraphicalSystem, setXY, visit
 

Method Detail

addElement

public void addElement(Component element)
Adds an element to the container. No checks for doubles are performed.

Parameters:
element - the element

removeElement

public void removeElement(Component element)
Removes an element from the container. If the element doesn't exist, the container is unchanged.

Parameters:
element - the element

hasElement

public boolean hasElement(Component element)
Checks whether the container contains a certain element.

Parameters:
element - the element
Returns:
true, iff the container includes this element

clear

public void clear()
Removes all elements from the container.


getIterator

public ListIterator getIterator()
Returns an iterator over the container.

Returns:
a list iterator

getSize

public int getSize()
Returns the current number of elements

Returns:
the number of elements

isFlatteningAllowed

public boolean isFlatteningAllowed()
Returns whether this container allows a 'flattening' operation

Returns:
whether 'flattening' is allowed
See Also:
flatten()

flatten

public Component flatten()
Returns a 'flattened' version of the container. This means two things: firstly, if an element of this container is a container itself and allows flattening, it will be removed from the container and replaced by its elements. Secondly, if the size of the container is 1, not the container, but its element is returned. If the container doesn't allow flattening, it is returned unchanged

Returns:
the flattened version of the container


API documentation for FDDA version 0.9. Generated on 17/02/2004 14:12.