Class LongAddrVariableValue
- All Implemented Interfaces:
ActionListener,FocusListener,PropertyChangeListener,EventListener
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class jmri.jmrit.symbolicprog.AbstractValue
AbstractValue.ValueState -
Field Summary
FieldsModifier and TypeFieldDescription(package private) Color(package private) int(package private) int(package private) JTextField(package private) CvValue(package private) StringFields inherited from class jmri.jmrit.symbolicprog.VariableValue
_cvMap, _status, _tooltipTextFields inherited from class jmri.jmrit.symbolicprog.AbstractValue
prop -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidActionListener implementationsvoiddispose()Dispose of the object.(package private) void(package private) voidvoidFocusListener implementationsvoidGet a display representationObjectof this variable.Provide a user-readable description of the CVs accessed by this variable.intGet the value as a single integer.Creates a newObjectrepresentation for display purposes, using the specified format.booleanDetermine whether this Variable is "changed", so that "read changes" and "write changes" will act on it.booleanisToRead()Ask whether this object needs to be read.booleanAsk whether this object needs to be written.voidrangeVal()Gets a (usually text) description of the variable type and range.voidreadAll()Always read the contents of this Variable.voidRead the contents of this Variable if it's in a state that indicates it was "changed".(package private) voidMethod to handle color changes for states.voidNotify the connected CVs of a state change from abovevoidsetIntValue(int i) Set the value from a single number.voidSet tooltip text to be used by both the "value" and representations of this Variable.voidsetToRead(boolean state) Mark whether this object needs to be read.voidsetToWrite(boolean state) Mark whether this object needs to be written.voidsetValue(int value) (package private) voidThis should be overridden by any implementation.CvValue[]usesCVs()Provide access to CVs used by this Variable.voidwriteAll()Always write the contents of this Variable.voidWrite the contents of this Variable if it's in a state that indicates it was "changed".Methods inherited from class jmri.jmrit.symbolicprog.VariableValue
confirmAll, considerChanged, cvName, getComment, getCvName, getCvNum, getInfoOnly, getLongValue, getMask, getMaxMask, getOpsOnly, getReadOnly, getState, getTextValue, getValueInCV, getWriteOnly, isBitMask, isBusy, item, label, maskValAsInt, offsetVal, setBusy, setState, setValue, setValueInCV, simplifyMask, updateRepresentationMethods inherited from class jmri.jmrit.symbolicprog.AbstractValue
addPropertyChangeListener, getAvailable, removePropertyChangeListener, setAvailable
-
Field Details
-
Constructor Details
-
LongAddrVariableValue
public LongAddrVariableValue(@Nonnull String name, @Nonnull String comment, @Nonnull String cvName, boolean readOnly, boolean infoOnly, boolean writeOnly, boolean opsOnly, @Nonnull String cvNum, @Nonnull String mask, int minVal, int maxVal, @Nonnull HashMap<String, CvValue> v, @Nonnull JLabel status, @Nonnull String stdname, @Nonnull CvValue mHighCV)
-
-
Method Details
-
usesCVs
Description copied from class:VariableValueProvide access to CVs used by this Variable.- Specified by:
usesCVsin classVariableValue- Returns:
- an array of CVs used by this Variable
-
getCvDescription
Provide a user-readable description of the CVs accessed by this variable.- Overrides:
getCvDescriptionin classVariableValue- Returns:
- a user-readable description
-
setToolTipText
Description copied from class:VariableValueSet tooltip text to be used by both the "value" and representations of this Variable.This is expected to be overridden in subclasses to change their internal info.
- Overrides:
setToolTipTextin classVariableValue- Parameters:
t- the tooltip text to be used- See Also:
-
rangeVal
Description copied from class:VariableValueGets a (usually text) description of the variable type and range.- Specified by:
rangeValin classVariableValue- Returns:
- description of the variable type and range
-
enterField
void enterField() -
exitField
void exitField() -
updatedTextField
void updatedTextField()Description copied from class:VariableValueThis should be overridden by any implementation.- Overrides:
updatedTextFieldin classVariableValue
-
actionPerformed
ActionListener implementations- Specified by:
actionPerformedin interfaceActionListener
-
focusGained
FocusListener implementations- Specified by:
focusGainedin interfaceFocusListener
-
focusLost
- Specified by:
focusLostin interfaceFocusListener
-
getValueString
- Specified by:
getValueStringin classVariableValue- Returns:
- String that can (usually) be interpreted as an integer
-
setIntValue
Description copied from class:VariableValueSet the value from a single number.In some cases, e.g. speed tables, this will result in complex behavior, where setIntValue(getIntValue()) results in something unexpected.
- Specified by:
setIntValuein classVariableValue- Parameters:
i- the integer value to set
-
getIntValue
Description copied from class:VariableValueGet the value as a single integer.In some cases, e.g. speed tables, this will result in complex behavior, where setIntValue(getIntValue()) results in something unexpected.
- Specified by:
getIntValuein classVariableValue- Returns:
- the value as an integer
-
getValueObject
- Specified by:
getValueObjectin classVariableValue- Returns:
- Value as a native-form Object
-
getCommonRep
Description copied from class:VariableValueGet a display representationObjectof this variable.
The actual stored value of a variable is not the most interesting thing. Instead, you usually get anObjectrepresentation for display in a table, etc. Modification of the state of that object then gets reflected back, causing the underlying CV objects to change.- Specified by:
getCommonRepin classVariableValue- Returns:
- the
Objectrepresentation for display purposes
-
setValue
-
setColor
Description copied from class:AbstractValueMethod to handle color changes for states.- Specified by:
setColorin classAbstractValue- Parameters:
c- the desired colour
-
getNewRep
Description copied from class:VariableValueCreates a newObjectrepresentation for display purposes, using the specified format.- Specified by:
getNewRepin classVariableValue- Parameters:
format- a name representing- Returns:
- an
Objectrepresentation for display purposes
-
setCvState
Notify the connected CVs of a state change from above- Specified by:
setCvStatein classVariableValue- Parameters:
state- the new state to set
-
isChanged
Description copied from class:VariableValueDetermine whether this Variable is "changed", so that "read changes" and "write changes" will act on it.- Specified by:
isChangedin classVariableValue- Returns:
- true if Variable is "changed"
- See Also:
-
setToRead
Description copied from class:VariableValueMark whether this object needs to be read.Simple implementation for the case of a single CV. Intended to be sufficient for many subclasses.
- Overrides:
setToReadin classVariableValue- Parameters:
state- true if the object needs to be read, false otherwise- See Also:
-
isToRead
Description copied from class:VariableValueAsk whether this object needs to be read.Simple implementation for the case of a single CV. Intended to be sufficient for many subclasses.
- Overrides:
isToReadin classVariableValue- Returns:
- true if the object needs to be read, false otherwise
- See Also:
-
setToWrite
Description copied from class:VariableValueMark whether this object needs to be written.Simple implementation for the case of a single CV. Intended to be sufficient for many subclasses.
- Overrides:
setToWritein classVariableValue- Parameters:
state- true if the object needs to be written, false otherwise- See Also:
-
isToWrite
Description copied from class:VariableValueAsk whether this object needs to be written.Simple implementation for the case of a single CV. Intended to be sufficient for many subclasses.
- Overrides:
isToWritein classVariableValue- Returns:
- true if the object needs to be written, false otherwise
- See Also:
-
readChanges
Description copied from class:VariableValueRead the contents of this Variable if it's in a state that indicates it was "changed".- Specified by:
readChangesin classVariableValue- See Also:
-
writeChanges
Description copied from class:VariableValueWrite the contents of this Variable if it's in a state that indicates it was "changed".- Specified by:
writeChangesin classVariableValue- See Also:
-
readAll
Description copied from class:VariableValueAlways read the contents of this Variable.- Specified by:
readAllin classVariableValue
-
writeAll
Description copied from class:VariableValueAlways write the contents of this Variable.- Specified by:
writeAllin classVariableValue
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener- Specified by:
propertyChangein classVariableValue
-
dispose
Description copied from class:VariableValueDispose of the object.- Specified by:
disposein classVariableValue
-