Package jmri.jmrix.openlcb
Class OlcbLight
java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.implementation.AbstractLight
jmri.jmrix.openlcb.OlcbLight
- All Implemented Interfaces:
Comparable<NamedBean>,PropertyChangeProvider,DigitalIO,Light,NamedBean
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsModifier and TypeFieldDescription(package private) OlcbAddress(package private) OlcbAddress(package private) static final boolean(package private) static final boolean(package private) VersionedValueListener<Boolean>(package private) BitProducerConsumerFields inherited from class jmri.implementation.AbstractLight
lightControlList, mActive, mCurrentIntensity, mEnabled, mMaxIntensity, mMinIntensity, mStateFields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, registerFields inherited from interface jmri.Light
FAST_CLOCK_CONTROL, INTERMEDIATE, NO_CONTROL, PROPERTY_TARGET_INTENSITY, SENSOR_CONTROL, TIMED_ON_CONTROL, TRANSITIONING, TRANSITIONINGHIGHER, TRANSITIONINGLOWER, TRANSITIONINGTOFULLOFF, TRANSITIONINGTOFULLON, TURNOUT_STATUS_CONTROL, TWO_SENSOR_CONTROLFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidActivate a light activating all its LightControl objects.voiddispose()Deactivate this object, so that it releases as many resources as possible and no longer effects others.protected voiddoNewState(int oldState, int newState) Set the current state of this Light This routine requests the hardware to change to newState.(package private) voidHelper function that will be invoked after construction once the properties have been loaded.Get a recommended text for a tooltip when displaying the NamedBean, e.g. in a list or table.voidsetProperty(String key, Object value) Attach a key/value pair to the NamedBean, which can be retrieved later.voidsetState(int newState) Handle a request for a state change.Methods inherited from class jmri.implementation.AbstractLight
addLightControl, clearLightControls, deactivateLight, describeState, getBeanType, getEnabled, getLightControlList, getState, getUsageReport, notifyStateChange, notifyTargetIntensityChange, setEnabledMethods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChangeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.Light
getCommandedState, getKnownState, isConsistentState, requestUpdateFromLayout, setCommandedStateMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, removeProperty, setComment, setUserName, toString, updateListenerRef, vetoableChangeMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
DEFAULT_IS_AUTHORITATIVE
- See Also:
-
DEFAULT_LISTEN
- See Also:
-
addrOn
-
addrOff
-
lightListener
-
pc
-
-
Constructor Details
-
OlcbLight
-
-
Method Details
-
finishLoad
void finishLoad()Helper function that will be invoked after construction once the properties have been loaded. Used specifically for preventing double initialization when loading lights from XML. -
getRecommendedToolTip
Description copied from interface:NamedBeanGet a recommended text for a tooltip when displaying the NamedBean, e.g. in a list or table. By default, this is the comment from the NamedBean, on the theory that the system name and/or user name are being displayed directly. Specific system implementations may override that.- Returns:
- empty String if no recommendation.
-
activateLight
Activate a light activating all its LightControl objects.- Specified by:
activateLightin interfaceLight- Overrides:
activateLightin classAbstractLight
-
setState
Handle a request for a state change. For these lights, ON and OFF just transition immediately between MinIntensity and MaxIntensity. Ignores any outputDelay setting for connection. -
doNewState
Set the current state of this Light This routine requests the hardware to change to newState.- Overrides:
doNewStatein classAbstractLight- Parameters:
oldState- old statenewState- new state
-
setProperty
Attach a key/value pair to the NamedBean, which can be retrieved later. These are not bound properties as yet, and don't throw events on modification. Key must not be null.The key is constrained to String to make these behave like normal Java Beans.
- Specified by:
setPropertyin interfaceNamedBean- Overrides:
setPropertyin classAbstractNamedBean- Parameters:
key- the property to setvalue- the value of the property
-
dispose
Deactivate this object, so that it releases as many resources as possible and no longer effects others.For example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.
It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.
Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this NamedBean contained.
- Specified by:
disposein interfaceNamedBean- Overrides:
disposein classAbstractNamedBean
-