TrustGrapher  r52
A playabale simulator for modelling trust between agents
cu.trustGrapher.eventplayer.EventPlayer Class Reference
Inheritance diagram for cu.trustGrapher.eventplayer.EventPlayer:
Collaboration diagram for cu.trustGrapher.eventplayer.EventPlayer:

List of all members.

Public Member Functions

 EventPlayer (TrustGrapher trustGrapher, List< TrustLogEvent > events)
TrustGrapher getTrustGrapher ()
List< TrustLogEventgetEvents ()
int getPlayState ()
int getCurrentEventIndex ()
boolean atFront ()
boolean atBack ()
boolean atAnEnd ()
PlaybackPanel getPlaybackPanel ()
LogPanel getLogPanel ()
void addEventPlayerListener (EventPlayerListener listener)
void setDelay (int value)
void setEventsPerTick (int value)
void reverse ()
void forward ()
synchronized void pause ()
void actionPerformed (ActionEvent event)
void goToEvent (int newEventIndex)
void insertEvent (TrustLogEvent event)
void removeEvent ()
void modifyEvent (TrustLogEvent event)

Static Public Attributes

static final int REVERSE = -1
static final int DEFAULT_DELAY = 250

Protected Attributes

TrustGrapher trustGrapher
Timer timer
List< TrustLogEventevents
List< EventPlayerListenerlisteners

Package Attributes

static final int PAUSE = 0
static final int FORWARD = 1
static final int DEFUALT_EVENTS_PER_TICK = 1
int currentEventIndex
int eventsPerTick

Detailed Description

Plays through the list of TrustLogEvents. After each tick, the events that occured between the ticks are sent to the event handlers of all the GraphPairs.

Author:
alan
Andrew O'Hara

Definition at line 23 of file EventPlayer.java.


Constructor & Destructor Documentation

cu.trustGrapher.eventplayer.EventPlayer.EventPlayer ( TrustGrapher  trustGrapher,
List< TrustLogEvent events 
)

Definition at line 34 of file EventPlayer.java.

Here is the call graph for this function:


Member Function Documentation

void cu.trustGrapher.eventplayer.EventPlayer.actionPerformed ( ActionEvent  event)

Called by the timer after every tick. Calls goToEvent with the new eventIndex to go to depending on the playState and the eventsPerTick.

Parameters:
eventThe ActionEvent

Definition at line 209 of file EventPlayer.java.

Here is the call graph for this function:

void cu.trustGrapher.eventplayer.EventPlayer.addEventPlayerListener ( EventPlayerListener  listener)

Adds an EventPlayerListener to the EventPlayer. This will have the EventPlayer notify the listeners of timeline changes.

Parameters:
listener

Definition at line 135 of file EventPlayer.java.

Here is the caller graph for this function:

boolean cu.trustGrapher.eventplayer.EventPlayer.atAnEnd ( )
Returns:
true or false depending on whether or atFront() or atBack() is true

Definition at line 95 of file EventPlayer.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cu.trustGrapher.eventplayer.EventPlayer.atBack ( )
Returns:
true or false depending on whether or not the currentEventIndex is the last one in the event list

Definition at line 87 of file EventPlayer.java.

Here is the caller graph for this function:

boolean cu.trustGrapher.eventplayer.EventPlayer.atFront ( )
Returns:
true or false depending on whether or not the currentEventIndex is 0

Definition at line 80 of file EventPlayer.java.

Here is the caller graph for this function:

void cu.trustGrapher.eventplayer.EventPlayer.forward ( )

Sets the EventPlayer to play backward. Never modify the playState directly. Always use this.

Definition at line 172 of file EventPlayer.java.

Here is the caller graph for this function:

int cu.trustGrapher.eventplayer.EventPlayer.getCurrentEventIndex ( )
Returns:
The index of the event that the EventPlayer is currently at

Definition at line 73 of file EventPlayer.java.

Here is the caller graph for this function:

List<TrustLogEvent> cu.trustGrapher.eventplayer.EventPlayer.getEvents ( )

Definition at line 58 of file EventPlayer.java.

Here is the caller graph for this function:

LogPanel cu.trustGrapher.eventplayer.EventPlayer.getLogPanel ( )

Searches through the list of listeners and returns the first one that is an instance of a LogPanel. If the logPanel can not be found, an error message is shown, as this should never happen.

Returns:
The LogPanel listening to this EventPlayer

Definition at line 119 of file EventPlayer.java.

Here is the caller graph for this function:

PlaybackPanel cu.trustGrapher.eventplayer.EventPlayer.getPlaybackPanel ( )

Searches through the list of listeners and returns the first one that is an instance of a playbackPanel. If the playbackPanel can not be found, an error message is shown, as this should never happen.

Returns:
The playbackPanel listening to this EventPlayer

Definition at line 104 of file EventPlayer.java.

Here is the caller graph for this function:

int cu.trustGrapher.eventplayer.EventPlayer.getPlayState ( )

Returns the current playstate of the EventPlayer in an integer form. Refer to the static ints for their names.

Returns:
The playstate int representation

Definition at line 66 of file EventPlayer.java.

Here is the caller graph for this function:

TrustGrapher cu.trustGrapher.eventplayer.EventPlayer.getTrustGrapher ( )

Definition at line 54 of file EventPlayer.java.

Here is the caller graph for this function:

void cu.trustGrapher.eventplayer.EventPlayer.goToEvent ( int  newEventIndex)

The EventPlayer processes the events between the currentEventIndex and the new one, then updates the GraphViewers. If the newEventIndex is out of the bounds of the event list, it is brought into the bounds. If the newEventIndex is an end of the event list, playback is paused.

Parameters:
newEventIndexThe index of the event to go to

Definition at line 221 of file EventPlayer.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cu.trustGrapher.eventplayer.EventPlayer.insertEvent ( TrustLogEvent  event)

Rewinds to the start of the simulation, then calls startGraph() with the new event list that has had the new event added to restart the simulation.

Parameters:
eventThe new event to add

Definition at line 265 of file EventPlayer.java.

Here is the call graph for this function:

void cu.trustGrapher.eventplayer.EventPlayer.modifyEvent ( TrustLogEvent  event)

Rewinds to the start of the simulation, then calls startGraph() with the new event list that has had the event at the previous index modified to restart the simulation.

Parameters:
event

Definition at line 299 of file EventPlayer.java.

Here is the call graph for this function:

synchronized void cu.trustGrapher.eventplayer.EventPlayer.pause ( )

Sets the EventPlayer to pause. Never modify the playState directly. Always use this.

Definition at line 195 of file EventPlayer.java.

Here is the caller graph for this function:

void cu.trustGrapher.eventplayer.EventPlayer.removeEvent ( )

Rewinds to the start of the simulation, then calls startGraph() with the new event list that has had the event at the previous index removed to restart the simulation.

Definition at line 282 of file EventPlayer.java.

Here is the call graph for this function:

void cu.trustGrapher.eventplayer.EventPlayer.reverse ( )

Plays the EventPlayer to play forward. Never modify the playState directly. Always use this.

Definition at line 160 of file EventPlayer.java.

Here is the caller graph for this function:

void cu.trustGrapher.eventplayer.EventPlayer.setDelay ( int  value)

Sets the delay of the timer. The Event Player will now tick after the new number of milliseconds.

Parameters:
valuethe new millisecond value to set the timer delay to

Definition at line 143 of file EventPlayer.java.

Here is the caller graph for this function:

void cu.trustGrapher.eventplayer.EventPlayer.setEventsPerTick ( int  value)

Sets the number of events for the EventPlayer to process after each tick. The viewers only update after all the events during each tick are processed.

Parameters:
valueThe number of events to process during each tick

Definition at line 152 of file EventPlayer.java.

Here is the caller graph for this function:


Member Data Documentation

Definition at line 26 of file EventPlayer.java.

Definition at line 26 of file EventPlayer.java.

Definition at line 25 of file EventPlayer.java.

Definition at line 25 of file EventPlayer.java.

Definition at line 25 of file EventPlayer.java.

Definition at line 29 of file EventPlayer.java.


The documentation for this class was generated from the following file: