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.
-
elements
-
-
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.
-
addPanel(Element)
-
This method is invoked when a new Element is created.
-
getSpace()
-
This method returns the absolute space between subelements of
this element.
-
move(int, int)
-
This method is implemented to be subclassed.
-
paint(Graphics)
- This method is invoked when this element is drawn into the screen.
elements
public ListObject elements
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.
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)
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()
move
public void move(int x,
int y)
- This method is implemented to be subclassed.
- Overrides:
- move in class EditorObject
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