Class ActiveTrain
- java.lang.Object
-
- jmri.jmrit.dispatcher.ActiveTrain
-
- All Implemented Interfaces:
PropertyChangeProvider
public class ActiveTrain extends java.lang.Object implements PropertyChangeProvider
This class holds information and options for an ActiveTrain, that is a train that has been linked to a Transit and activated for transit around the layout.An ActiveTrain may be assigned one of the following modes, which specify how the active train will be run through its transit: AUTOMATIC - indicates the ActiveTrain will be run under automatic control of the computer. (Automatic Running) MANUAL - indicates an ActiveTrain running in AUTOMATIC mode has reached a Special Action in its Transit that requires MANUAL operation. When this happens, the status changes to WORKING, and the mode changes to MANUAL. The ActiveTrain will be run by an operator using a throttle. AUTOMATIC running is resumed when the work has been completed. DISPATCHED - indicates the ActiveTrain will be run by an operator using a throttle. A dispatcher will allocate Sections to the ActiveTrain as needed, control optional signals using a CTC panel or computer logic, and arbitrate any conflicts between ActiveTrains. (Human Dispatcher).
An ActiveTrain will have one of the following statuses:
- RUNNING
- Actively running on the layout, according to its mode of operation.
- PAUSED
- Paused waiting for a user-specified number of fast clock minutes. The Active Train is expected to move to either RUNNING or WAITING once the specified number of minutes has elapsed. This is intended for automatic station stops. (automatic trains only)
- WAITING
- Stopped waiting for a Section allocation. This is the state the Active Train is in when it is created in Dispatcher.
- WORKING
- Performing work under control of a human engineer. This is the state an Active Train assumes when an engineer is picking up or setting out cars at industries. (automatic trains only)
- READY
- Train has completed WORKING, and is awaiting a restart - dispatcher clearance to resume running. (automatic trains only)
- STOPPED
- Train was stopped by the dispatcher. Dispatcher must resume. (automatic trains only)
- DONE
- Train has completed its transit of the layout and is ready to be terminated by the dispatcher, or Restart pressed to repeat the automated run.
The ActiveTrain status should maintained (setStatus) by the running class, or if running in DISPATCHED mode, by Dispatcher. When an ActiveTrain is WAITING, and the dispatcher allocates a section to it, the status of the ActiveTrain is automatically set to RUNNING. So an autoRun class can listen to the status of the ActiveTrain to trigger start up if the train has been waiting for the dispatcher. Note: There is still more to be programmed here.
Train information supplied when the ActiveTrain is created can come from any of the following:
- ROSTER
- The train was selected from the JMRI roster menu
- OPERATIONS
- The train was selected from trains available from JMRI operations
- USER
- Neither menu was used--the user entered a name and DCC address.
ActiveTrains are referenced via a list in DispatcherFrame, which serves as a manager for ActiveTrain objects.
ActiveTrains are transient, and are not saved to disk. Active Train information can be saved to disk, making set up with the same options, etc very easy.
An ActiveTrain runs through its Transit in the FORWARD direction, until a Transit Action reverses the direction of travel in the Transit. When running with its Transit reversed, the Active Train returns to its starting Section. Upon reaching and stopping in its starting Section, the Transit is automatically set back to the forward direction. If AutoRestart is set, the run is repeated. The direction of travel in the Transit is maintained here.
This file is part of JMRI.
JMRI is open source 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ActiveTrain.TrainDetection
How much of the train can be detected
-
Field Summary
Fields Modifier and Type Field Description static int
ALLOCATE_AS_FAR_AS_IT_CAN
The value ofgetAllocateMethod()
if allocating as many sections as are clear.static int
ALLOCATE_BY_SAFE_SECTIONS
The value ofgetAllocateMethod()
if allocating up until the next safe sectionstatic int
AUTOMATIC
Constants representing the mode of running of the Active Train The mode is set when the Active Train is created.static int
DISPATCHED
static int
DONE
static int
EXPRESS_FREIGHT
static int
EXPRESS_PASSENGER
static int
LOCAL_FREIGHT
static int
LOCAL_PASSENGER
static int
MANUAL
static int
MOW
(package private) int
mReverseRestartDelay
static int
NODELAY
static int
NONE
Constants representing Type of ActiveTrains.static int
OPERATIONS
static int
PAUSED
static int
READY
(package private) int
restartHr
(package private) int
restartMin
(package private) boolean
restartPoint
static int
ROSTER
Constants representing the source of the train informationstatic int
RUNNING
Constants representing the Status of this ActiveTrain When created, the Status of an Active Train is always WAITING,static int
SENSORDELAY
static int
STOPPED
static int
TERMINATED
static int
THROUGH_FREIGHT
static int
THROUGH_PASSENGER
static int
TIMEDDELAY
static int
USER
static int
WAITING
static int
WORKING
-
Constructor Summary
Constructors Constructor Description ActiveTrain(Transit t, java.lang.String name, int trainSource)
Create an ActiveTrain.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllocatedSection(AllocatedSection as)
protected boolean
addEndSection(Section s, int seq)
void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add aPropertyChangeListener
to the listener list.void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Add aPropertyChangeListener
for a specific property.void
allocateAFresh()
This resets the state of the ActiveTrain so that it can be reallocated.void
clearAllocations()
void
dispose()
protected void
firePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
void
forcePassNextSafeSection()
java.lang.String
getActiveTrainName()
java.util.List<AllocatedSection>
getAllocatedSectionList()
int
getAllocateMethod()
Returns the AllocateM Method to be used by autoAllocateint
getAllocationDirectionFromSectionAndSeq(Section s, int seqNo)
AutoActiveTrain
getAutoActiveTrain()
boolean
getAutoRun()
java.util.List<Block>
getBlockList()
Returns list of all Blocks occupied by or allocated to this train.java.lang.String
getDccAddress()
int
getDelayedRestart()
int
getDelayedStart()
int
getDelayReverseRestart()
Sensor
getDelaySensor()
java.lang.String
getDelaySensorName()
int
getDepartureTimeHr()
int
getDepartureTimeMin()
Block
getEndBlock()
Section
getEndBlockSection()
int
getEndBlockSectionSequenceNumber()
Section
getLastAllocatedSection()
java.lang.String
getLastAllocatedSectionName()
int
getLastAllocatedSectionSeqNumber()
Section
getLastAllocOverrideSafe()
int
getMode()
java.lang.String
getModeText()
int
getNextSectionSeqNumber()
Section
getNextSectionToAllocate()
java.lang.String
getNextSectionToAllocateName()
java.lang.String
getNextTrain()
int
getPriority()
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.boolean
getResetRestartSensor()
boolean
getResetReverseRestartSensor()
boolean
getResetStartSensor()
boolean
getResetWhenDone()
int
getRestartDelay()
int
getRestartDepartHr()
int
getRestartDepartMin()
Sensor
getRestartSensor()
java.lang.String
getRestartSensorName()
boolean
getReverseAtEnd()
int
getReverseRestartDelay()
Sensor
getReverseRestartSensor()
java.lang.String
getReverseRestartSensorName()
RosterEntry
getRosterEntry()
int
getRunningDirectionFromSectionAndSeq(Section s, int seqNo)
protected Section
getSecondAllocatedSection()
Block
getStartBlock()
int
getStartBlockSectionSequenceNumber()
boolean
getStarted()
int
getStatus()
java.lang.String
getStatusText()
ActiveTrain.TrainDetection
getTrainDetection()
Gets the train detection typejava.lang.String
getTrainName()
int
getTrainSource()
int
getTrainType()
java.lang.String
getTrainTypeText()
Transit
getTransit()
java.lang.String
getTransitName()
protected boolean
holdAllocation()
protected void
holdAllocation(boolean boo)
void
initializeDelaySensor()
AllocationRequest
initializeFirstAllocation()
void
initializeRestartAllocationSensor(NamedBeanHandle<Sensor> restartAllocationSensor)
void
initializeRestartSensor(Sensor restartSensor, boolean resetSensor)
boolean
isAllocationReversed()
protected boolean
isInAllocatedList(AllocatedSection as)
protected boolean
isInAllocatedList(Section s)
boolean
isTransitReversed()
protected boolean
reachedRestartPoint()
void
removeAllocatedSection(AllocatedSection as)
protected void
removeLastAllocatedSection()
void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
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.protected void
resetAllAllocatedSections()
protected void
restart()
protected AllocatedSection
reverseAllAllocatedSections()
void
setAllocateMethod(int i)
Sets the Allocation Method to be used bu autoAllocatevoid
setAllocationReversed(boolean set)
void
setAutoActiveTrain(AutoActiveTrain aat)
void
setAutoRun(boolean autoRun)
void
setControlingSignal(java.lang.Object oldSignal, java.lang.Object newSignal)
void
setDccAddress(java.lang.String dccAddress)
void
setDelayedRestart(int delay)
void
setDelayedStart(int delay)
void
setDelaySensor(Sensor s)
void
setDepartureTimeHr(int hr)
void
setDepartureTimeMin(int min)
void
setEndBlock(Block eBlock)
void
setEndBlockSection(Section eSection)
void
setEndBlockSectionSequenceNumber(int eBlockSeqNum)
void
setMode(int mode)
void
setNextTrain(java.lang.String nextTrain)
void
setPriority(int priority)
void
setResetRestartSensor(boolean b)
void
setResetStartSensor(boolean b)
void
setResetWhenDone(boolean s)
protected void
setRestart(int delayType, int restartDelay, Sensor delaySensor, boolean resetSensorAfter)
void
setRestartDelay(int min)
void
setRestartSensor(Sensor s)
void
setReverseAtEnd(boolean s)
void
setReverseDelayRestart(int delay)
void
setReverseDelaySensor(Sensor s)
void
setReverseResetRestartSensor(boolean b)
void
setReverseRestartDelay(int min)
void
setRosterEntry(RosterEntry re)
void
setStartBlock(Block sBlock)
void
setStartBlockSectionSequenceNumber(int sBlockSeqNum)
void
setStarted()
void
setStatus(int status)
void
setTerminateWhenDone(boolean boo)
void
setTrainDetection(ActiveTrain.TrainDetection value)
sets the train detection typevoid
setTrainType(int type)
void
setTrainType(java.lang.String sType)
set train type using localized string name as storedvoid
setTransitReversed(boolean set)
void
terminate()
-
-
-
Field Detail
-
RUNNING
public static final int RUNNING
Constants representing the Status of this ActiveTrain When created, the Status of an Active Train is always WAITING,- See Also:
- Constant Field Values
-
PAUSED
public static final int PAUSED
- See Also:
- Constant Field Values
-
WAITING
public static final int WAITING
- See Also:
- Constant Field Values
-
WORKING
public static final int WORKING
- See Also:
- Constant Field Values
-
READY
public static final int READY
- See Also:
- Constant Field Values
-
STOPPED
public static final int STOPPED
- See Also:
- Constant Field Values
-
DONE
public static final int DONE
- See Also:
- Constant Field Values
-
NONE
public static final int NONE
Constants representing Type of ActiveTrains.- See Also:
- Constant Field Values
-
LOCAL_PASSENGER
public static final int LOCAL_PASSENGER
- See Also:
- Constant Field Values
-
LOCAL_FREIGHT
public static final int LOCAL_FREIGHT
- See Also:
- Constant Field Values
-
THROUGH_PASSENGER
public static final int THROUGH_PASSENGER
- See Also:
- Constant Field Values
-
THROUGH_FREIGHT
public static final int THROUGH_FREIGHT
- See Also:
- Constant Field Values
-
EXPRESS_PASSENGER
public static final int EXPRESS_PASSENGER
- See Also:
- Constant Field Values
-
EXPRESS_FREIGHT
public static final int EXPRESS_FREIGHT
- See Also:
- Constant Field Values
-
MOW
public static final int MOW
- See Also:
- Constant Field Values
-
AUTOMATIC
public static final int AUTOMATIC
Constants representing the mode of running of the Active Train The mode is set when the Active Train is created. The mode may be switched during a run.- See Also:
- Constant Field Values
-
MANUAL
public static final int MANUAL
- See Also:
- Constant Field Values
-
DISPATCHED
public static final int DISPATCHED
- See Also:
- Constant Field Values
-
TERMINATED
public static final int TERMINATED
- See Also:
- Constant Field Values
-
ROSTER
public static final int ROSTER
Constants representing the source of the train information- See Also:
- Constant Field Values
-
OPERATIONS
public static final int OPERATIONS
- See Also:
- Constant Field Values
-
USER
public static final int USER
- See Also:
- Constant Field Values
-
ALLOCATE_AS_FAR_AS_IT_CAN
public static final int ALLOCATE_AS_FAR_AS_IT_CAN
The value ofgetAllocateMethod()
if allocating as many sections as are clear.- See Also:
- Constant Field Values
-
ALLOCATE_BY_SAFE_SECTIONS
public static final int ALLOCATE_BY_SAFE_SECTIONS
The value ofgetAllocateMethod()
if allocating up until the next safe section- See Also:
- Constant Field Values
-
NODELAY
public static final int NODELAY
- See Also:
- Constant Field Values
-
TIMEDDELAY
public static final int TIMEDDELAY
- See Also:
- Constant Field Values
-
SENSORDELAY
public static final int SENSORDELAY
- See Also:
- Constant Field Values
-
mReverseRestartDelay
int mReverseRestartDelay
-
restartHr
int restartHr
-
restartMin
int restartMin
-
restartPoint
boolean restartPoint
-
-
Constructor Detail
-
ActiveTrain
public ActiveTrain(Transit t, java.lang.String name, int trainSource)
Create an ActiveTrain.- Parameters:
t
- the transit linked to this ActiveTrainname
- the train nametrainSource
- the source for this ActiveTrain
-
-
Method Detail
-
getStarted
public boolean getStarted()
-
setStarted
public void setStarted()
-
getTransit
public Transit getTransit()
-
getTransitName
public java.lang.String getTransitName()
-
getActiveTrainName
public java.lang.String getActiveTrainName()
-
getTrainName
public java.lang.String getTrainName()
-
getTrainSource
public int getTrainSource()
-
setRosterEntry
public void setRosterEntry(RosterEntry re)
-
getRosterEntry
public RosterEntry getRosterEntry()
-
getStatus
public int getStatus()
-
setStatus
public void setStatus(int status)
-
setControlingSignal
public void setControlingSignal(java.lang.Object oldSignal, java.lang.Object newSignal)
-
getStatusText
public java.lang.String getStatusText()
-
setTrainDetection
public void setTrainDetection(ActiveTrain.TrainDetection value)
sets the train detection type- Parameters:
value
-ActiveTrain.TrainDetection
-
getTrainDetection
public ActiveTrain.TrainDetection getTrainDetection()
Gets the train detection type- Returns:
ActiveTrain.TrainDetection
-
isTransitReversed
public boolean isTransitReversed()
-
setTransitReversed
public void setTransitReversed(boolean set)
-
isAllocationReversed
public boolean isAllocationReversed()
-
setAllocationReversed
public void setAllocationReversed(boolean set)
-
getDelayedStart
public int getDelayedStart()
-
setNextTrain
public void setNextTrain(java.lang.String nextTrain)
-
getNextTrain
public java.lang.String getNextTrain()
-
setDelayedStart
public void setDelayedStart(int delay)
-
getDelayedRestart
public int getDelayedRestart()
-
setDelayedRestart
public void setDelayedRestart(int delay)
-
getDelayReverseRestart
public int getDelayReverseRestart()
-
setReverseDelayRestart
public void setReverseDelayRestart(int delay)
-
getDepartureTimeHr
public int getDepartureTimeHr()
-
setDepartureTimeHr
public void setDepartureTimeHr(int hr)
-
getDepartureTimeMin
public int getDepartureTimeMin()
-
setDepartureTimeMin
public void setDepartureTimeMin(int min)
-
setRestartDelay
public void setRestartDelay(int min)
-
getRestartDelay
public int getRestartDelay()
-
getReverseRestartDelay
public int getReverseRestartDelay()
-
setReverseRestartDelay
public void setReverseRestartDelay(int min)
-
getRestartDepartHr
public int getRestartDepartHr()
-
getRestartDepartMin
public int getRestartDepartMin()
-
setTerminateWhenDone
public void setTerminateWhenDone(boolean boo)
-
getDelaySensor
public Sensor getDelaySensor()
-
getDelaySensorName
public java.lang.String getDelaySensorName()
-
setDelaySensor
public void setDelaySensor(Sensor s)
-
setResetStartSensor
public void setResetStartSensor(boolean b)
-
getResetStartSensor
public boolean getResetStartSensor()
-
getReverseRestartSensor
public Sensor getReverseRestartSensor()
-
getReverseRestartSensorName
public java.lang.String getReverseRestartSensorName()
-
setReverseDelaySensor
public void setReverseDelaySensor(Sensor s)
-
setReverseResetRestartSensor
public void setReverseResetRestartSensor(boolean b)
-
getResetReverseRestartSensor
public boolean getResetReverseRestartSensor()
-
getRestartSensor
public Sensor getRestartSensor()
-
getRestartSensorName
public java.lang.String getRestartSensorName()
-
setRestartSensor
public void setRestartSensor(Sensor s)
-
setResetRestartSensor
public void setResetRestartSensor(boolean b)
-
getResetRestartSensor
public boolean getResetRestartSensor()
-
initializeDelaySensor
public void initializeDelaySensor()
-
initializeRestartSensor
public void initializeRestartSensor(Sensor restartSensor, boolean resetSensor)
-
initializeRestartAllocationSensor
public void initializeRestartAllocationSensor(NamedBeanHandle<Sensor> restartAllocationSensor)
-
setTrainType
public void setTrainType(int type)
-
setTrainType
public void setTrainType(java.lang.String sType)
set train type using localized string name as stored- Parameters:
sType
- name, such as "LOCAL_PASSENGER"
-
getTrainType
public int getTrainType()
-
getTrainTypeText
public java.lang.String getTrainTypeText()
-
getMode
public int getMode()
-
forcePassNextSafeSection
public void forcePassNextSafeSection()
-
setMode
public void setMode(int mode)
-
getModeText
public java.lang.String getModeText()
-
setAutoActiveTrain
public void setAutoActiveTrain(AutoActiveTrain aat)
-
getAutoActiveTrain
public AutoActiveTrain getAutoActiveTrain()
-
getRunningDirectionFromSectionAndSeq
public int getRunningDirectionFromSectionAndSeq(Section s, int seqNo)
-
getAllocationDirectionFromSectionAndSeq
public int getAllocationDirectionFromSectionAndSeq(Section s, int seqNo)
-
addAllocatedSection
public void addAllocatedSection(AllocatedSection as)
-
removeAllocatedSection
public void removeAllocatedSection(AllocatedSection as)
-
allocateAFresh
public void allocateAFresh()
This resets the state of the ActiveTrain so that it can be reallocated.
-
clearAllocations
public void clearAllocations()
-
getAllocatedSectionList
public java.util.List<AllocatedSection> getAllocatedSectionList()
-
getBlockList
public java.util.List<Block> getBlockList()
Returns list of all Blocks occupied by or allocated to this train. They are in order from the tail of the train to the head of the train then on to the forward-most allocated block. Note that unoccupied blocks can exist before and after the occupied blocks. TODO: doesn't handle reversing of adjacent multi-block sections well- Returns:
- the list of blocks order of occupation
-
getLastAllocatedSection
public Section getLastAllocatedSection()
-
getLastAllocOverrideSafe
public Section getLastAllocOverrideSafe()
-
getLastAllocatedSectionSeqNumber
public int getLastAllocatedSectionSeqNumber()
-
getLastAllocatedSectionName
public java.lang.String getLastAllocatedSectionName()
-
getNextSectionToAllocate
public Section getNextSectionToAllocate()
-
getNextSectionSeqNumber
public int getNextSectionSeqNumber()
-
getNextSectionToAllocateName
public java.lang.String getNextSectionToAllocateName()
-
getStartBlock
public Block getStartBlock()
-
setStartBlock
public void setStartBlock(Block sBlock)
-
getStartBlockSectionSequenceNumber
public int getStartBlockSectionSequenceNumber()
-
setStartBlockSectionSequenceNumber
public void setStartBlockSectionSequenceNumber(int sBlockSeqNum)
-
getEndBlock
public Block getEndBlock()
-
setEndBlock
public void setEndBlock(Block eBlock)
-
getEndBlockSection
public Section getEndBlockSection()
-
setEndBlockSection
public void setEndBlockSection(Section eSection)
-
getEndBlockSectionSequenceNumber
public int getEndBlockSectionSequenceNumber()
-
setEndBlockSectionSequenceNumber
public void setEndBlockSectionSequenceNumber(int eBlockSeqNum)
-
getPriority
public int getPriority()
-
setPriority
public void setPriority(int priority)
-
getAutoRun
public boolean getAutoRun()
-
setAutoRun
public void setAutoRun(boolean autoRun)
-
getDccAddress
public java.lang.String getDccAddress()
-
setDccAddress
public void setDccAddress(java.lang.String dccAddress)
-
getResetWhenDone
public boolean getResetWhenDone()
-
setResetWhenDone
public void setResetWhenDone(boolean s)
-
getReverseAtEnd
public boolean getReverseAtEnd()
-
setReverseAtEnd
public void setReverseAtEnd(boolean s)
-
getSecondAllocatedSection
protected Section getSecondAllocatedSection()
-
getAllocateMethod
public int getAllocateMethod()
Returns the AllocateM Method to be used by autoAllocate- Returns:
- The number of Blocks ahead to be allocated or 0 = Allocate By Safe sections or -1 - Allocate All The Way.
-
setAllocateMethod
public void setAllocateMethod(int i)
Sets the Allocation Method to be used bu autoAllocate- Parameters:
i
- The number of Blocks ahead to be allocated or 0 = Allocate By Safe sections or -1 - Allocate All The Way.
-
initializeFirstAllocation
public AllocationRequest initializeFirstAllocation()
-
addEndSection
protected boolean addEndSection(Section s, int seq)
-
removeLastAllocatedSection
protected void removeLastAllocatedSection()
-
reverseAllAllocatedSections
protected AllocatedSection reverseAllAllocatedSections()
-
resetAllAllocatedSections
protected void resetAllAllocatedSections()
-
setRestart
protected void setRestart(int delayType, int restartDelay, Sensor delaySensor, boolean resetSensorAfter)
-
isInAllocatedList
protected boolean isInAllocatedList(AllocatedSection as)
-
isInAllocatedList
protected boolean isInAllocatedList(Section s)
-
holdAllocation
protected void holdAllocation(boolean boo)
-
holdAllocation
protected boolean holdAllocation()
-
reachedRestartPoint
protected boolean reachedRestartPoint()
-
restart
protected void restart()
-
terminate
public void terminate()
-
dispose
public void dispose()
-
firePropertyChange
@OverridingMethodsMustInvokeSuper protected void firePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface:PropertyChangeProvider
Add aPropertyChangeListener
to the listener list.- Specified by:
addPropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
listener
- The PropertyChangeListener to be added
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Description copied from interface:PropertyChangeProvider
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()
Description copied from interface:PropertyChangeProvider
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)
Description copied from interface:PropertyChangeProvider
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.beans.PropertyChangeListener listener)
Description copied from interface:PropertyChangeProvider
Remove the specified listener from this object.- Specified by:
removePropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
listener
- ThePropertyChangeListener
to remove.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Description copied from interface:PropertyChangeProvider
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.
-
-