jrobots.graphics
Class GUI

java.lang.Object
  extended by jrobots.graphics.GUI
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.MouseListener, java.util.EventListener, javax.swing.event.ChangeListener

public class GUI
extends java.lang.Object
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.awt.event.MouseListener

This class represents the GUI as a whole. Any interaction with the GUI must go through this class.


Field Summary
 javax.media.opengl.GLCanvas arena
           
 PlayButton buttonPlayPause
           
 SimulateButton buttonSimulate
           
static GUI gui
           
 javax.swing.JSlider timelineSlider
           
 
Constructor Summary
GUI()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          This is the eventhandler for all buttons.
 void clickPlayPauseButton()
          Toggles the "Play/Pause" button.
 int getCurrentSimulationStateIndex()
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
          This method is called wehen there is a MouseEvent at the BotList
 void setCurrentSimulationStateIndex(int index)
          This method tells the GUI which SimulationState should be displayed (until further notice).
 void stateChanged(javax.swing.event.ChangeEvent e)
          This method is called if the timeline slider in the GUI changes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gui

public static GUI gui

buttonPlayPause

public PlayButton buttonPlayPause

buttonSimulate

public SimulateButton buttonSimulate

timelineSlider

public javax.swing.JSlider timelineSlider

arena

public javax.media.opengl.GLCanvas arena
Constructor Detail

GUI

public GUI()
Method Detail

setCurrentSimulationStateIndex

public void setCurrentSimulationStateIndex(int index)
This method tells the GUI which SimulationState should be displayed (until further notice).

Parameters:
index - into the SimulationRun list of states

clickPlayPauseButton

public void clickPlayPauseButton()
Toggles the "Play/Pause" button.


getCurrentSimulationStateIndex

public int getCurrentSimulationStateIndex()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
This is the eventhandler for all buttons.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
This method is called if the timeline slider in the GUI changes

Specified by:
stateChanged in interface javax.swing.event.ChangeListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
This method is called wehen there is a MouseEvent at the BotList

Specified by:
mouseReleased in interface java.awt.event.MouseListener