animation.tr
Class Token
(package private) abstract class Token
extends java.lang.Object
angle
protected double angle
Position as Radiant
lastStation
protected int lastStation
Station visited last
pos
protected int pos
Position as angle on the circle (0..360)
priority
protected int priority
Priority of token (0..7)
reservePriority
protected int reservePriority
xcenter
(package private) int xcenter
Dimension of drawing area
xradius
(package private) int xradius
ycenter
(package private) int ycenter
yradius
(package private) int yradius
Token
(package private) Token(int p,
NetPaint np)
p
- initial position as angle of the token on the ring
advanceToken
public Token advanceToken()
advanceToken
public Token advanceToken(int p)
drawToken
public void drawToken()
drawToken
public abstract void drawToken(Graphics g)
Draw the token represented
getBinaryString
private String getBinaryString(int i)
getPrioString
public String getPrioString()
getReservePrioString
public String getReservePrioString()
isAtStation
protected int isAtStation()
Checks if token is on a station
Warning: This algorithm relies on the fact that each degree on
the 360 Degree circle will be hit at least once by the token!
- number of station or -1 if not on station
updateDimensions
public void updateDimensions()