class Dgraph extends Error
The Dgraph
class is for defining graph structures suitable for animation.
Graphs consist of nodes, edges and tokens. Tokens can be positioned within
nodes or on edges. A graph animation class that uses this class would typically
move the tokens by changing there location over time. This class supports both
directed graphs and bipartite graphs. Directed graphs contain only primary
nodes, while bipartite graphs have both primary and secondary nodes along with
the rule that edges must go from primaries to secondaries or secondaries to
primaries. Bipartite graphs can be used to represent Petri Nets by letting
Transitions be primary nodes and Places be secondary nodes. Everything can be
labeled (nodes, edges and tokens as well as the graph itself). Nodes and edges
may be added to/removed from graphs, while tokens may be added to/removed from
either nodes or edges. Tokens may also be free (not bound to nodes or edges).
- Alphabetic
- By Inheritance
- Dgraph
- Error
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Dgraph(name: String = "Dgraph", bipartite: Boolean = false)
Type Members
-
case class
Edge
(shape: CurvilinearShape, label: String, primary: Boolean, color: Color, from: Node, to: Node, bend: Double) extends Product with Serializable
This class is used to represent edges in the graph.
This class is used to represent edges in the graph. If bend = 0, a straight line is created, otherwise a quadratic curve is created.
- shape
the shape (line/curve) of the edge
- label
the label for the created edge
- primary
whether it is a primary/transition/true or secondary/place node/false
- color
the color of the edge
- from
the origination node
- to
the destination node
- bend
the amount of bend in the curve
-
case class
Node
(shape: RectangularShape, label: String, primary: Boolean, color: Color, x: Double, y: Double, w: Double, h: Double) extends Product with Serializable
This class is used to represent nodes in the graph.
This class is used to represent nodes in the graph.
- shape
the shape of the node
- label
the label for the created node
- primary
whether it is a primary/transition/true or secondary/place node/false
- color
the color of the node
- x
the x-coordinate (top left)
- y
the y-coordinate (top left)
- w
the width
- h
the height
-
case class
Token
(shape: RectangularShape, label: String, primary: Boolean, color: Color, onNode: Node, w: Double, h: Double) extends Product with Serializable
This class is used to represent tokens in the graph.
This class is used to represent tokens in the graph.
- shape
the shape of the token
- label
the label for the created token
- primary
whether the token is primary/free/true to secondary/bound/false
- color
the color of the token
- onNode
the node the token is on
- w
the width of the token
- h
the height of the token
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addEdge(e: Edge): Unit
Add an edge to the graph.
Add an edge to the graph.
- e
the edge to add
-
def
addFreeToken(t: Token): Unit
Add a free token to the graph.
Add a free token to the graph.
- t
the free token to add
-
def
addNode(n: Node): Unit
Add a node to the graph.
Add a node to the graph.
- n
the node to add
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
val
edges: ListBuffer[Edge]
List of edges in the graph
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
val
freeTokens: ListBuffer[Token]
List of free tokens in the graph (bound tokens must be in a nodes or edges list)
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getRoots: ListBuffer[Node]
Get all the root nodes (those with no incoming edges).
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
val
nodes: ListBuffer[Node]
List of nodes in the graph
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
removeEdge(e: Edge): Unit
Remove an edge from the graph.
Remove an edge from the graph.
- e
the edge to remove
-
def
removeFreeToken(t: Token): Unit
Remove a free token from the graph.
Remove a free token from the graph.
- t
the free token to remove
-
def
removeNode(n: Node): Unit
Remove a node from the graph.
Remove a node from the graph.
- n
the node to remove
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
traverse(n: Node, level: Int): Unit
Recursively visit all nodes in the graph.
Recursively visit all nodes in the graph.
- n
the current node
- level
the recursion level
-
def
traverseNodes(): Unit
Traverse the graph printing out its nodes and showing connectivity by indentation.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )