Package jmri.jmrix.dcc4pc
Class Dcc4PcProgrammerManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.managers.DefaultProgrammerManager
-
- jmri.jmrix.dcc4pc.Dcc4PcProgrammerManager
-
- All Implemented Interfaces:
AddressedProgrammerManager
,PropertyChangeFirer
,PropertyChangeProvider
,GlobalProgrammerManager
public class Dcc4PcProgrammerManager extends DefaultProgrammerManager
DCC4PC Programmer acts as a proxy for ops mode programming. Extend DefaultProgrammerManager to provide ops mode programmers on XpressNet- See Also:
DefaultProgrammerManager
-
-
Field Summary
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description Dcc4PcProgrammerManager(T manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AddressedProgrammer
getAddressedProgrammer(boolean pLongAddress, int pAddress)
Gain access to a Addressed Mode Programmer without reservation.Programmer
getGlobalProgrammer()
Gain access to the Global Mode Programmer without reservation.java.lang.String
getUserName()
Provides the human-readable representation for including ProgrammerManagers directly in user interface components, so it should return a user-provided name for this particular one.boolean
isAddressedModePossible()
XpressNet command station does provide Ops Mode We should make this return false based on what command station we're using but for now, we'll return trueboolean
isGlobalProgrammerAvailable()
Convenience method to check whether you'll be able to get a Global Mode programmer.void
releaseAddressedProgrammer(AddressedProgrammer p)
Return access to an Addressed Mode Programmer, so that it can be used elsewhere.void
releaseGlobalProgrammer(Programmer p)
Return access to the Global Mode Programmer, so that it can be used elsewhere.AddressedProgrammer
reserveAddressedProgrammer(boolean pLongAddress, int pAddress)
Gain access to a (the) Addressed Mode Programmer, in the process reserving it for yourself.Programmer
reserveGlobalProgrammer()
Gain access to the Global Mode Programmer, in the process reserving it for yourself.-
Methods inherited from class jmri.managers.DefaultProgrammerManager
dispose, getDefaultModes, isAddressedModePossible, toString
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.AddressedProgrammerManager
getAddressedProgrammer, reserveAddressedProgrammer
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Constructor Detail
-
Dcc4PcProgrammerManager
public Dcc4PcProgrammerManager(@Nonnull T manager)
-
-
Method Detail
-
getGlobalProgrammer
public Programmer getGlobalProgrammer()
Description copied from interface:GlobalProgrammerManager
Gain access to the Global Mode Programmer without reservation.- Specified by:
getGlobalProgrammer
in interfaceGlobalProgrammerManager
- Overrides:
getGlobalProgrammer
in classDefaultProgrammerManager
- Returns:
- null only if there isn't a Global Mode Programmer available via this Manager.
-
getUserName
public java.lang.String getUserName()
Description copied from class:DefaultProgrammerManager
Provides the human-readable representation for including ProgrammerManagers directly in user interface components, so it should return a user-provided name for this particular one.- Specified by:
getUserName
in interfaceAddressedProgrammerManager
- Specified by:
getUserName
in interfaceGlobalProgrammerManager
- Overrides:
getUserName
in classDefaultProgrammerManager
- Returns:
- the name for the programmer
-
isAddressedModePossible
public boolean isAddressedModePossible()
XpressNet command station does provide Ops Mode We should make this return false based on what command station we're using but for now, we'll return true- Specified by:
isAddressedModePossible
in interfaceAddressedProgrammerManager
- Overrides:
isAddressedModePossible
in classDefaultProgrammerManager
- Returns:
- always false in this implementation
-
isGlobalProgrammerAvailable
public boolean isGlobalProgrammerAvailable()
Description copied from class:DefaultProgrammerManager
Convenience method to check whether you'll be able to get a Global Mode programmer.- Specified by:
isGlobalProgrammerAvailable
in interfaceGlobalProgrammerManager
- Overrides:
isGlobalProgrammerAvailable
in classDefaultProgrammerManager
- Returns:
- always false in this implementation
-
getAddressedProgrammer
public AddressedProgrammer getAddressedProgrammer(boolean pLongAddress, int pAddress)
Description copied from interface:AddressedProgrammerManager
Gain access to a Addressed Mode Programmer without reservation.- Specified by:
getAddressedProgrammer
in interfaceAddressedProgrammerManager
- Overrides:
getAddressedProgrammer
in classDefaultProgrammerManager
- Parameters:
pLongAddress
- true if this is a long (14 bit) address, else falsepAddress
- specific decoder address to use- Returns:
- null only if there isn't an Ops Mode Programmer in the system
-
reserveAddressedProgrammer
public AddressedProgrammer reserveAddressedProgrammer(boolean pLongAddress, int pAddress)
Description copied from interface:AddressedProgrammerManager
Gain access to a (the) Addressed Mode Programmer, in the process reserving it for yourself.- Specified by:
reserveAddressedProgrammer
in interfaceAddressedProgrammerManager
- Overrides:
reserveAddressedProgrammer
in classDefaultProgrammerManager
- Parameters:
pLongAddress
- true if this is a long (14 bit) address, else falsepAddress
- Specific decoder address to use- Returns:
- null if the address is in use by a reserved programmer
-
releaseAddressedProgrammer
public void releaseAddressedProgrammer(AddressedProgrammer p)
Description copied from interface:AddressedProgrammerManager
Return access to an Addressed Mode Programmer, so that it can be used elsewhere.- Specified by:
releaseAddressedProgrammer
in interfaceAddressedProgrammerManager
- Overrides:
releaseAddressedProgrammer
in classDefaultProgrammerManager
- Parameters:
p
- the programmer to release
-
reserveGlobalProgrammer
public Programmer reserveGlobalProgrammer()
Description copied from interface:GlobalProgrammerManager
Gain access to the Global Mode Programmer, in the process reserving it for yourself.- Specified by:
reserveGlobalProgrammer
in interfaceGlobalProgrammerManager
- Overrides:
reserveGlobalProgrammer
in classDefaultProgrammerManager
- Returns:
- null if the existing Global Mode programmer is in use
-
releaseGlobalProgrammer
public void releaseGlobalProgrammer(Programmer p)
Description copied from interface:GlobalProgrammerManager
Return access to the Global Mode Programmer, so that it can be used elsewhere.- Specified by:
releaseGlobalProgrammer
in interfaceGlobalProgrammerManager
- Overrides:
releaseGlobalProgrammer
in classDefaultProgrammerManager
- Parameters:
p
- the Programmer to release
-
-