etomica.graphics
Class DeviceThermoSelector

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

public class DeviceThermoSelector
extends Device

Permits selection of temperature from a discrete set of values. Also has option to select adiabatic. Enforces selection by manipulating properties of integrator. By default, last integrator added to simulation is the only one controlled by this device.


Nested Class Summary
 
Nested classes/interfaces inherited from class etomica.graphics.Device
Device.ActionSet
 
Field Summary
 
Fields inherited from class etomica.graphics.Device
controller, unit
 
Constructor Summary
DeviceThermoSelector(IController controller, Unit tempUnit, boolean fixOverlap)
           
DeviceThermoSelector(Simulation sim, IntegratorBox integrator)
          Constructor that specifies Kelvin as temperature units.
 
Method Summary
static EtomicaInfo getEtomicaInfo()
           
 JLabel getLabel()
           
 JComboBox getSelector()
           
 Component graphic(Object obj)
          Returns the GUI element for display in the simulation.
 boolean isIncludeAdiabatic()
           
static void main(String[] args)
           
 void setIncludeAdiabatic(boolean b)
           
 void setIntegrator(IntegratorBox integrator)
           
 void setSelected(int i)
          Sets the i-th item (counting from 0) in the list as the one currently selected.
 void setTemperatures(double[] t)
           
 void setUnit(PrefixedUnit u)
          Override superclass setUnit method to update label when unit is changed
 void updateIntegrator()
          set the integrator's temperature to the selected value
 
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

DeviceThermoSelector

public DeviceThermoSelector(Simulation sim,
                            IntegratorBox integrator)
Constructor that specifies Kelvin as temperature units.


DeviceThermoSelector

public DeviceThermoSelector(IController controller,
                            Unit tempUnit,
                            boolean fixOverlap)
Method Detail

updateIntegrator

public void updateIntegrator()
set the integrator's temperature to the selected value


setIntegrator

public void setIntegrator(IntegratorBox integrator)

getEtomicaInfo

public static EtomicaInfo getEtomicaInfo()

getSelector

public JComboBox getSelector()

getLabel

public JLabel getLabel()

setIncludeAdiabatic

public final void setIncludeAdiabatic(boolean b)

isIncludeAdiabatic

public boolean isIncludeAdiabatic()

setSelected

public void setSelected(int i)
Sets the i-th item (counting from 0) in the list as the one currently selected. Argument outside bounds is interpreted as first or last item on list.


setTemperatures

public void setTemperatures(double[] t)

setUnit

public void setUnit(PrefixedUnit u)
Override superclass setUnit method to update label when unit is changed


graphic

public Component graphic(Object obj)
Returns the GUI element for display in the simulation. Consists of a combo box used for the selector.

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

main

public static void main(String[] args)