![]() |
AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
|
Example for a simple decorator. More...
Public Member Functions | |
void | highlightNode (GraphvizDecorable object) |
Set highlighted node. More... | |
void | highlightEdge (GraphvizDecorable object) |
Set highlighted edge. More... | |
void | markNode (GraphvizDecorable object) |
void | unmarkNode (GraphvizDecorable object) |
unmark node object More... | |
void | unmarkAllNodes () |
unmark all nodes More... | |
void | markEdge (GraphvizDecorable object) |
void | unmarkEdge (GraphvizDecorable object) |
unmark edge object More... | |
void | unmarkAllEdges () |
unmark all edges More... | |
String | getNodeDecoration (GraphvizDecorable object) |
get node decoration More... | |
String | getEdgeDecoration (GraphvizDecorable object) |
get node decoration More... | |
![]() | |
abstract void | highlightNode (GraphvizDecorable object) |
Set highlighted node. More... | |
abstract void | highlightEdge (GraphvizDecorable object) |
Set highlighted edge. More... | |
abstract void | markNode (GraphvizDecorable object) |
abstract void | unmarkNode (GraphvizDecorable object) |
unmark node object More... | |
abstract void | unmarkAllNodes () |
unmark all nodes More... | |
abstract void | markEdge (GraphvizDecorable object) |
abstract void | unmarkEdge (GraphvizDecorable object) |
unmark edge object More... | |
abstract void | unmarkAllEdges () |
unmark all edges More... | |
String | getGraphLabel () |
get label More... | |
void | setGraphLabel (String text) |
set label More... | |
void | clear () |
Clear all decorations. More... | |
String | getGraphDecoration (GraphvizDecorable object) |
get graph decoration (returns same for all nodes/edges) More... | |
String | getAllNodesDecoration () |
get standard decoration for all nodes (list head) More... | |
String | getAllEdgesDecoration () |
get standard decoration for all edges (list head) More... | |
String | getGlobalStyle () |
get global style (returns same for all nodes/edges) More... | |
![]() | |
String | getNodeDecoration (GraphvizDecorable object) |
get node decoration More... | |
String | getEdgeDecoration (GraphvizDecorable object) |
get node decoration More... | |
String | getGraphDecoration (GraphvizDecorable object) |
get graph decoration (returns same for all nodes/edges) More... | |
String | getAllNodesDecoration () |
get standard decoration for all nodes (list head) More... | |
String | getAllEdgesDecoration () |
get standard decoration for all edges (list head) More... | |
String | getGlobalStyle () |
get global style (returns same for all nodes/edges) More... | |
String | getFullNodeDecoration (GraphvizDecorable object) |
concatenates getAllNodesDecoration and getNodeDecoration More... | |
String | getFullEdgeDecoration (GraphvizDecorable object) |
concatenates getAllEdgesDecoration and getEdgeDecoration More... | |
Protected Attributes | |
GraphvizDecorable | hilit_node = null |
GraphvizDecorable | hilit_edge = null |
HashSet< GraphvizDecorable > | marked_nodes = new HashSet<GraphvizDecorable>() |
HashSet< GraphvizDecorable > | marked_edges = new HashSet<GraphvizDecorable>() |
![]() | |
String | all_nodes_style = "shape=circle" |
String | all_edges_style = null |
String | global_style = null |
String | graph_style = "fontsize=24" |
String | graph_label = null |
String | hilit_node_style = "style=filled,fillcolor=yellow,penwidth=2" |
String | hilit_edge_style = "color=red,penwidth=2" |
String | marked_node_style = "style=filled,fillcolor=lightgray,penwidth=1.5" |
String | marked_edge_style = "color=blue,penwidth=1.5" |
Example for a simple decorator.
The entire state is held in the decorator instance. There is no access of/no need for node and edge attributes.
Definition at line 10 of file SimpleDecorator.java.
String aud.util.SimpleDecorator.getEdgeDecoration | ( | GraphvizDecorable | object | ) |
get node decoration
Reimplemented from aud.util.GraphvizDecorator.
Definition at line 54 of file SimpleDecorator.java.
References aud.util.SimpleDecorator.hilit_edge, aud.util.CommonGraphvizDecorator.hilit_edge_style, aud.util.CommonGraphvizDecorator.marked_edge_style, and aud.util.SimpleDecorator.marked_edges.
String aud.util.SimpleDecorator.getNodeDecoration | ( | GraphvizDecorable | object | ) |
get node decoration
Reimplemented from aud.util.GraphvizDecorator.
Definition at line 45 of file SimpleDecorator.java.
References aud.util.SimpleDecorator.hilit_node, aud.util.CommonGraphvizDecorator.hilit_node_style, aud.util.CommonGraphvizDecorator.marked_node_style, and aud.util.SimpleDecorator.marked_nodes.
void aud.util.SimpleDecorator.highlightEdge | ( | GraphvizDecorable | object | ) |
Set highlighted edge.
Reimplemented from aud.util.CommonGraphvizDecorator.
Definition at line 21 of file SimpleDecorator.java.
References aud.util.SimpleDecorator.hilit_edge.
void aud.util.SimpleDecorator.highlightNode | ( | GraphvizDecorable | object | ) |
Set highlighted node.
There is exactly one or no such node.
object | node or null (no highlight) |
Reimplemented from aud.util.CommonGraphvizDecorator.
Definition at line 18 of file SimpleDecorator.java.
References aud.util.SimpleDecorator.hilit_node.
Referenced by aud.example.expr.ExpressionTreeTraversal.levelorder(), aud.example.expr.ExpressionTreeTraversal.output(), aud.example.BinaryTreeTraversal.output(), aud.example.BinaryTreeTraversal.traverse(), and aud.example.expr.ExpressionTreeTraversal.traverse().
void aud.util.SimpleDecorator.markEdge | ( | GraphvizDecorable | object | ) |
Reimplemented from aud.util.CommonGraphvizDecorator.
Definition at line 35 of file SimpleDecorator.java.
References aud.util.SimpleDecorator.marked_edges.
Referenced by aud.example.expr.ExpressionTreeTraversal.see(), and aud.example.BinaryTreeTraversal.see().
void aud.util.SimpleDecorator.markNode | ( | GraphvizDecorable | object | ) |
Reimplemented from aud.util.CommonGraphvizDecorator.
Definition at line 25 of file SimpleDecorator.java.
References aud.util.SimpleDecorator.marked_nodes.
Referenced by aud.example.expr.ExpressionTreeTraversal.output(), and aud.example.BinaryTreeTraversal.output().
void aud.util.SimpleDecorator.unmarkAllEdges | ( | ) |
unmark all edges
Reimplemented from aud.util.CommonGraphvizDecorator.
Definition at line 41 of file SimpleDecorator.java.
References aud.util.SimpleDecorator.marked_edges.
void aud.util.SimpleDecorator.unmarkAllNodes | ( | ) |
unmark all nodes
Reimplemented from aud.util.CommonGraphvizDecorator.
Definition at line 31 of file SimpleDecorator.java.
References aud.util.SimpleDecorator.marked_nodes.
void aud.util.SimpleDecorator.unmarkEdge | ( | GraphvizDecorable | object | ) |
unmark edge object
Reimplemented from aud.util.CommonGraphvizDecorator.
Definition at line 38 of file SimpleDecorator.java.
References aud.util.SimpleDecorator.marked_edges.
void aud.util.SimpleDecorator.unmarkNode | ( | GraphvizDecorable | object | ) |
unmark node object
Reimplemented from aud.util.CommonGraphvizDecorator.
Definition at line 28 of file SimpleDecorator.java.
References aud.util.SimpleDecorator.marked_nodes.
|
protected |
Definition at line 13 of file SimpleDecorator.java.
Referenced by aud.util.SimpleDecorator.getEdgeDecoration(), and aud.util.SimpleDecorator.highlightEdge().
|
protected |
Definition at line 12 of file SimpleDecorator.java.
Referenced by aud.util.SimpleDecorator.getNodeDecoration(), and aud.util.SimpleDecorator.highlightNode().
|
protected |
Definition at line 16 of file SimpleDecorator.java.
Referenced by aud.util.SimpleDecorator.getEdgeDecoration(), aud.util.SimpleDecorator.markEdge(), aud.util.SimpleDecorator.unmarkAllEdges(), and aud.util.SimpleDecorator.unmarkEdge().
|
protected |
Definition at line 15 of file SimpleDecorator.java.
Referenced by aud.util.SimpleDecorator.getNodeDecoration(), aud.util.SimpleDecorator.markNode(), aud.util.SimpleDecorator.unmarkAllNodes(), and aud.util.SimpleDecorator.unmarkNode().