Class tred.Element
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tred.Element

java.lang.Object
   |
   +----tred.EditorObject
           |
           +----tred.Element

public class Element
extends EditorObject
An abstract class Element is a container for other elements. These subelements may be elements, edges, slots or items. This class is intended to be subclassed so that the subclass gives the structure of the subelements.

Variable Index

 o elements

Constructor Index

 o Element(GraphPanel, String, int)
This is the abstract contructor for all elements and every subclass should invoke this constructor in order to set the fields graphPanel, label and space.

Method Index

 o addPanel(Element)
This method is invoked when a new Element is created.
 o getSpace()
This method returns the absolute space between subelements of this element.
 o move(int, int)
This method is implemented to be subclassed.
 o paint(Graphics)
This method is invoked when this element is drawn into the screen.

Variables

 o elements
  public ListObject elements

Constructors

 o Element
  public Element(GraphPanel graphPanel,
                 String label,
                 int space)
This is the abstract contructor for all elements and every subclass should invoke this constructor in order to set the fields graphPanel, label and space. This constructor also sets the logical position of the panel on the screen (x,y,width,height), updates some fields in graphPanel and creates new AnimatedImpl object (if one is not allready created). Finally this object is added into graphPanel.
Parameters:
graphPanel - which this panel belongs to.
label - is the name of this panel.
space - is the space between slots.

Methods

 o getSpace
  public final int getSpace()
This method returns the absolute space between subelements of this element. Variable space is the relative space between subelements given at the initialization of the element.
Returns:
(int) (space * itemsize / 100)
 o addPanel
  public void addPanel(Element element)
This method is invoked when a new Element is created. The call is forwarded to AnimatedImpl.addPanel.
See Also:
addPanel()
 o move
  public void move(int x,
                   int y)
This method is implemented to be subclassed.
Overrides:
move in class EditorObject
 o paint
  public boolean paint(Graphics g)
This method is invoked when this element is drawn into the screen.
Overrides:
paint in class EditorObject

All Packages  Class Hierarchy  This Package  Previous  Next  Index