Package jmri.jmrix.bidib
Class BiDiBPowerManager
- java.lang.Object
-
- jmri.jmrix.bidib.BiDiBPowerManager
-
- All Implemented Interfaces:
PropertyChangeProvider
,PowerManager
public class BiDiBPowerManager extends java.lang.Object implements PowerManager
BiDiBPowerManager.java Description: PowerManager implementation for controlling layout power
-
-
Field Summary
Fields Modifier and Type Field Description (package private) org.bidib.jbidibc.core.MessageListener
messageListener
(package private) java.beans.PropertyChangeSupport
pcs
(package private) int
power
(package private) BiDiBTrafficController
tc
(package private) java.lang.String
userName
-
Constructor Summary
Constructors Constructor Description BiDiBPowerManager(BiDiBSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add aPropertyChangeListener
to the listener list.void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Add aPropertyChangeListener
for a specific property.void
dispose()
Remove the Message Listener for this power managerprotected void
firePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
int
getPower()
java.beans.PropertyChangeListener[]
getPropertyChangeListeners()
Get allPropertyChangeListener
s currently attached to this object.java.beans.PropertyChangeListener[]
getPropertyChangeListeners(java.lang.String propertyName)
Get allPropertyChangeListener
s currently listening to changes to the specified property.java.lang.String
getUserName()
void
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove the specified listener from this object.void
removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Remove the specified listener of the specified property from this object.void
setPower(int v)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.PowerManager
implementsIdle
-
-
-
-
Field Detail
-
userName
java.lang.String userName
-
power
int power
-
messageListener
org.bidib.jbidibc.core.MessageListener messageListener
-
pcs
java.beans.PropertyChangeSupport pcs
-
-
Constructor Detail
-
BiDiBPowerManager
public BiDiBPowerManager(BiDiBSystemConnectionMemo memo)
-
-
Method Detail
-
getUserName
public java.lang.String getUserName()
- Specified by:
getUserName
in interfacePowerManager
-
setPower
public void setPower(int v) throws JmriException
- Specified by:
setPower
in interfacePowerManager
- Throws:
JmriException
-
getPower
public int getPower()
- Specified by:
getPower
in interfacePowerManager
-
dispose
public void dispose() throws JmriException
Remove the Message Listener for this power manager- Specified by:
dispose
in interfacePowerManager
- Throws:
JmriException
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add aPropertyChangeListener
to the listener list.- Specified by:
addPropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
l
- The PropertyChangeListener to be added
-
firePropertyChange
protected void firePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove the specified listener from this object.- Specified by:
removePropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
l
- ThePropertyChangeListener
to remove.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Add aPropertyChangeListener
for a specific property.- Specified by:
addPropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be added
-
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Get allPropertyChangeListener
s currently attached to this object.- Specified by:
getPropertyChangeListeners
in interfacePropertyChangeProvider
- Returns:
- An array of PropertyChangeListeners.
-
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
Get allPropertyChangeListener
s currently listening to changes to the specified property.- Specified by:
getPropertyChangeListeners
in interfacePropertyChangeProvider
- Parameters:
propertyName
- the name of the property of interest- Returns:
- an array of PropertyChangeListeners
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Remove the specified listener of the specified property from this object.- Specified by:
removePropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
propertyName
- The name of the property to stop listening to.listener
- ThePropertyChangeListener
to remove.
-
-