|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectetomica.graphics.Device
etomica.graphics.DeviceToggleRadioButtons
public class DeviceToggleRadioButtons
Button that toggles a boolean value using a pair of radio buttons. This device can connect to any object capable of switching between two states. The device operates through a ModifierBoolean instance that must be connected to the state of the controlled object.
| 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 | |
|---|---|
DeviceToggleRadioButtons(ModifierBoolean modifier)
Constructor with default labels of a blank title and "True" and "False" for the true/false labels. |
|
DeviceToggleRadioButtons(ModifierBoolean modifier,
String title,
String trueText,
String falseText)
|
|
| Method Summary | |
|---|---|
JRadioButton |
falseButton()
|
static EtomicaInfo |
getEtomicaInfo()
|
String |
getFalseLabel()
|
ModifierBoolean |
getModifier()
Specifies the boolean modifier that is set between true and false by the button. |
boolean |
getState()
Returns the currents true/false state of the button. |
String |
getTitle()
|
String |
getTrueLabel()
|
Component |
graphic(Object obj)
Returns the GUI button element for display in the simulation. |
void |
setFalseLabel(String text)
Specifies the button's label when the toggle is set to false. |
void |
setModifier(ModifierBoolean newModifier)
Returns the boolean modifier set by this button. |
void |
setState(boolean b)
Sets the button to the given state. |
void |
setTitle(String text)
|
void |
setTrueLabel(String text)
Specifies the button's label when the toggle is set to true. |
JRadioButton |
trueButton()
|
| 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 |
|---|
public DeviceToggleRadioButtons(ModifierBoolean modifier)
public DeviceToggleRadioButtons(ModifierBoolean modifier,
String title,
String trueText,
String falseText)
sim - the parent simulation of this devicemodifier - the boolean modifier controlled by this devicetitle - a descriptive string. If empty ("") provides plain border; if null, provides no border.trueText - text associated with "true" state of modifierfalseText - text associated with "false" state of modifier| Method Detail |
|---|
public static EtomicaInfo getEtomicaInfo()
public void setState(boolean b)
public boolean getState()
public ModifierBoolean getModifier()
public void setModifier(ModifierBoolean newModifier)
public Component graphic(Object obj)
graphic in interface GraphicalElementgraphic in class Deviceobj - 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.
Device,
Displaypublic void setTitle(String text)
public String getTitle()
public void setTrueLabel(String text)
public String getTrueLabel()
public void setFalseLabel(String text)
public String getFalseLabel()
public JRadioButton trueButton()
public JRadioButton falseButton()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||