public class DeviceSpinner extends Device
ModifierGeneral
Modifier and Type | Class | Description |
---|---|---|
protected class |
DeviceSpinner.SpinnerListener |
Spinner listener, which relays the spinner change events to the modifier
|
Device.ActionSet
Modifier and Type | Field | Description |
---|---|---|
protected java.lang.Object |
component |
Object with property being modulated
|
protected ModifyAction |
modifyAction |
Modifier connecting the spinner to the property
|
protected java.lang.String |
property |
Property being modulated
|
protected javax.swing.JSpinner |
spinner |
Actual JSpinner
|
protected javax.swing.SpinnerNumberModel |
spinnerModel |
Actual spinner model
|
protected IAction |
targetAction |
controller, unit
Constructor | Description |
---|---|
DeviceSpinner(Controller controller) |
|
DeviceSpinner(Controller controller,
Modifier m) |
Constructs a spinner connected to the get/set Value methods of the given Modifier
|
DeviceSpinner(Controller controller,
java.lang.Object object,
java.lang.String property) |
Constructs a spinner connected to the given property of the given object
|
Modifier and Type | Method | Description |
---|---|---|
void |
doUpdate() |
|
java.lang.Object |
getComponent() |
|
java.lang.String |
getLabel() |
|
double |
getMaximum() |
|
double |
getMinimum() |
|
Modifier |
getModifier() |
|
javax.swing.JPanel |
getPanel() |
|
java.lang.String |
getProperty() |
|
javax.swing.SpinnerNumberModel |
getSpinner() |
|
double |
getValue() |
|
java.awt.Component |
graphic() |
Returns the GUI element for display in the simulation.
|
boolean |
isShowBorder() |
|
void |
setBorderAlignment(int align) |
|
void |
setComponent(java.lang.Object obj) |
|
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
|
void |
setMinimum(double min) |
Sets minimum value of spinner
|
void |
setModifier(Modifier m) |
|
void |
setProperty(java.lang.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) |
doAction, getController, getDimension, getPostAction, getPreAction, getUnit, setController, setPostAction, setPreAction
protected ModifyAction modifyAction
protected javax.swing.SpinnerNumberModel spinnerModel
protected javax.swing.JSpinner spinner
protected java.lang.Object component
protected java.lang.String property
protected IAction targetAction
public DeviceSpinner(Controller controller)
public DeviceSpinner(Controller controller, java.lang.Object object, java.lang.String property)
public DeviceSpinner(Controller controller, Modifier m)
public void setUnit(Unit u)
public void setBorderAlignment(int align)
public void setModifier(Modifier m)
public final Modifier getModifier()
public void doUpdate()
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 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 javax.swing.SpinnerNumberModel getSpinner()
public javax.swing.JPanel getPanel()