Animator

scalation.animation.Animator
class Animator(graph: Dgraph) extends Transform

The Animator class implements the commands to create, destroy, move and scale components (nodes, edges or tokens) in an animated graph.

Value parameters

graph

the directed graph to be animated

Attributes

Graph
Supertypes
trait Transform
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def createEdge(eid: Int, shape: CurvilinearShape, label: String, primary: Boolean, color: Color, from_eid: Int, to_eid: Int, pts: Array[Double], shift: Int): Unit

Create an edge at the given location.

Create an edge at the given location.

Value parameters

color

the color of the token

eid

the external id for the edge

from_eid

the eid of the origination node

label

the label for the created edge

primary

whether it is a primary (true) or secondary (false)

pts

the coordinates and dimensions of the edge

shape

the shape (curve) of the edge

shift

amount of distance to shift the edge to accommodate, e.g., a bundle of edges in a composite edge

to_eid

the eid of the destination node

Attributes

def createNode(eid: Int, shape: RectPolyShape, label: String, primary: Boolean, color: Color, pts: Array[Double]): Unit

Create a node at the given location.

Create a node at the given location.

Value parameters

color

the color of the node

eid

the external id for the node

label

the label for the created node

primary

whether node is primary/transition (true) or secondary/place (false)

pts

the coordinates and dimensions of the node

shape

the shape of the node

Attributes

def createToken(eid: Int, shape: RectangularShape, label: String, primary: Boolean, color: Color, on_eid: Int, pts: Array[Double]): Unit

Create a token at the given location.

Create a token at the given location.

Value parameters

color

the color of the token

eid

the external id for the token

label

the label for the created token

on_eid

the eid of the node it is on

primary

whether it is a primary (true) or secondary (false)

pts

the coordinates and dimensions of the token

shape

the shape of the token

Attributes

def destroyEdge(eid: Int): Unit

Destroy the edge with the given id.

Destroy the edge with the given id.

Value parameters

eid

the edges's external id

Attributes

def destroyNode(eid: Int): Unit

Destroy the node with the given id.

Destroy the node with the given id.

Value parameters

eid

the node's external id

Attributes

def destroyToken(eid: Int): Unit

Destroy the token with the given id.

Destroy the token with the given id.

Value parameters

eid

the token's external id

Attributes

def moveNode(eid: Int, pts: Array[Double]): Unit

Move the node to a new (x, y) location. Edges cannot be moved directly, but must adjust to node movements.

Move the node to a new (x, y) location. Edges cannot be moved directly, but must adjust to node movements.

Value parameters

eid

the external id of the node to move

pts

the new x, y -coordinates

Attributes

def moveToken(eid: Int, pts: Array[Double]): Unit

Move the token to a new (x, y) location.

Move the token to a new (x, y) location.

Value parameters

eid

the external id of the token to move

pts

the new x, y -coordinates

Attributes

def moveToken2Edge(eid: Int, edge_eid: Int, step: Double): Boolean

Move the token along the curve for an edge and return false if at end of curve.

Move the token along the curve for an edge and return false if at end of curve.

Value parameters

edge_eid

the external id for edge to move along

eid

the external id for the token to move

step

the length of step

Attributes

def moveToken2Node(eid: Int, node_eid: Int): Unit

Move the token onto the new node.

Move the token onto the new node.

Value parameters

eid

the external id of the token to move

node_eid

the external id of the node to move onto

Attributes

def moveTokens2Node(color: Color, from_eid: Int, to_eid: Int, pts: Array[Double]): Unit

Move number tokens of color color from node from_eid to node to_eid.

Move number tokens of color color from node from_eid to node to_eid.

Value parameters

color

the color of the tokens to move

from_eid

the external id of the node tokens are to be taken from

pts

one dimensional array containing number of tokens to move

to_eid

the external id of the node the tokens are to be moved to

Attributes

def scaleNode(eid: Int, pts: Array[Double]): Unit

Scale the node, i.e., make it larger or smaller. Edges cannot be scaled directly, but must adjust to node scaling.

Scale the node, i.e., make it larger or smaller. Edges cannot be scaled directly, but must adjust to node scaling.

Value parameters

eid

the external id of the node to scale

pts

the new width, height dimensions

Attributes

def scaleToken(eid: Int, pts: Array[Double]): Unit

Scale the token, i.e., make it larger or smaller.

Scale the token, i.e., make it larger or smaller.

Value parameters

eid

the external id of the token to scale

pts

the new width, height dimensions

Attributes

def scaleTokensAt(color: Color, from_eid: Int, to_eid: Int, pts: Array[Double]): Unit

Move amount tokens/fluids of color color from node from_eid to node to_eid by increasing the size of tokens at to_eid while decreasing the size at from_eid.

Move amount tokens/fluids of color color from node from_eid to node to_eid by increasing the size of tokens at to_eid while decreasing the size at from_eid.

Value parameters

color

the color of the tokens/fluids to move

from_eid

the external id of the node tokens/fluids are to be taken from

pts

one dimensional array containing amount of fluids to move

to_eid

the external id of the node tokens/fluids are to be moved to

Attributes

def setPaintEdge(eid: Int, color: Color): Unit

Set the paint color for the edge.

Set the paint color for the edge.

Value parameters

color

the new color for the node

eid

the external id for node to paint

Attributes

def setPaintNode(eid: Int, color: Color): Unit

Set the paint color for the node.

Set the paint color for the node.

Value parameters

color

the new color for the node

eid

the external id for node to paint

Attributes

def setPaintToken(eid: Int, color: Color): Unit

Set the paint color for the token.

Set the paint color for the token.

Value parameters

color

the new color for the node

eid

the external id for node to paint

Attributes

def timeDilation(pts: Array[Double]): Unit

Adjust the time dilation: >1 slows down animation, <1 speeds up animation.

Adjust the time dilation: >1 slows down animation, <1 speeds up animation.

Value parameters

pts

one dimensional array containing the new time dilation factor

Attributes

def timeDilationFactor: Double

Get the time dilation factor.

Get the time dilation factor.

Attributes

Inherited methods

def move(shape: RectPolyShape, p: Array[Double]): Unit

Move/translate the shape to location (x, y).

Move/translate the shape to location (x, y).

Value parameters

p

the point (x, y)-coordinates

shape

the shape/object to move

Attributes

Inherited from:
Transform
def move(shape: RectPolyShape, x: Double, y: Double): Unit

Move/translate the shape to location (x, y).

Move/translate the shape to location (x, y).

Value parameters

shape

the shape/object to move

x

the x-coordinate

y

the y-coordinate

Attributes

Inherited from:
Transform
def rotate(shape: RectangularShape, theta: Double): Unit

Rotate the shape by theta radians.

Rotate the shape by theta radians.

Value parameters

shape

the shape/object to rotate

theta

the rotation angle in radians

Attributes

Inherited from:
Transform
def scale(shape: RectPolyShape, p: Array[Double]): Unit

Scale/resize the shape to the new width and height parameters.

Scale/resize the shape to the new width and height parameters.

Value parameters

p

the point (w, h) parameters

shape

the shape/object to scale (change size)

Attributes

Inherited from:
Transform
def scale(shape: RectPolyShape, w: Double, h: Double): Unit

Scale/resize the shape to the new width and height parameters.

Scale/resize the shape to the new width and height parameters.

Value parameters

h

the height

shape

the shape/object to scale (change size)

w

the width

Attributes

Inherited from:
Transform