|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectetomica.graphics.Device
etomica.graphics.DeviceButton
public class DeviceButton
Button that causes an action to be performed.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class etomica.graphics.Device |
|---|
Device.ActionSet |
| Field Summary | |
|---|---|
protected JButton |
button
|
protected IAction |
targetAction
|
| Fields inherited from class etomica.graphics.Device |
|---|
controller, unit |
| Constructor Summary | |
|---|---|
DeviceButton(IController controller)
Constructs button that is not connected to any action. |
|
DeviceButton(IController controller,
IAction action)
Constructs a button connected to the given action. |
|
| Method Summary | |
|---|---|
IAction |
getAction()
Returns the currently defined action associated with the button. |
JButton |
getButton()
|
static EtomicaInfo |
getEtomicaInfo()
|
String |
getLabel()
|
Component |
graphic(Object obj)
Returns the GUI element for display in the simulation. |
static void |
main(String[] args)
Method to demonstrate and test the use of this class. |
void |
press()
Performs the button's action. |
void |
setAction(IAction newAction)
Defines the action to be performed when the button is pressed. |
void |
setLabel(String text)
Sets the value of a descriptive label using the given string. |
| 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 |
| Field Detail |
|---|
protected JButton button
protected IAction targetAction
| Constructor Detail |
|---|
public DeviceButton(IController controller)
controller -
public DeviceButton(IController controller,
IAction action)
| Method Detail |
|---|
public JButton getButton()
public static EtomicaInfo getEtomicaInfo()
public void press()
public IAction getAction()
public void setAction(IAction newAction)
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 setLabel(String text)
public String getLabel()
public static void main(String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||