Class EntryExitPairs
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.beans.VetoableChangeSupport
-
- jmri.jmrit.entryexit.EntryExitPairs
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener,java.util.EventListener,PropertyChangeFirer,PropertyChangeProvider,SilenceablePropertyChangeProvider,VetoableChangeFirer,VetoableChangeProvider,InstanceManagerAutoDefault,Manager<DestinationPoints>
public class EntryExitPairs extends VetoableChangeSupport implements Manager<DestinationPoints>, InstanceManagerAutoDefault, java.beans.PropertyChangeListener
Implements an Entry Exit based method of setting turnouts, setting up signal logic and allocating blocks through a path based on the Layout Editor.The route is based upon having a sensor assigned at a known location on the panel (set at the boundary of two different blocks) through to a sensor at a remote location on the same panel. Using the layout block routing, a path can then be set between the two sensors so long as one exists and no section of track is set occupied. If available an alternative route will be used when the direct path is occupied (blocked).
Initial implementation only handles the setting up of turnouts on a path.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classEntryExitPairs.StackDetailsClass to collect (stack) routes when they are requested but blocked.-
Nested classes/interfaces inherited from interface jmri.Manager
Manager.ManagerDataEvent<E extends NamedBean>, Manager.ManagerDataListener<E extends NamedBean>, Manager.NameValidity
-
-
Field Summary
Fields Modifier and Type Field Description (package private) booleanabsSignalMode(package private) booleanallocateToDispatcherstatic intAUTOCANCELstatic intAUTOCLEARstatic intAUTOSTACKstatic intCANCELROUTE(package private) javax.swing.TimercheckTimerstatic intCLEARROUTE(package private) intcurrentDealing(package private) java.util.List<jmri.jmrit.entryexit.EntryExitPairs.DeletePair>deletePairListList of NX pairs that are scheduled for deletion.static intEXITROUTEstatic intFULLINTERLOCKConstant value to represent that the entryExit will do full interlocking.(package private) static javax.swing.JPanelglassPane(package private) intinterlockTypeToUseWhenStable(package private) java.util.List<Manager.ManagerDataListener<DestinationPoints>>listeners(package private) intmemoryClearDelay(package private) java.lang.StringmemoryOptionstatic intNXBUTTONACTIVEstatic intNXBUTTONINACTIVEstatic intNXBUTTONSELECTED(package private) java.util.HashMap<PointDetails,Source>nxpairstatic intOVERLAP_CANCELstatic intOVERLAP_STACK(package private) static java.util.List<PointDetails>pointDetailsstatic intPROMPTUSERstatic java.lang.StringPROPERTY_ACTIVEString constant for active.static java.lang.StringPROPERTY_AUTO_GENERATE_COMPLETEString constant for auto generate complete.protected java.beans.PropertyChangeListenerpropertyBlockManagerListenerprotected java.beans.PropertyChangeListenerpropertyDestinationListener(package private) intrefCounter(package private) introuteClearOption(package private) introuteOverlapOption(package private) java.util.List<jmri.jmrit.entryexit.EntryExitPairs.SourceToDest>routesToSetList holding SourceToDest sets of routes between two points.LayoutBlockConnectivityTools.MetricroutingMethod(package private) booleanrunWhenStabilisedstatic intSETUPSIGNALMASTLOGICConstant value to represent that the entryExit will set up the turnouts between two different points and configure the Signal Mast Logic to use the correct blocks.static intSETUPTURNOUTSONLYConstant value to represent that the entryExit will only set up the turnouts between two different points.(package private) SignalMastLogicManagersmlm(package private) javax.swing.JDialogstackDialog(package private) java.util.List<EntryExitPairs.StackDetails>stackList(package private) StackNXPanelstackPanelstatic intSTACKROUTE(package private) LayoutEditortoUseWhenStableintturnoutSetDelayDelay between issuing Turnout commands-
Fields inherited from class jmri.beans.VetoableChangeSupport
vetoableChangeSupport
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
Fields inherited from interface jmri.Manager
ANALOGIOS, AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, CTCDATA, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXNG_ANALOG_ACTIONS, LOGIXNG_ANALOG_EXPRESSIONS, LOGIXNG_CONDITIONALNGS, LOGIXNG_DIGITAL_ACTIONS, LOGIXNG_DIGITAL_BOOLEAN_ACTIONS, LOGIXNG_DIGITAL_EXPRESSIONS, LOGIXNG_GLOBAL_VARIABLES, LOGIXNG_MODULES, LOGIXNG_STRING_ACTIONS, LOGIXNG_STRING_EXPRESSIONS, LOGIXNG_TABLES, LOGIXNGS, LOGIXS, MEMORIES, METERFRAMES, METERS, OBLOCKS, PANELFILES, PROPERTY_BEANS, PROPERTY_CAN_DELETE, PROPERTY_DISPLAY_LIST_NAME, PROPERTY_DO_DELETE, PROPERTY_DO_NOT_DELETE, PROPERTY_LENGTH, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
-
-
Constructor Summary
Constructors Constructor Description EntryExitPairs()Constructor for creating an EntryExitPairs object and create a transparent JPanel for it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDataListener(Manager.ManagerDataListener<DestinationPoints> e)Register aManager.ManagerDataListenerto hear about adding or removing items from the list of NamedBeans.voidaddNXDestination(NamedBean source, NamedBean destination, LayoutEditor panel)voidaddNXDestination(NamedBean source, NamedBean destination, LayoutEditor panel, java.lang.String id)voidaddNXSourcePoint(LayoutBlock facing, java.util.List<LayoutBlock> protecting, NamedBean loc, LayoutEditor panel)voidaddNXSourcePoint(NamedBean source)voidaddNXSourcePoint(NamedBean source, LayoutEditor panel)voidautomaticallyDiscoverEntryExitPairs(LayoutEditor editor, int interlockType)Discover all possible valid source and destination Signal Mast Logic pairs on all Layout Editor panels.booleancanBeBiDirectional(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)voidcancelInterlock(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)voidcancelStackedRoute(DestinationPoints dp, boolean reverse)Remove a stacked route from stackList.(package private) voidcheckRoute()Step through stackList and activate the first stacked route in line if it is no longer blocked.(package private) voidcreateDeletePairList(NamedBean sensor)Rebuild the delete pair list based on the supplied sensor.voiddeleteBean(DestinationPoints bean, java.lang.String property)Method for a UI to delete a bean.booleandeleteNxPair(NamedBean sensor)Entry point to delete all of the NX pairs for a specific sensor. 1) Build a list of affected NX pairs. 2) Check for Conditional references. 3) If no references, do the delete process with user approval.booleandeleteNxPair(NamedBean entrySensor, NamedBean exitSensor, LayoutEditor panel)Entry point to delete a specific NX pair.voidderegister(DestinationPoints n)Forget a NamedBean Object created outside the manager.voiddispose()Free resources when no longer used.java.lang.StringgetBeanTypeHandled(boolean plural)Get the user-readable name of the type of NamedBean handled by this manager.DestinationPointsgetBySystemName(java.lang.String systemName)Locate an existing instance based on a system name.DestinationPointsgetByUserName(java.lang.String userName)Locate an existing instance based on a user name.intgetClearDownOption()java.util.List<java.lang.Object>getDestinationList(java.lang.Object obj, LayoutEditor panel)booleangetDispatcherIntegration()java.lang.ObjectgetEndPointLocation(NamedBean source, LayoutEditor panel)java.util.List<java.lang.String>getEntryExitList()intgetEntryExitType(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)javax.swing.JPanelgetGlassPane()Get the transparent JPanel for this EntryExitPairs.SystemConnectionMemogetMemo()Get the system connection for this manager.intgetMemoryClearDelay()java.lang.StringgetMemoryOption()DestinationPointsgetNamedBean(java.lang.String name)Locate an existing instance based on a name.java.lang.Class<DestinationPoints>getNamedBeanClass()Get the class of NamedBean supported by this Manager.java.util.SortedSet<DestinationPoints>getNamedBeanSet()Implemented to support the Conditional combo box name listjava.util.List<java.lang.Object>getNxDestination()intgetNxPairNumbers(LayoutEditor panel)java.util.List<java.lang.Object>getNxSource(LayoutEditor panel)intgetObjectCount()Get the count of managed objects.intgetOverlapOption()java.lang.StringgetPointAsString(NamedBean obj, LayoutEditor panel)Get the name of a destinationPoint on a LE Panel.PointDetailsgetPointDetails(java.lang.Object obj, LayoutEditor panel)Return a point from a given LE Panel.(package private) PointDetailsgetPointDetails(LayoutBlock source, java.util.List<LayoutBlock> destination, LayoutEditor panel)Return either an existing point stored in pointDetails, or create a new one as required.java.awt.ColorgetSettingRouteColor()intgetSettingTimer()SourcegetSourceForPoint(PointDetails pd)java.util.List<java.lang.Object>getSourceList(LayoutEditor panel)Return a list of all source (origin) points on a given Layout Editor panel.java.util.List<LayoutEditor>getSourcePanelList()java.util.List<DestinationPoints>getStackedInterlocks()Get a list of all stacked routes from stackList.java.lang.StringgetSystemPrefix()Provide access to the system prefix string.java.lang.StringgetUniqueId(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)intgetXMLOrder()Determine the order that types should be written when storing panel files.booleanisAbsSignalMode()booleanisDestinationValid(java.lang.Object source, java.lang.Object dest, LayoutEditor panel)booleanisEnabled(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)booleanisPathActive(java.lang.Object sourceObj, java.lang.Object destObj, LayoutEditor panel)booleanisRouteStacked(DestinationPoints dp, boolean reverse)Query if a stacked route is in stackList.booleanisUniDirection(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)java.util.List<java.lang.String>layoutBlockSensors(LayoutBlock layoutBlock)Create a list of sensors that have the layout block as either facing or protecting.java.lang.StringmakeSystemName(java.lang.String s)Create a SystemName by prepending the system name prefix to the name if not already present.(package private) voidprocessRoutesToSet()Activate each SourceToDest set in routesToSetvoidpropertyChange(java.beans.PropertyChangeEvent evt)PointDetailsprovidePoint(NamedBean source, LayoutEditor panel)Generate the point details, given a known source and a Layout Editor panel.voidregister(DestinationPoints n)Remember a NamedBean Object created outside the manager.voidremoveDataListener(Manager.ManagerDataListener<DestinationPoints> e)Unregister a previously-addedManager.ManagerDataListener.voidremoveNXSensor(Sensor sensor)voidremovePropertyChangeListener(java.beans.PropertyChangeListener list, NamedBean obj, LayoutEditor panel)(package private) voidremoveRemainingRoute()Remove remaining SourceToDest sets in routesToSetvoidsetAbsSignalMode(boolean absMode)voidsetClearDownOption(int i)voidsetDispatcherIntegration(boolean boo)voidsetEnabled(java.lang.Object source, LayoutEditor panel, java.lang.Object dest, boolean set)voidsetEntryExitType(java.lang.Object source, LayoutEditor panel, java.lang.Object dest, int set)voidsetMemoryClearDelay(int secs)voidsetMemoryOption(java.lang.String memoryName)voidsetMultiPointRoute(PointDetails requestpd, LayoutEditor panel)voidsetOverlapOption(int i)voidsetPropertyChangesSilenced(java.lang.String propertyName, boolean silenced)Suppress sendingPropertyChangeEvents for the named property.voidsetReversedRoute(java.lang.String nxPair)Set a reversed route between two points.voidsetSettingRouteColor(java.awt.Color col)voidsetSettingTimer(int i)voidsetSingleSegmentRoute(java.lang.String nxPair)Set the route between the two points represented by the Destination Point name.voidsetUniDirection(java.lang.Object source, LayoutEditor panel, java.lang.Object dest, boolean set)voidstackNXRoute(DestinationPoints dp, boolean reverse)If a route is requested but is currently blocked, ask user if it should be added to stackList.chartypeLetter()booleanuseDifferentColorWhenSetting()voidvetoableChange(java.beans.PropertyChangeEvent evt)-
Methods inherited from class jmri.beans.VetoableChangeSupport
addVetoableChangeListener, addVetoableChangeListener, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
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, toString, wait, wait, wait
-
Methods inherited from interface jmri.Manager
getBeanTypeHandled, getEntryToolTip, getKnownBeanProperties, getSubSystemNamePrefix, getSystemNamePrefix, isValidSystemNameFormat, makeSystemName, makeSystemName, setDataListenerMute, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormat, validSystemNameFormat
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Field Detail
-
routingMethod
public LayoutBlockConnectivityTools.Metric routingMethod
-
NXBUTTONSELECTED
public static final int NXBUTTONSELECTED
- See Also:
- Constant Field Values
-
NXBUTTONACTIVE
public static final int NXBUTTONACTIVE
- See Also:
- Constant Field Values
-
NXBUTTONINACTIVE
public static final int NXBUTTONINACTIVE
- See Also:
- Constant Field Values
-
SETUPTURNOUTSONLY
public static final int SETUPTURNOUTSONLY
Constant value to represent that the entryExit will only set up the turnouts between two different points.- See Also:
- Constant Field Values
-
SETUPSIGNALMASTLOGIC
public static final int SETUPSIGNALMASTLOGIC
Constant value to represent that the entryExit will set up the turnouts between two different points and configure the Signal Mast Logic to use the correct blocks.- See Also:
- Constant Field Values
-
FULLINTERLOCK
public static final int FULLINTERLOCK
Constant value to represent that the entryExit will do full interlocking. It will set the turnouts and "reserve" the blocks.- See Also:
- Constant Field Values
-
allocateToDispatcher
boolean allocateToDispatcher
-
absSignalMode
boolean absSignalMode
-
PROMPTUSER
public static final int PROMPTUSER
- See Also:
- Constant Field Values
-
AUTOCLEAR
public static final int AUTOCLEAR
- See Also:
- Constant Field Values
-
AUTOCANCEL
public static final int AUTOCANCEL
- See Also:
- Constant Field Values
-
AUTOSTACK
public static final int AUTOSTACK
- See Also:
- Constant Field Values
-
OVERLAP_CANCEL
public static final int OVERLAP_CANCEL
- See Also:
- Constant Field Values
-
OVERLAP_STACK
public static final int OVERLAP_STACK
- See Also:
- Constant Field Values
-
PROPERTY_AUTO_GENERATE_COMPLETE
public static final java.lang.String PROPERTY_AUTO_GENERATE_COMPLETE
String constant for auto generate complete.- See Also:
- Constant Field Values
-
PROPERTY_ACTIVE
public static final java.lang.String PROPERTY_ACTIVE
String constant for active.- See Also:
- Constant Field Values
-
routeClearOption
int routeClearOption
-
routeOverlapOption
int routeOverlapOption
-
memoryOption
java.lang.String memoryOption
-
memoryClearDelay
int memoryClearDelay
-
glassPane
static javax.swing.JPanel glassPane
-
turnoutSetDelay
public int turnoutSetDelay
Delay between issuing Turnout commands
-
nxpair
java.util.HashMap<PointDetails,Source> nxpair
-
refCounter
int refCounter
-
routesToSet
java.util.List<jmri.jmrit.entryexit.EntryExitPairs.SourceToDest> routesToSet
List holding SourceToDest sets of routes between two points.
-
currentDealing
int currentDealing
-
propertyDestinationListener
protected java.beans.PropertyChangeListener propertyDestinationListener
-
deletePairList
java.util.List<jmri.jmrit.entryexit.EntryExitPairs.DeletePair> deletePairList
List of NX pairs that are scheduled for deletion.- Since:
- 4.11.2
-
CANCELROUTE
public static final int CANCELROUTE
- See Also:
- Constant Field Values
-
CLEARROUTE
public static final int CLEARROUTE
- See Also:
- Constant Field Values
-
EXITROUTE
public static final int EXITROUTE
- See Also:
- Constant Field Values
-
STACKROUTE
public static final int STACKROUTE
- See Also:
- Constant Field Values
-
pointDetails
static java.util.List<PointDetails> pointDetails
-
stackList
java.util.List<EntryExitPairs.StackDetails> stackList
-
stackPanel
StackNXPanel stackPanel
-
stackDialog
javax.swing.JDialog stackDialog
-
checkTimer
javax.swing.Timer checkTimer
-
runWhenStabilised
boolean runWhenStabilised
-
toUseWhenStable
LayoutEditor toUseWhenStable
-
interlockTypeToUseWhenStable
int interlockTypeToUseWhenStable
-
propertyBlockManagerListener
protected java.beans.PropertyChangeListener propertyBlockManagerListener
-
listeners
final java.util.List<Manager.ManagerDataListener<DestinationPoints>> listeners
-
-
Constructor Detail
-
EntryExitPairs
public EntryExitPairs()
Constructor for creating an EntryExitPairs object and create a transparent JPanel for it.
-
-
Method Detail
-
getSettingTimer
public int getSettingTimer()
-
setSettingTimer
public void setSettingTimer(int i)
-
useDifferentColorWhenSetting
public boolean useDifferentColorWhenSetting()
-
getSettingRouteColor
public java.awt.Color getSettingRouteColor()
-
setSettingRouteColor
public void setSettingRouteColor(java.awt.Color col)
-
setDispatcherIntegration
public void setDispatcherIntegration(boolean boo)
-
getDispatcherIntegration
public boolean getDispatcherIntegration()
-
setAbsSignalMode
public void setAbsSignalMode(boolean absMode)
-
isAbsSignalMode
public boolean isAbsSignalMode()
-
getGlassPane
public javax.swing.JPanel getGlassPane()
Get the transparent JPanel for this EntryExitPairs.- Returns:
- JPanel overlay
-
addNXSourcePoint
public void addNXSourcePoint(LayoutBlock facing, java.util.List<LayoutBlock> protecting, NamedBean loc, LayoutEditor panel)
-
addNXSourcePoint
public void addNXSourcePoint(NamedBean source)
-
addNXSourcePoint
public void addNXSourcePoint(NamedBean source, LayoutEditor panel)
-
getEndPointLocation
public java.lang.Object getEndPointLocation(NamedBean source, LayoutEditor panel)
-
getXMLOrder
public int getXMLOrder()
Determine the order that types should be written when storing panel files. Uses one of the constants defined in this class.Yes, that's an overly-centralized methodology, but it works for now.
- Specified by:
getXMLOrderin interfaceManager<DestinationPoints>- Returns:
- write order for this Manager; larger is later.
-
getBySystemName
public DestinationPoints getBySystemName(java.lang.String systemName)
Locate an existing instance based on a system name.- Specified by:
getBySystemNamein interfaceManager<DestinationPoints>- Parameters:
systemName- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getByUserName
public DestinationPoints getByUserName(@Nonnull java.lang.String userName)
Locate an existing instance based on a user name.- Specified by:
getByUserNamein interfaceManager<DestinationPoints>- Parameters:
userName- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getNamedBean
public DestinationPoints getNamedBean(@Nonnull java.lang.String name)
Locate an existing instance based on a name.- Specified by:
getNamedBeanin interfaceManager<DestinationPoints>- Parameters:
name- User Name or System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getMemo
@Nonnull public SystemConnectionMemo getMemo()
Get the system connection for this manager.- Specified by:
getMemoin interfaceManager<DestinationPoints>- Returns:
- the system connection for this manager
-
getSystemPrefix
@Nonnull public java.lang.String getSystemPrefix()
Provide access to the system prefix string. This was previously called the "System letter"- Specified by:
getSystemPrefixin interfaceManager<DestinationPoints>- Returns:
- the system prefix
-
typeLetter
public char typeLetter()
- Specified by:
typeLetterin interfaceManager<DestinationPoints>- Returns:
- The type letter for a specific implementation
-
makeSystemName
@Nonnull public java.lang.String makeSystemName(@Nonnull java.lang.String s)
Create a SystemName by prepending the system name prefix to the name if not already present.Note: implementations must call
Manager.validateSystemNameFormat(java.lang.String, java.util.Locale)to ensure the returned name is valid.- Specified by:
makeSystemNamein interfaceManager<DestinationPoints>- Parameters:
s- the item to make the system name for- Returns:
- A system name from a user input, typically a number.
-
getObjectCount
@CheckReturnValue public int getObjectCount()
Get the count of managed objects.- Specified by:
getObjectCountin interfaceManager<DestinationPoints>- Returns:
- the number of managed objects
-
getNamedBeanSet
@Nonnull public java.util.SortedSet<DestinationPoints> getNamedBeanSet()
Implemented to support the Conditional combo box name list- Specified by:
getNamedBeanSetin interfaceManager<DestinationPoints>- Returns:
- a list of Destination Point beans
- Since:
- 4.9.3
-
register
public void register(@Nonnull DestinationPoints n)
Remember a NamedBean Object created outside the manager.The non-system-specific SignalHeadManagers use this method extensively.
- Specified by:
registerin interfaceManager<DestinationPoints>- Parameters:
n- the bean
-
deregister
public void deregister(@Nonnull DestinationPoints n)
Forget a NamedBean Object created outside the manager.The non-system-specific RouteManager uses this method.
- Specified by:
deregisterin interfaceManager<DestinationPoints>- Parameters:
n- the bean
-
setClearDownOption
public void setClearDownOption(int i)
-
getClearDownOption
public int getClearDownOption()
-
setOverlapOption
public void setOverlapOption(int i)
-
getOverlapOption
public int getOverlapOption()
-
setMemoryOption
public void setMemoryOption(java.lang.String memoryName)
-
getMemoryOption
public java.lang.String getMemoryOption()
-
setMemoryClearDelay
public void setMemoryClearDelay(int secs)
-
getMemoryClearDelay
public int getMemoryClearDelay()
-
dispose
public void dispose()
Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.- Specified by:
disposein interfaceManager<DestinationPoints>
-
providePoint
public PointDetails providePoint(NamedBean source, LayoutEditor panel)
Generate the point details, given a known source and a Layout Editor panel.- Parameters:
source- Origin of movementpanel- A Layout Editor panel- Returns:
- A PointDetails object
-
getSourceList
public java.util.List<java.lang.Object> getSourceList(LayoutEditor panel)
Return a list of all source (origin) points on a given Layout Editor panel.- Parameters:
panel- A Layout Editor panel- Returns:
- A list of source objects
-
getSourceForPoint
public Source getSourceForPoint(PointDetails pd)
-
getNxPairNumbers
public int getNxPairNumbers(LayoutEditor panel)
-
setReversedRoute
public void setReversedRoute(java.lang.String nxPair)
Set a reversed route between two points. Special case to support a LogixNG action.- Parameters:
nxPair- The system or user name of the destination point.- Since:
- 5.5.7
-
setSingleSegmentRoute
public void setSingleSegmentRoute(java.lang.String nxPair)
Set the route between the two points represented by the Destination Point name.- Parameters:
nxPair- The system or user name of the destination point.- Since:
- 4.11.1
-
setMultiPointRoute
public void setMultiPointRoute(PointDetails requestpd, LayoutEditor panel)
-
processRoutesToSet
void processRoutesToSet()
Activate each SourceToDest set in routesToSet
-
removeRemainingRoute
void removeRemainingRoute()
Remove remaining SourceToDest sets in routesToSet
-
getNxSource
public java.util.List<java.lang.Object> getNxSource(LayoutEditor panel)
-
getNxDestination
public java.util.List<java.lang.Object> getNxDestination()
-
getSourcePanelList
public java.util.List<LayoutEditor> getSourcePanelList()
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener- Since:
- 4.17.4
-
addNXDestination
public void addNXDestination(NamedBean source, NamedBean destination, LayoutEditor panel)
-
addNXDestination
public void addNXDestination(NamedBean source, NamedBean destination, LayoutEditor panel, java.lang.String id)
- Parameters:
source- the source bean.destination- the destination bean.panel- the layout editor panel.id- the points details id.- Since:
- 4.17.4 Register in Property Change Listener.
-
getDestinationList
public java.util.List<java.lang.Object> getDestinationList(java.lang.Object obj, LayoutEditor panel)
-
removeNXSensor
public void removeNXSensor(Sensor sensor)
-
deleteNxPair
public boolean deleteNxPair(NamedBean sensor)
Entry point to delete all of the NX pairs for a specific sensor. 1) Build a list of affected NX pairs. 2) Check for Conditional references. 3) If no references, do the delete process with user approval.- Parameters:
sensor- The sensor whose pairs should be deleted.- Returns:
- true if the delete was successful. False if prevented by Conditional/LogixNG references or user choice.
- Since:
- 4.11.2
-
deleteNxPair
public boolean deleteNxPair(NamedBean entrySensor, NamedBean exitSensor, LayoutEditor panel)
Entry point to delete a specific NX pair.- Parameters:
entrySensor- The sensor that acts as the entry point.exitSensor- The sensor that acts as the exit point.panel- The layout editor panel that contains the entry sensor.- Returns:
- true if the delete was successful. False if there are Conditional/LogixNG references.
- Since:
- 4.11.2
-
createDeletePairList
void createDeletePairList(NamedBean sensor)
Rebuild the delete pair list based on the supplied sensor. Find all of the NX pairs that use this sensor as either a source or destination. They will be candidates for deletion.- Parameters:
sensor- The sensor being deleted,- Since:
- 4.11.2
-
layoutBlockSensors
public java.util.List<java.lang.String> layoutBlockSensors(@Nonnull LayoutBlock layoutBlock)
Create a list of sensors that have the layout block as either facing or protecting. Called byLayoutTrackEditor.hasNxSensorPairs(jmri.jmrit.display.layoutEditor.LayoutBlock).- Parameters:
layoutBlock- The layout block to be checked.- Returns:
- the a list of sensors affected by the layout block or an empty list.
- Since:
- 4.11.2
-
isDestinationValid
public boolean isDestinationValid(java.lang.Object source, java.lang.Object dest, LayoutEditor panel)
-
isUniDirection
public boolean isUniDirection(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)
-
setUniDirection
public void setUniDirection(java.lang.Object source, LayoutEditor panel, java.lang.Object dest, boolean set)
-
canBeBiDirectional
public boolean canBeBiDirectional(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)
-
isEnabled
public boolean isEnabled(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)
-
setEnabled
public void setEnabled(java.lang.Object source, LayoutEditor panel, java.lang.Object dest, boolean set)
-
setEntryExitType
public void setEntryExitType(java.lang.Object source, LayoutEditor panel, java.lang.Object dest, int set)
-
getEntryExitType
public int getEntryExitType(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)
-
getUniqueId
public java.lang.String getUniqueId(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)
-
getEntryExitList
public java.util.List<java.lang.String> getEntryExitList()
-
isPathActive
public boolean isPathActive(java.lang.Object sourceObj, java.lang.Object destObj, LayoutEditor panel)
-
cancelInterlock
public void cancelInterlock(java.lang.Object source, LayoutEditor panel, java.lang.Object dest)
-
getPointDetails
public PointDetails getPointDetails(java.lang.Object obj, LayoutEditor panel)
Return a point from a given LE Panel.- Parameters:
obj- The point objectpanel- The Layout Editor panel on which the point was placed- Returns:
- the point object, null if the point is not found
-
getPointDetails
PointDetails getPointDetails(LayoutBlock source, java.util.List<LayoutBlock> destination, LayoutEditor panel)
Return either an existing point stored in pointDetails, or create a new one as required.- Parameters:
source- The Layout Block functioning as the source (origin)destination- A (list of) Layout Blocks functioning as destinationspanel- The Layout Editor panel on which the point is to be placed- Returns:
- the point object
-
getPointAsString
public java.lang.String getPointAsString(NamedBean obj, LayoutEditor panel)
Get the name of a destinationPoint on a LE Panel.- Parameters:
obj- the point objectpanel- The Layout Editor panel on which it is expected to be placed- Returns:
- the name of the point
-
stackNXRoute
public void stackNXRoute(DestinationPoints dp, boolean reverse)
If a route is requested but is currently blocked, ask user if it should be added to stackList.- Parameters:
dp- DestinationPoints objectreverse- true for a reversed running direction, mostly false
-
getStackedInterlocks
public java.util.List<DestinationPoints> getStackedInterlocks()
Get a list of all stacked routes from stackList.- Returns:
- an List containing destinationPoint elements
-
isRouteStacked
public boolean isRouteStacked(DestinationPoints dp, boolean reverse)
Query if a stacked route is in stackList.- Parameters:
dp- DestinationPoints objectreverse- true for a reversed running direction, mostly false- Returns:
- true if dp is in stackList
-
cancelStackedRoute
public void cancelStackedRoute(DestinationPoints dp, boolean reverse)
Remove a stacked route from stackList.- Parameters:
dp- DestinationPoints objectreverse- true for a reversed running direction, mostly false
-
checkRoute
void checkRoute()
Step through stackList and activate the first stacked route in line if it is no longer blocked.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener list, NamedBean obj, LayoutEditor panel)
-
automaticallyDiscoverEntryExitPairs
public void automaticallyDiscoverEntryExitPairs(LayoutEditor editor, int interlockType) throws JmriException
Discover all possible valid source and destination Signal Mast Logic pairs on all Layout Editor panels.- Parameters:
editor- The Layout Editor panelinterlockType- Integer value representing the type of interlocking, one of SETUPTURNOUTSONLY, SETUPSIGNALMASTLOGIC or FULLINTERLOCK- Throws:
JmriException- when an error occurs during discovery
-
vetoableChange
public void vetoableChange(java.beans.PropertyChangeEvent evt) throws java.beans.PropertyVetoException
- Throws:
java.beans.PropertyVetoException
-
deleteBean
public void deleteBean(@Nonnull DestinationPoints bean, @Nonnull java.lang.String property) throws java.beans.PropertyVetoException
Description copied from interface:ManagerMethod for a UI to delete a bean.The UI should first request a "CanDelete", this will return a list of locations (and descriptions) where the bean is in use via throwing a VetoException, then if that comes back clear, or the user agrees with the actions, then a "DoDelete" can be called which inform the listeners to delete the bean, then it will be deregistered and disposed of.
If a property name of "DoNotDelete" is thrown back in the VetoException then the delete process should be aborted.
- Specified by:
deleteBeanin interfaceManager<DestinationPoints>- Parameters:
bean- The NamedBean to be deletedproperty- The programmatic name of the request. "CanDelete" will enquire with all listeners if the item can be deleted. "DoDelete" tells the listener to delete the item- Throws:
java.beans.PropertyVetoException- If the recipients wishes the delete to be aborted (see above)
-
getBeanTypeHandled
@Nonnull public java.lang.String getBeanTypeHandled(boolean plural)
Description copied from interface:ManagerGet the user-readable name of the type of NamedBean handled by this manager.For instance, in the code where we are dealing with just a bean and a message that needs to be passed to the user or in a log.
- Specified by:
getBeanTypeHandledin interfaceManager<DestinationPoints>- Parameters:
plural- true to return plural form of the type; false to return singular form- Returns:
- a string of the bean type that the manager handles, eg Turnout, Sensor etc
-
getNamedBeanClass
public java.lang.Class<DestinationPoints> getNamedBeanClass()
Get the class of NamedBean supported by this Manager. This should be the generic class used in the Manager's class declaration.- Specified by:
getNamedBeanClassin interfaceManager<DestinationPoints>- Returns:
- the class supported by this Manager.
-
setPropertyChangesSilenced
@OverridingMethodsMustInvokeSuper public void setPropertyChangesSilenced(@Nonnull java.lang.String propertyName, boolean silenced)
Suppress sendingPropertyChangeEvents for the named property.Stopping the suppression of sending change events may send a PropertyChangeEvent if the property changed while silenced, but otherwise should not fire a PropertyChangeEvent.
- Specified by:
setPropertyChangesSilencedin interfaceSilenceablePropertyChangeProvider- Parameters:
propertyName- the name of the property to mutesilenced- true if events are to be suppressed; false otherwise
-
addDataListener
public void addDataListener(Manager.ManagerDataListener<DestinationPoints> e)
Register aManager.ManagerDataListenerto hear about adding or removing items from the list of NamedBeans.- Specified by:
addDataListenerin interfaceManager<DestinationPoints>- Parameters:
e- the data listener to add
-
removeDataListener
public void removeDataListener(Manager.ManagerDataListener<DestinationPoints> e)
Unregister a previously-addedManager.ManagerDataListener.- Specified by:
removeDataListenerin interfaceManager<DestinationPoints>- Parameters:
e- the data listener to remove- See Also:
Manager.addDataListener(ManagerDataListener)
-
-