Package jmri.implementation
Class JmriMultiStatePropertyListener
- java.lang.Object
-
- jmri.implementation.JmriSimplePropertyListener
-
- jmri.implementation.JmriMultiStatePropertyListener
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
public class JmriMultiStatePropertyListener extends JmriSimplePropertyListener
A service base class for monitoring a bound property in one of the JMRI Named beans (Turnout, Sensor, etc). For use with properties that may have more than two states where the states are represented by numbers than can be cast to integers.This file is part of JMRI.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- Since:
- 2.5.1
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.ArrayList<java.lang.Integer>
_states
-
Fields inherited from class jmri.implementation.JmriSimplePropertyListener
_clients, _enabled, _namedBean, _propertyName, _type, _varName, _varType
-
-
Constructor Summary
Constructors Constructor Description JmriMultiStatePropertyListener(java.lang.String propName, int type, java.lang.String name, Conditional.Type varType, Conditional client, int state)
JmriMultiStatePropertyListener(java.lang.String propName, int type, NamedBeanHandle<?> namedBean, Conditional.Type varType, Conditional client, int state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
propertyChange(java.beans.PropertyChangeEvent evt)
When _enabled is false, Conditional.calculate will compute the state of the conditional, but will not trigger its actions.void
setState(int state)
-
Methods inherited from class jmri.implementation.JmriSimplePropertyListener
addConditional, calculateClient, getBean, getDevName, getNamedBean, getPropertyName, getType, getVarType, setEnabled
-
-
-
-
Field Detail
-
_states
java.util.ArrayList<java.lang.Integer> _states
-
-
Constructor Detail
-
JmriMultiStatePropertyListener
JmriMultiStatePropertyListener(java.lang.String propName, int type, java.lang.String name, Conditional.Type varType, Conditional client, int state)
-
JmriMultiStatePropertyListener
JmriMultiStatePropertyListener(java.lang.String propName, int type, NamedBeanHandle<?> namedBean, Conditional.Type varType, Conditional client, int state)
-
-
Method Detail
-
setState
public void setState(int state)
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
Description copied from class:JmriSimplePropertyListener
When _enabled is false, Conditional.calculate will compute the state of the conditional, but will not trigger its actions. When _enabled is true, Conditional.calculates its state and trigger its actions if its state has changed.- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Overrides:
propertyChange
in classJmriSimplePropertyListener
-
-