|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgoanim.primitives.Primitive
algoanim.primitives.Graph
public class Graph
Represents a graph
| Field Summary | |
|---|---|
protected int[][] |
adjacencyMatrix
|
protected java.lang.String[] |
nodeLabels
|
protected Node[] |
nodes
|
| Fields inherited from class algoanim.primitives.Primitive |
|---|
gen |
| Constructor Summary | |
|---|---|
Graph(GraphGenerator graphGen,
java.lang.String name,
int[][] graphAdjacencyMatrix,
Node[] graphNodes,
java.lang.String[] labels,
DisplayOptions display,
GraphProperties props)
Instantiates the Graph and calls the create() method of the
associated GraphGenerator. |
|
| Method Summary | |
|---|---|
int[][] |
getAdjacencyMatrix()
Returns the adjacency matrix of this Graph element. |
int[] |
getEdgesForNode(int node)
Returns the adjacency matrix of this Graph element. |
int |
getEdgeWeight(int fromNode,
int toNode)
|
Node |
getNode(int nodeNr)
|
java.lang.String |
getNodeLabel(int nodeNr)
|
GraphProperties |
getProperties()
Returns the properties of this Graph element. |
int |
getSize()
|
Node |
getStartKnoten()
|
Node |
getZielKnoten()
|
void |
hideEdge(int startNode,
int endNode,
Timing offset,
Timing duration)
show a selected (previously visible?) graph edge by turning it invisible |
void |
hideEdgeWeight(int startNode,
int endNode,
Timing offset,
Timing duration)
hides a selected (previously visible?) graph edge weight by turning it invisible |
void |
hideNode(int index,
Timing offset,
Timing duration)
hide a selected graph node by turning it invisible |
void |
hideNodes(int[] indices,
Timing offset,
Timing duration)
hide a selected set of graph nodes by turning them invisible |
void |
highlightEdge(int startNode,
int endNode,
Timing offset,
Timing duration)
Highlights the graph edge at a given position after a distinct offset. |
void |
highlightNode(int node,
Timing offset,
Timing duration)
Highlights the chosen graph node after a distinct offset. |
void |
setEdgeWeight(int fromNode,
int toNode,
int weight,
Timing offset,
Timing duration)
|
void |
setEdgeWeight(int fromNode,
int toNode,
java.lang.String weight,
Timing offset,
Timing duration)
|
void |
setName(java.lang.String newName)
Sets the name of this Primitive. |
void |
setStartKnoten(Node node)
|
void |
setZielKnoten(Node node)
|
void |
showEdge(int startNode,
int endNode,
Timing offset,
Timing duration)
show a selected (previously hidden) graph edge by turning it visible |
void |
showEdgeWeight(int startNode,
int endNode,
Timing offset,
Timing duration)
show a selected (previously invisible?) graph edge weight by turning it visible |
void |
showNode(int index,
Timing offset,
Timing duration)
show a selected (previously hidden) graph node by turning it visible |
void |
showNodes(int[] indices,
Timing offset,
Timing duration)
show a selected (previously hidden) graph node by turning it visible |
void |
translateNode(int nodeIndex,
Node location,
Timing offset,
Timing duration)
|
void |
translateNodes(int[] nodeIndices,
Node location,
Timing offset,
Timing duration)
|
void |
translateWithFixedNodes(int[] nodeIndices,
Node location,
Timing offset,
Timing duration)
|
void |
unhighlightEdge(int startNode,
int endNode,
Timing offset,
Timing duration)
Unhighlights the graph edge at a given position after a distinct offset. |
void |
unhighlightNode(int node,
Timing offset,
Timing duration)
Unhighlights the chosen graph node after a distinct offset. |
| Methods inherited from class algoanim.primitives.Primitive |
|---|
changeColor, exchange, getDisplayOptions, getName, hide, hide, moveBy, moveTo, moveVia, rotate, rotate, show, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String[] nodeLabels
protected Node[] nodes
protected int[][] adjacencyMatrix
| Constructor Detail |
|---|
public Graph(GraphGenerator graphGen,
java.lang.String name,
int[][] graphAdjacencyMatrix,
Node[] graphNodes,
java.lang.String[] labels,
DisplayOptions display,
GraphProperties props)
Graph and calls the create() method of the
associated GraphGenerator.
graphGen - the appropriate code Generator.name - the name for the graphgraphAdjacencyMatrix - the adjacency matrix for the graphgraphNodes - the graph's nodeslabels - the labels for the graph nodesdisplay - [optional] the DisplayOptions of this
Text element.props - [optional] the properties of this Text element.| Method Detail |
|---|
public GraphProperties getProperties()
Graph element.
Graph element.public int[][] getAdjacencyMatrix()
Graph element.
Graph element.public int getSize()
public Node getNode(int nodeNr)
public java.lang.String getNodeLabel(int nodeNr)
public int[] getEdgesForNode(int node)
Graph element.
Graph element.
public int getEdgeWeight(int fromNode,
int toNode)
public void setEdgeWeight(int fromNode,
int toNode,
int weight,
Timing offset,
Timing duration)
public void setEdgeWeight(int fromNode,
int toNode,
java.lang.String weight,
Timing offset,
Timing duration)
public void hideNode(int index,
Timing offset,
Timing duration)
index - the index of the node to be hiddenoffset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void hideNodes(int[] indices,
Timing offset,
Timing duration)
indices - the set of node indices to be hiddenoffset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void hideEdge(int startNode,
int endNode,
Timing offset,
Timing duration)
startNode - the start node of the edge to be hiddenendNode - the end node of the edge to be hiddenoffset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void hideEdgeWeight(int startNode,
int endNode,
Timing offset,
Timing duration)
startNode - the start node of the edge weight to be hiddenendNode - the end node of the edge weightto be hiddenoffset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void showEdge(int startNode,
int endNode,
Timing offset,
Timing duration)
startNode - the start node of the edge to be shownendNode - the end node of the edge to be hiddenoffset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void showEdgeWeight(int startNode,
int endNode,
Timing offset,
Timing duration)
startNode - the start node of the edge weight to be shownendNode - the end node of the edge weightto be shownoffset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void showNode(int index,
Timing offset,
Timing duration)
index - the index of the node to be shownoffset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void showNodes(int[] indices,
Timing offset,
Timing duration)
indices - the index of the node to be shownoffset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void highlightEdge(int startNode,
int endNode,
Timing offset,
Timing duration)
startNode - the start node of the edge to highlight.endNode - the end node of the edge to highlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void unhighlightEdge(int startNode,
int endNode,
Timing offset,
Timing duration)
startNode - the start node of the edge to unhighlight.endNode - the end node of the edge to unhighlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void highlightNode(int node,
Timing offset,
Timing duration)
node - the node to highlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void unhighlightNode(int node,
Timing offset,
Timing duration)
node - the node to unhighlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void translateNode(int nodeIndex,
Node location,
Timing offset,
Timing duration)
public void translateWithFixedNodes(int[] nodeIndices,
Node location,
Timing offset,
Timing duration)
public void translateNodes(int[] nodeIndices,
Node location,
Timing offset,
Timing duration)
public void setName(java.lang.String newName)
PrimitivePrimitive.
setName in class PrimitivenewName - the new name for this Primitive.Primitive.setName(java.lang.String)public void setStartKnoten(Node node)
public void setZielKnoten(Node node)
public Node getStartKnoten()
public Node getZielKnoten()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||