DeviceBoxValueChangedListener
, java.util.EventListener
, javax.swing.event.ChangeListener
public class DeviceBox extends Device implements javax.swing.event.ChangeListener, DeviceBoxValueChangedListener
Modifier and Type | Class | Description |
---|---|---|
static class |
DeviceBox.LabelType |
Typed constant used to indicate the type of label to be used with the display.
|
Device.ActionSet
Modifier and Type | Field | Description |
---|---|---|
protected javax.swing.JLabel |
label |
Descriptive text label to be displayed with the value
|
protected java.lang.String |
labelString |
|
protected ModifyAction |
modifyAction |
Modifier connecting the slider to the property
|
protected javax.swing.JPanel |
panel |
Displayed panel that holds the label and value
(not yet used; meant to implement to make lightweight display)
|
protected int |
precision |
Integer specifying the number of significant figures to be displayed.
|
protected javax.swing.JTextField |
textField |
Object for displaying the value as a text field
|
controller, unit
Constructor | Description |
---|---|
DeviceBox() |
|
DeviceBox(Controller controller) |
Modifier and Type | Method | Description |
---|---|---|
void |
addValueChangedListener(DeviceBoxValueChangedListener dbListener) |
Add an object to be notified when the DeviceBox value to changes
|
void |
deviceBoxValueChanged(DeviceBoxValueChangedEvent ev) |
|
void |
doUpdate() |
Updates the display of the box with the current value given by the modifier.
|
java.lang.String |
getLabel() |
|
Constants.CompassDirection |
getLabelPosition() |
|
DeviceBox.LabelType |
getLabelType() |
|
Modifier |
getModifier() |
Accessor method for the modifier that receives the edit.
|
int |
getPrecision() |
Accessor method of the precision, which specifies the number of significant figures to be displayed.
|
java.awt.Color |
getTextBackground() |
|
java.awt.Component |
graphic() |
|
boolean |
isEditable() |
|
boolean |
isInteger() |
|
void |
removeAllValueChangedListeners() |
Removes all objects that are listening for a value changed event.
|
void |
removeValueChangedListener(DeviceBoxValueChangedListener dbListener) |
Remove an object that is listening for the DeviceBox value to change
|
void |
setBorderBackground(java.awt.Color color) |
|
void |
setEditable(boolean b) |
|
void |
setInteger(boolean b) |
Sets a flag indicating if the value should be displayed as an integer.
|
void |
setLabel(java.lang.String s) |
Sets the value of a descriptive label using the given string.
|
void |
setLabelPosition(Constants.CompassDirection position) |
|
void |
setLabelType(DeviceBox.LabelType newLabelType) |
Sets the label type to "border" or "string".
|
void |
setModifier(Modifier m) |
Specifies the modifier that receives the edit.
|
void |
setPrecision(int n) |
Accessor method of the precision, which specifies the number of significant figures to be displayed.
|
void |
setTextBackground(java.awt.Color color) |
|
void |
setUnit(Unit u) |
Accessor method to set the physical units of the displayed value.
|
void |
stateChanged(javax.swing.event.ChangeEvent evt) |
calls doUpdate method.
|
doAction, getController, getDimension, getPostAction, getPreAction, getUnit, setController, setPostAction, setPreAction
protected javax.swing.JLabel label
protected java.lang.String labelString
protected javax.swing.JTextField textField
protected javax.swing.JPanel panel
protected ModifyAction modifyAction
protected int precision
public DeviceBox()
public DeviceBox(Controller controller)
public void stateChanged(javax.swing.event.ChangeEvent evt)
stateChanged
in interface javax.swing.event.ChangeListener
public void doUpdate()
public void setEditable(boolean b)
public boolean isEditable()
public void setUnit(Unit u)
public int getPrecision()
public void setPrecision(int n)
public void setInteger(boolean b)
public boolean isInteger()
public void setModifier(Modifier m)
public Modifier getModifier()
public void setLabel(java.lang.String s)
public java.lang.String getLabel()
public void setLabelType(DeviceBox.LabelType newLabelType)
public DeviceBox.LabelType getLabelType()
public void setLabelPosition(Constants.CompassDirection position)
public void setTextBackground(java.awt.Color color)
public java.awt.Color getTextBackground()
public void setBorderBackground(java.awt.Color color)
public Constants.CompassDirection getLabelPosition()
public void addValueChangedListener(DeviceBoxValueChangedListener dbListener)
public void removeValueChangedListener(DeviceBoxValueChangedListener dbListener)
public void removeAllValueChangedListeners()
public void deviceBoxValueChanged(DeviceBoxValueChangedEvent ev)
deviceBoxValueChanged
in interface DeviceBoxValueChangedListener