DeviceNSelector
public class DeviceSlider extends Device
ModifierGeneral
Device.ActionSet
Modifier and Type | Field | Description |
---|---|---|
protected java.lang.Object |
component |
Object with property being modulated
|
protected ModifyAction |
modifyAction |
Modifier connecting the slider to the property
|
protected java.lang.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 javax.swing.JTextField |
textField |
To show the values of slider
|
controller, unit
Constructor | Description |
---|---|
DeviceSlider(Controller controller) |
|
DeviceSlider(Controller controller,
int precision) |
|
DeviceSlider(Controller controller,
Modifier m) |
Constructs a slider connected to the get/set Value methods of the given Modifier
|
DeviceSlider(Controller controller,
Modifier m,
int precision) |
|
DeviceSlider(Controller controller,
java.lang.Object object,
java.lang.String property) |
Constructs a slider connected to the given property of the given object
|
DeviceSlider(Controller controller,
java.lang.Object object,
java.lang.String property,
int precision) |
Modifier and Type | Method | Description |
---|---|---|
java.util.concurrent.CompletableFuture<java.lang.Void> |
doAction(IAction action) |
Method called by subclasses to execute the action of the device.
|
void |
doUpdate() |
|
java.lang.Object |
getComponent() |
|
boolean |
getEditValues() |
|
java.lang.String |
getLabel() |
|
double |
getMaximum() |
|
double |
getMinimum() |
|
Modifier |
getModifier() |
|
int |
getNMajor() |
|
int |
getNMinor() |
|
javax.swing.JPanel |
getPanel() |
|
int |
getPrecision() |
|
java.lang.String |
getProperty() |
|
boolean |
getShowSlider() |
|
boolean |
getShowValues() |
|
DecimalSlider |
getSlider() |
|
javax.swing.JTextField |
getTextField() |
|
double |
getValue() |
|
java.awt.Component |
graphic() |
Returns the GUI element for display in the simulation.
|
boolean |
isEnabled() |
|
boolean |
isShowBorder() |
|
void |
setBorderAlignment(int align) |
|
void |
setComponent(java.lang.Object obj) |
|
void |
setEditValues(boolean b) |
|
void |
setEnabled(boolean isEnabled) |
Sets the deivce's slider and textfield to be enabled or not.
|
void |
setLabel(java.lang.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 |
setNMinor(int n) |
|
void |
setPrecision(int n) |
|
void |
setProperty(java.lang.String s) |
|
void |
setShowBorder(boolean b) |
|
void |
setShowSlider(boolean b) |
|
void |
setShowValues(boolean b) |
|
void |
setSliderValueShape(java.lang.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) |
getController, getDimension, getPostAction, getPreAction, getUnit, setController, setPostAction, setPreAction
protected ModifyAction modifyAction
protected DecimalSlider slider
protected java.lang.Object component
protected java.lang.String property
protected javax.swing.JTextField textField
protected IAction targetAction
protected boolean suppressAction
public DeviceSlider(Controller controller)
public DeviceSlider(Controller controller, int precision)
public DeviceSlider(Controller controller, java.lang.Object object, java.lang.String property)
public DeviceSlider(Controller controller, java.lang.Object object, java.lang.String property, int precision)
public DeviceSlider(Controller controller, Modifier m)
public DeviceSlider(Controller controller, Modifier m, int precision)
public void setEnabled(boolean isEnabled)
public boolean isEnabled()
public void setUnit(Unit u)
public void setBorderAlignment(int align)
public void setModifier(Modifier m)
public final Modifier getModifier()
public void doUpdate()
public java.util.concurrent.CompletableFuture<java.lang.Void> doAction(IAction action)
Device
public java.lang.String getProperty()
public void setProperty(java.lang.String s)
public java.lang.Object getComponent()
public void setComponent(java.lang.Object obj)
public double getMinimum()
public void setMinimum(double min)
public double getMaximum()
public void setMaximum(double max)
public void setNMajor(int n)
public int getNMajor()
public void setNMinor(int n)
public int getNMinor()
public boolean getShowSlider()
public void setShowSlider(boolean b)
public boolean getShowValues()
public void setShowValues(boolean b)
public void setSliderValueShape(java.lang.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 java.awt.Component graphic()
public void setLabel(java.lang.String s)
public java.lang.String getLabel()
public void setShowBorder(boolean b)
public boolean isShowBorder()
public DecimalSlider getSlider()
public javax.swing.JTextField getTextField()
public javax.swing.JPanel getPanel()