Class tred.Graph
All Packages Class Hierarchy This Package Previous Next Index
Class tred.Graph
java.lang.Object
|
+----tred.EditorObject
|
+----tred.EditorPanel
|
+----tred.NodePanel
|
+----tred.Graph
- public class Graph
- extends NodePanel
Implementation to Graph.
-
Graph(GraphPanel, String, String, int)
-
This is the default constructor for Graph.
-
getState(String)
-
This method is invoked in order to get the state of this panel for
export.
-
newState(int, Edge, boolean)
-
This method is invoked by class Edge to keep track of visit order.
-
paint(Graphics)
-
This method is invoked when this graph is drawed on the screen.
Graph
public Graph(GraphPanel panel,
String label,
String items,
int space)
- This is the default constructor for Graph.
This constructor invokes the super constructor with no parameter items.
This is in order to do not let the super constructor to create items
for every single mark in the items string because the structure of string
items is not same as with the other panels. So, this constructor parses
the string items by itself and creates the neccessary slot and edge
objects.
newState
protected void newState(int id,
Edge edge,
boolean traveled)
- This method is invoked by class Edge to keep track of visit order.
- Parameters:
- id - is the id-number of this edge
(initialized by constructor Graph).
- edge - is the edge which cghanged it's state.
- traveled - is true if the edge is set, false if the edge is unset.
getState
protected String getState(String str)
- This method is invoked in order to get the state of this panel for
export.
- Parameters:
- str - is the substitute string for empty slot.
- Returns:
- the current state (string of items in the slots) of this panel.
- Overrides:
- getState in class EditorPanel
- See Also:
- export
paint
public boolean paint(Graphics g)
- This method is invoked when this graph is drawed on the screen.
This method draws the name of the Graph to top of the area.
After that all the slots are drawed as Graph-like style by
invoking the paint method for slots and then drawing all the
edges needed.
- Returns:
- allways true.
- Overrides:
- paint in class NodePanel
All Packages Class Hierarchy This Package Previous Next Index