etomica.graphics
Class DeviceThermoSlider

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

public class DeviceThermoSlider
extends Device


Nested Class Summary
 
Nested classes/interfaces inherited from class etomica.graphics.Device
Device.ActionSet
 
Field Summary
protected  IntegratorBox integrator
           
 
Fields inherited from class etomica.graphics.Device
controller, unit
 
Constructor Summary
DeviceThermoSlider(IController cont)
           
 
Method Summary
 void addRadioGroupActionListener(ActionListener listener)
          Add the specified listener to the list of listeners that will get invoked when the isothermal or adiabatic radio button is pushed.
 void addTemperatureSliderListener(ChangeListener listener)
          Add the specified listener to the list of listeners that will get invoked when the temperature slider value changes.
 boolean getIsothermalButtonsVisibility()
           
 Modifier getModifier()
           
 double getTemperature()
           
 Component graphic(Object obj)
          Interface for a Simulation element that would be used in a simulation graphical user interface (GUI)
 boolean isAdiabatic()
           
 boolean isIsothermal()
           
static void main(String[] args)
           
 void setAdiabatic()
          Set the Adiabatic button to its selected state.
 void setController(IController cont)
          Set the temperature slider controller.
 void setEditValues(boolean b)
          Set whether the temperature text box should be editable.
 void setIntegrator(IntegratorBox i)
          Sets the integrator for the device.
 void setIsothermal()
          Set the Isothermal button to its selected state.
 void setIsothermalButtonsVisibility(boolean doShowIsothermalButtons)
           
 void setMaximum(double max)
          Set the maximum value for the temperature.
 void setMinimum(double min)
          Set the minimum value for the temperature.
 void setModifier(Modifier mod)
          Set the temperature modifier object.
 void setPrecision(int prec)
          Set the precision of the scrollbar.
 void setShowValues(boolean b)
          Set whether the temperature text box should be displayed.
 void setSliderMajorValues(int major)
          Set the number of "major" values that should be shown on the temperature slider.
 void setSliderPostAction(IAction action)
          Set the post slider value changed action.
 void setTemperature(double value)
          Set the current value for the temperature slider/text box.
 void setUnit(Unit u)
          Set the unit of temperature.
 
Methods inherited from class etomica.graphics.Device
doAction, getController, getDimension, getPostAction, getPreAction, getUnit, graphic, setPostAction, setPreAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

integrator

protected IntegratorBox integrator
Constructor Detail

DeviceThermoSlider

public DeviceThermoSlider(IController cont)
Method Detail

setIsothermalButtonsVisibility

public void setIsothermalButtonsVisibility(boolean doShowIsothermalButtons)

getIsothermalButtonsVisibility

public boolean getIsothermalButtonsVisibility()

setIsothermal

public void setIsothermal()
Set the Isothermal button to its selected state.


isIsothermal

public boolean isIsothermal()
Returns:
State of the isothermal button

setAdiabatic

public void setAdiabatic()
Set the Adiabatic button to its selected state.


isAdiabatic

public boolean isAdiabatic()
Returns:
State of the adiabatic button

addTemperatureSliderListener

public void addTemperatureSliderListener(ChangeListener listener)
Add the specified listener to the list of listeners that will get invoked when the temperature slider value changes.

Parameters:
listener -

addRadioGroupActionListener

public void addRadioGroupActionListener(ActionListener listener)
Add the specified listener to the list of listeners that will get invoked when the isothermal or adiabatic radio button is pushed.

Parameters:
listener -

setTemperature

public void setTemperature(double value)
Set the current value for the temperature slider/text box.


getTemperature

public double getTemperature()
Returns:
Current value of the temperature slider/text box.

setShowValues

public void setShowValues(boolean b)
Set whether the temperature text box should be displayed.


setEditValues

public void setEditValues(boolean b)
Set whether the temperature text box should be editable.


setMinimum

public void setMinimum(double min)
Set the minimum value for the temperature.


setMaximum

public void setMaximum(double max)
Set the maximum value for the temperature.


setSliderMajorValues

public void setSliderMajorValues(int major)
Set the number of "major" values that should be shown on the temperature slider.


graphic

public Component graphic(Object obj)
Description copied from interface: GraphicalElement
Interface for a Simulation element that would be used in a simulation graphical user interface (GUI)

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:
The panel that holds all graphical objects for the DeviceThermoSlider.
See Also:
Device, Display

setUnit

public void setUnit(Unit u)
Set the unit of temperature.

Specified by:
setUnit in interface Dimensioned
Overrides:
setUnit in class Device

setPrecision

public void setPrecision(int prec)
Set the precision of the scrollbar.

Parameters:
prec - Number of significant digits after the "dot".

setModifier

public void setModifier(Modifier mod)
Set the temperature modifier object.


getModifier

public Modifier getModifier()
Returns:
Temperature value modifier.

setController

public void setController(IController cont)
Set the temperature slider controller.

Overrides:
setController in class Device
Parameters:
cont - The controller to set.

setSliderPostAction

public void setSliderPostAction(IAction action)
Set the post slider value changed action.


setIntegrator

public void setIntegrator(IntegratorBox i)
Sets the integrator for the device. Adds actions to the device's controller to inform the integrator when the temperature and isothermal/adiabatic selection has changed based upon the type of integrator passed in.

Parameters:
i - Integrator

main

public static void main(String[] args)