public class GUI
extends java.lang.Object
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.awt.event.MouseListener
Modifier and Type | Class and Description |
---|---|
class |
GUI.SimulateButton
The button starts the
Simulation in the selected SimulationMode . |
class |
GUI.SimulationModeChangedListener
Listener for a change of simulation mode.
|
Modifier and Type | Field and Description |
---|---|
javax.media.opengl.GLCanvas |
arena |
PlayButton |
buttonPlayPause |
GUI.SimulateButton |
buttonSimulate |
javax.swing.JComboBox<SimulationMode.SimulationModeDisplay> |
comboSimulationMode |
static GUI |
gui |
javax.swing.JSlider |
timelineSlider |
Constructor and Description |
---|
GUI(SimulationMode.SimulationModeDisplay simulationModeDisplay) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
This is the eventhandler for all buttons.
|
void |
changeSimulationMode(SimulationMode simulationMode)
call if you want to reset the
SimulationMode . |
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 when 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
|
public javax.media.opengl.GLCanvas arena
public PlayButton buttonPlayPause
public GUI.SimulateButton buttonSimulate
public javax.swing.JComboBox<SimulationMode.SimulationModeDisplay> comboSimulationMode
public static GUI gui
public javax.swing.JSlider timelineSlider
public GUI(SimulationMode.SimulationModeDisplay simulationModeDisplay)
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void changeSimulationMode(SimulationMode simulationMode)
SimulationMode
.
Synchronizes SimulationRun.simulationRun
.
simulationMode
- public void clickPlayPauseButton()
public int getCurrentSimulationStateIndex()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void setCurrentSimulationStateIndex(int index)
SimulationState
should be
displayed (until further notice).index
- into the SimulationRun
list of statespublic void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener