etomica.graphics
Class DeviceTrioControllerButton

java.lang.Object
  extended by etomica.graphics.Device
      extended by etomica.graphics.DeviceTrioControllerButton
All Implemented Interfaces:
GraphicalElement, Dimensioned

public class DeviceTrioControllerButton
extends Device

Device comprising three buttons: (1) attaches to a controller to toggle its pause/resume state; (2)causes a reset (restart) action of simulation to be performed; (3) causes reset of meter averages only.


Nested Class Summary
protected  class DeviceTrioControllerButton.ComponentEventControllerButton
          Inner class that catches action of simulation panel
 
Nested classes/interfaces inherited from class etomica.graphics.Device
Device.ActionSet
 
Field Summary
 
Fields inherited from class etomica.graphics.Device
controller, unit
 
Constructor Summary
DeviceTrioControllerButton()
          No-argument contructor gives device that performs no action until setSimulation is used to specify the target simulation.
DeviceTrioControllerButton(ISimulation simulation, ISpace space, Controller _controller)
          Contructs device with buttons that affect the given simulation.
 
Method Summary
 DeviceControllerButton getControllerButton()
           
 ArrayList<DataPump> getDataStreamPumps()
          Returns an ArrayList of DataPumps that are headers for the data streams.
 DeviceButton getReinitButton()
           
 DeviceButton getResetAveragesButton()
           
 String getShape()
           
 SimulationRestart getSimRestart()
           
 ISimulation getSimulation()
          Returns the simulation affected by the buttons.
 Component graphic(Object obj)
          Returns the JPanel that contains the buttons.
static void main(String[] args)
          main method to show how to work with this class
 void reset()
          Sets controller toggle button to read "Start"
 void setShape(String s)
          Sets display shape of the device.
protected  void setSimulation(ISimulation sim, ISpace space, Controller controller)
          Sets the controller that is toggled by this device.
 
Methods inherited from class etomica.graphics.Device
doAction, getController, getDimension, getPostAction, getPreAction, getUnit, graphic, setController, setPostAction, setPreAction, setUnit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceTrioControllerButton

public DeviceTrioControllerButton(ISimulation simulation,
                                  ISpace space,
                                  Controller _controller)
Contructs device with buttons that affect the given simulation.


DeviceTrioControllerButton

public DeviceTrioControllerButton()
No-argument contructor gives device that performs no action until setSimulation is used to specify the target simulation.

Method Detail

setSimulation

protected void setSimulation(ISimulation sim,
                             ISpace space,
                             Controller controller)
Sets the controller that is toggled by this device.


getDataStreamPumps

public ArrayList<DataPump> getDataStreamPumps()
Returns an ArrayList of DataPumps that are headers for the data streams. This streams from this ArrayList are reset when the user presses the reinitialize and reset averages buttons.


getSimulation

public ISimulation getSimulation()
Returns the simulation affected by the buttons.


graphic

public Component graphic(Object obj)
Returns the JPanel that contains the buttons.

Specified by:
graphic in interface GraphicalElement
Specified by:
graphic in class Device
Parameters:
obj - An object that might be used to specify the graphic that the GraphicalElement is to return. In most cases the GraphicalElement ignores this parameter, and it can be set to null.
Returns:
A Component that can be used in the GUI of a graphical simulation
See Also:
Device, Display

getControllerButton

public DeviceControllerButton getControllerButton()

getReinitButton

public DeviceButton getReinitButton()

getResetAveragesButton

public DeviceButton getResetAveragesButton()

reset

public void reset()
Sets controller toggle button to read "Start"


setShape

public void setShape(String s)
Sets display shape of the device. The argument must be a string having one of the following values: Any other value is ignored.


getShape

public String getShape()

getSimRestart

public SimulationRestart getSimRestart()

main

public static void main(String[] args)
main method to show how to work with this class