|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectetomica.graphics.Device
etomica.graphics.DeviceSlider
public class DeviceSlider
Device the changes a property using a graphical slider, via a Modifier.
ModifierGeneral| Nested Class Summary |
|---|
| 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 slider to the property |
protected String |
property
Property being modulated |
protected DecimalSlider |
slider
Subclass of Swing slider displayed to screen located in utility package |
protected boolean |
suppressAction
|
protected IAction |
targetAction
|
protected JTextField |
textField
To show the values of slider |
| Fields inherited from class etomica.graphics.Device |
|---|
controller, unit |
| Constructor Summary | |
|---|---|
DeviceSlider(IController controller)
|
|
DeviceSlider(IController controller,
Modifier m)
Constructs a slider connected to the get/set Value methods of the given Modifier |
|
DeviceSlider(IController controller,
Object object,
String property)
Constructs a slider connected to the given property of the given object |
|
| Method Summary | |
|---|---|
void |
doAction(IAction action)
Method called by subclasses to execute the action of the device. |
void |
doUpdate()
|
Object |
getComponent()
|
boolean |
getEditValues()
|
String |
getLabel()
|
double |
getMaximum()
|
double |
getMinimum()
|
Modifier |
getModifier()
|
int |
getNMajor()
|
JPanel |
getPanel()
|
int |
getPrecision()
|
String |
getProperty()
|
boolean |
getShowSlider()
|
boolean |
getShowValues()
|
DecimalSlider |
getSlider()
|
JTextField |
getTextField()
|
double |
getValue()
|
Component |
graphic(Object obj)
Returns the GUI element for display in the simulation. |
boolean |
isEnabled()
|
boolean |
isShowBorder()
|
void |
setBorderAlignment(int align)
|
void |
setComponent(Object obj)
|
void |
setEditValues(boolean b)
|
void |
setEnabled(boolean isEnabled)
Sets the deivce's slider and textfield to be enabled or not. |
void |
setLabel(String s)
Sets the value of a descriptive label using the given string. |
void |
setMaximum(double max)
Sets maximum value of slider; should be called after any calls to setPrecision. |
void |
setMinimum(double min)
Sets minimum value of slider; should be called after any calls to setPrecision. |
void |
setModifier(Modifier m)
|
void |
setNMajor(int n)
|
void |
setPrecision(int n)
|
void |
setProperty(String s)
|
void |
setShowBorder(boolean b)
|
void |
setShowMinorTicks(boolean b)
|
void |
setShowSlider(boolean b)
|
void |
setShowValues(boolean b)
|
void |
setSliderValueShape(String s)
|
void |
setSliderVerticalOrientation(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 |
|---|
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 DecimalSlider slider
protected Object component
protected String property
protected JTextField textField
protected IAction targetAction
protected boolean suppressAction
| Constructor Detail |
|---|
public DeviceSlider(IController controller)
public DeviceSlider(IController controller,
Object object,
String property)
public DeviceSlider(IController controller,
Modifier m)
| Method Detail |
|---|
public void setEnabled(boolean isEnabled)
public boolean isEnabled()
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 void doAction(IAction action)
Device
doAction in class Devicepublic 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 void setShowMinorTicks(boolean b)
public void setNMajor(int n)
public int getNMajor()
public boolean getShowSlider()
public void setShowSlider(boolean b)
public boolean getShowValues()
public void setShowValues(boolean b)
public void setSliderValueShape(String s)
public void setSliderVerticalOrientation(boolean b)
public boolean getEditValues()
public void setEditValues(boolean b)
public int getPrecision()
public void setPrecision(int n)
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 DecimalSlider getSlider()
public JTextField getTextField()
public JPanel getPanel()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||