jsim.animator
Class AnimationEntity

java.lang.Object
  extended by jsim.animator.AnimationEntity

public class AnimationEntity
extends java.lang.Object

This class is used as a container for a Shape in the Animator Package of the JSIM simulation package It has data members of type Shape, AffineTransform, and Color


Field Summary
static java.awt.Color BACK_COLOR
          Color scheme for JSIM (easy to change) May also need to adjust colors for entities (see SimObject)
static int FACILITY
           
static java.awt.Color FACILITY_COLOR
           
static int FACILITY_PTS
           
static java.awt.Color FORE_COLOR
           
static int JOIN
           
static java.awt.Color JOIN_COLOR
           
static java.awt.Color LABEL_COLOR
           
static java.awt.Color QUEUE_COLOR
           
static int SERVER
          Node numbers
static java.awt.Color SERVER_COLOR
           
static int SERVER_PTS
           
static int SIGNAL
           
static java.awt.Color SIGNAL_COLOR
           
static int SIGNAL_PTS
           
static int SINK
           
static java.awt.Color SINK_COLOR
           
static int SINK_PTS
           
static int SOURCE
           
static java.awt.Color SOURCE_COLOR
           
static int SOURCE_PTS
           
static int SPLIT
           
static java.awt.Color SPLIT_COLOR
           
static java.awt.Color TOKEN_COLOR
           
static java.awt.Color TRANSPORT_COLOR
           
static int[] X_FACILITY
          Facility
static int[] X_SERVER
          Server
static int[] X_SIGNAL
          Signal
static int[] X_SINK
          Sink
static int[] X_SOURCE
          Source
static int[] Y_FACILITY
           
static int[] Y_SERVER
           
static int[] Y_SIGNAL
           
static int[] Y_SINK
           
static int[] Y_SOURCE
           
 
Constructor Summary
AnimationEntity(int id, int type, java.lang.String name, java.awt.Point position, int numTokens)
          Constructor intended to be called by a derived JSIM example When building initital graph
AnimationEntity(int id, java.awt.Shape shape, java.awt.geom.AffineTransform transform, java.awt.Color color)
          Constructor
AnimationEntity(int id, java.awt.Shape shape, java.awt.geom.AffineTransform transform, java.awt.Color color, java.lang.String label)
          Constructor for Graph node
 
Method Summary
 void adjustNumServiced(int num)
          Adds num to the value of numServiced
 int[] move(int[] coordinates, double length)
          Moves the x or y coordinates of a shape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACK_COLOR

public static final java.awt.Color BACK_COLOR
Color scheme for JSIM (easy to change) May also need to adjust colors for entities (see SimObject)


FORE_COLOR

public static final java.awt.Color FORE_COLOR

SERVER_COLOR

public static final java.awt.Color SERVER_COLOR

FACILITY_COLOR

public static final java.awt.Color FACILITY_COLOR

SIGNAL_COLOR

public static final java.awt.Color SIGNAL_COLOR

SOURCE_COLOR

public static final java.awt.Color SOURCE_COLOR

SINK_COLOR

public static final java.awt.Color SINK_COLOR

TRANSPORT_COLOR

public static final java.awt.Color TRANSPORT_COLOR

TOKEN_COLOR

public static final java.awt.Color TOKEN_COLOR

QUEUE_COLOR

public static final java.awt.Color QUEUE_COLOR

LABEL_COLOR

public static final java.awt.Color LABEL_COLOR

SPLIT_COLOR

public static final java.awt.Color SPLIT_COLOR

JOIN_COLOR

public static final java.awt.Color JOIN_COLOR

SERVER

public static final int SERVER
Node numbers

See Also:
Constant Field Values

FACILITY

public static final int FACILITY
See Also:
Constant Field Values

SIGNAL

public static final int SIGNAL
See Also:
Constant Field Values

SOURCE

public static final int SOURCE
See Also:
Constant Field Values

SINK

public static final int SINK
See Also:
Constant Field Values

SPLIT

public static final int SPLIT
See Also:
Constant Field Values

JOIN

public static final int JOIN
See Also:
Constant Field Values

X_SERVER

public static final int[] X_SERVER
Server


Y_SERVER

public static final int[] Y_SERVER

SERVER_PTS

public static final int SERVER_PTS
See Also:
Constant Field Values

X_FACILITY

public static final int[] X_FACILITY
Facility


Y_FACILITY

public static final int[] Y_FACILITY

FACILITY_PTS

public static final int FACILITY_PTS
See Also:
Constant Field Values

X_SIGNAL

public static final int[] X_SIGNAL
Signal


Y_SIGNAL

public static final int[] Y_SIGNAL

SIGNAL_PTS

public static final int SIGNAL_PTS
See Also:
Constant Field Values

X_SOURCE

public static final int[] X_SOURCE
Source


Y_SOURCE

public static final int[] Y_SOURCE

SOURCE_PTS

public static final int SOURCE_PTS
See Also:
Constant Field Values

X_SINK

public static final int[] X_SINK
Sink


Y_SINK

public static final int[] Y_SINK

SINK_PTS

public static final int SINK_PTS
See Also:
Constant Field Values
Constructor Detail

AnimationEntity

public AnimationEntity(int id,
                       java.awt.Shape shape,
                       java.awt.geom.AffineTransform transform,
                       java.awt.Color color)
Constructor

Parameters:
id - The id of the new entity
shape - The shape of the new entity
transfrom - AffineTransform object associated with the entity
color - Color associated with the entity

AnimationEntity

public AnimationEntity(int id,
                       java.awt.Shape shape,
                       java.awt.geom.AffineTransform transform,
                       java.awt.Color color,
                       java.lang.String label)
Constructor for Graph node

Parameters:
id - The id of the new entity
shape - The shape of the new entity
transfrom - AffineTransform object associated with the entity
color - Color associated with the entity
label - Label for the particular node

AnimationEntity

public AnimationEntity(int id,
                       int type,
                       java.lang.String name,
                       java.awt.Point position,
                       int numTokens)
Constructor intended to be called by a derived JSIM example When building initital graph

Parameters:
id - The id of the new Node
type - Predefined type of Node (Server etc.)
name - Name for the Node
color - Color associated with the Node
x_position - x-coordinate for the Node
y_position - y-coordinate for the Node
numTokens - number of service tokens at the node
Method Detail

move

public int[] move(int[] coordinates,
                  double length)
Moves the x or y coordinates of a shape

Parameters:
coordinates - coordinates to move
length - integer value of the move
Returns:
int[] array representing moved coordinates

adjustNumServiced

public void adjustNumServiced(int num)
Adds num to the value of numServiced

Parameters:
num - the number to add