|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectetomica.graphics.Device
etomica.graphics.DeviceSpinner
public class DeviceSpinner
Device the changes a property using a graphical spinner, via a Modifier.
ModifierGeneral| Nested Class Summary | |
|---|---|
protected class |
DeviceSpinner.SpinnerListener
Spinner listener, which relays the spinner change events to the modifier |
| Nested classes/interfaces inherited from class etomica.graphics.Device |
|---|
Device.ActionSet |
| Field Summary | |
|---|---|
protected Object |
component
Object with property being modulated |
protected ModifyAction |
modifyAction
Modifier connecting the spinner to the property |
protected String |
property
Property being modulated |
protected JSpinner |
spinner
Actual JSpinner |
protected SpinnerNumberModel |
spinnerModel
Actual spinner model |
protected IAction |
targetAction
|
| Fields inherited from class etomica.graphics.Device |
|---|
controller, unit |
| Constructor Summary | |
|---|---|
DeviceSpinner(IController controller)
|
|
DeviceSpinner(IController controller,
Modifier m)
Constructs a spinner connected to the get/set Value methods of the given Modifier |
|
DeviceSpinner(IController controller,
Object object,
String property)
Constructs a spinner connected to the given property of the given object |
|
| Method Summary | |
|---|---|
void |
doUpdate()
|
Object |
getComponent()
|
String |
getLabel()
|
double |
getMaximum()
|
double |
getMinimum()
|
Modifier |
getModifier()
|
JPanel |
getPanel()
|
String |
getProperty()
|
SpinnerNumberModel |
getSpinner()
|
double |
getValue()
|
Component |
graphic(Object obj)
Returns the GUI element for display in the simulation. |
boolean |
isShowBorder()
|
void |
setBorderAlignment(int align)
|
void |
setComponent(Object obj)
|
void |
setLabel(String s)
Sets the value of a descriptive label using the given string. |
void |
setMaximum(double max)
Sets maximum value of slider |
void |
setMinimum(double min)
Sets minimum value of spinner |
void |
setModifier(Modifier m)
|
void |
setProperty(String s)
|
void |
setShowBorder(boolean b)
|
void |
setUnit(Unit u)
Override superclass setUnit method to update label when unit is changed |
void |
setValue(double d)
|
| Methods inherited from class etomica.graphics.Device |
|---|
doAction, getController, getDimension, getPostAction, getPreAction, getUnit, graphic, setController, setPostAction, setPreAction |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ModifyAction modifyAction
protected SpinnerNumberModel spinnerModel
protected JSpinner spinner
protected Object component
protected String property
protected IAction targetAction
| Constructor Detail |
|---|
public DeviceSpinner(IController controller)
public DeviceSpinner(IController controller,
Object object,
String property)
public DeviceSpinner(IController controller,
Modifier m)
| Method Detail |
|---|
public void setUnit(Unit u)
setUnit in interface DimensionedsetUnit in class Devicepublic void setBorderAlignment(int align)
public void setModifier(Modifier m)
public final Modifier getModifier()
public void doUpdate()
public String getProperty()
public void setProperty(String s)
public Object getComponent()
public void setComponent(Object obj)
public double getMinimum()
public void setMinimum(double min)
public double getMaximum()
public void setMaximum(double max)
public double getValue()
public void setValue(double d)
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 s)
public String getLabel()
public void setShowBorder(boolean b)
public boolean isShowBorder()
public SpinnerNumberModel getSpinner()
public JPanel getPanel()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||