jmri.managers
Class DefaultSignalMastLogicManager

Show UML class diagram
java.lang.Object
  extended by jmri.managers.DefaultSignalMastLogicManager
All Implemented Interfaces:
Manager, SignalMastLogicManager

public class DefaultSignalMastLogicManager
extends Object
implements SignalMastLogicManager


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.


Field Summary
(package private) static org.slf4j.Logger log
           
(package private)  PropertyChangeSupport pcs
           
protected  PropertyChangeListener propertyBlockManagerListener
           
(package private)  boolean runWhenStablised
           
(package private)  long signalLogicDelay
           
(package private)  ArrayList<SignalMastLogic> signalMastLogic
           
 
Fields inherited from interface jmri.Manager
AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXS, MEMORIES, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
 
Constructor Summary
DefaultSignalMastLogicManager()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          At a minimum, subclasses must notify of changes to the list of available NamedBeans; they may have other properties that will also notify.
 void automaticallyDiscoverSignallingPairs()
          Discover all possible valid source and destination signalmasts past pairs on all layout editor panels.
 void deregister(NamedBean n)
          Forget a NamedBean Object created outside the manager.
 void disableLayoutEditorUse(SignalMast mast)
           
 void discoverSignallingDest(SignalMast source, LayoutEditor layout)
          Discover valid destination signalmasts for a given source signal on a given layout editor panel.
 void dispose()
          Free resources when no longer used.
protected  void firePropertyChange(String p, Object old, Object n)
           
 void generateSection()
           
 NamedBean getBeanBySystemName(String systemName)
          Locate an instance based on a system name.
 NamedBean getBeanByUserName(String userName)
          Locate an instance based on a user name.
 ArrayList<SignalMastLogic> getLogicsByDestination(SignalMast destination)
          Gather a list of all the signal mast logics, by destination signal mast
 NamedBean getNamedBean(String name)
          Locate an instance based on a name.
 List<NamedBean> getNamedBeanList()
           
 long getSignalLogicDelay()
           
 SignalMastLogic getSignalMastLogic(SignalMast source)
           
 ArrayList<SignalMastLogic> getSignalMastLogicList()
          Returns an arraylist of signalmastlogic
static SignalSpeedMap getSpeedMap()
           
 String[] getSystemNameArray()
           
 List<String> getSystemNameList()
           
 String getSystemPrefix()
          Provides access to the system prefix string.
 int getXMLOrder()
           
 void initialise()
          Used to initialise all the signalmast logics. primarily used after loading.
 boolean isSignalMastUsed(SignalMast mast)
           
 String makeSystemName(String s)
           
 SignalMastLogic newSignalMastLogic(SignalMast source)
           
 void register(NamedBean n)
          Remember a NamedBean Object created outside the manager.
protected  void registerSelf()
          By default, register this manager to store as configuration information.
 void removePropertyChangeListener(PropertyChangeListener l)
          At a minimum, subclasses must notify of changes to the list of available NamedBeans; they may have other properties that will also notify.
 void removeSignalMast(SignalMast mast)
          Completely remove the signalmast logic, for a specific signal mast
 void removeSignalMastLogic(SignalMastLogic sml)
          Completely remove the signalmast logic.
 void removeSignalMastLogic(SignalMastLogic sml, SignalMast dest)
          Remove a destination mast from the signalmast logic
 void replaceSignalMast(SignalMast oldMast, SignalMast newMast)
          This will replace all instances of an old SignalMast (either source or destination) with the new signal mast instance.
 void setSignalLogicDelay(long l)
           
 void swapSignalMasts(SignalMast mastA, SignalMast mastB)
           
 char systemLetter()
          Deprecated. 
 char typeLetter()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

signalMastLogic

ArrayList<SignalMastLogic> signalMastLogic

pcs

PropertyChangeSupport pcs

signalLogicDelay

long signalLogicDelay

propertyBlockManagerListener

protected PropertyChangeListener propertyBlockManagerListener

runWhenStablised

boolean runWhenStablised

log

static org.slf4j.Logger log
Constructor Detail

DefaultSignalMastLogicManager

public DefaultSignalMastLogicManager()
Method Detail

getXMLOrder

public int getXMLOrder()
Specified by:
getXMLOrder in interface Manager

getSpeedMap

public static final SignalSpeedMap getSpeedMap()

getSignalMastLogic

public SignalMastLogic getSignalMastLogic(SignalMast source)
Specified by:
getSignalMastLogic in interface SignalMastLogicManager

newSignalMastLogic

public SignalMastLogic newSignalMastLogic(SignalMast source)
Specified by:
newSignalMastLogic in interface SignalMastLogicManager

replaceSignalMast

public void replaceSignalMast(SignalMast oldMast,
                              SignalMast newMast)
Description copied from interface: SignalMastLogicManager
This will replace all instances of an old SignalMast (either source or destination) with the new signal mast instance. This is for use with such tools as the layout editor where a signalmast can at a certain location can be replaced with another, while the remainder of the configuration stays the same.

Specified by:
replaceSignalMast in interface SignalMastLogicManager

swapSignalMasts

public void swapSignalMasts(SignalMast mastA,
                            SignalMast mastB)
Specified by:
swapSignalMasts in interface SignalMastLogicManager

getLogicsByDestination

public ArrayList<SignalMastLogic> getLogicsByDestination(SignalMast destination)
Gather a list of all the signal mast logics, by destination signal mast

Specified by:
getLogicsByDestination in interface SignalMastLogicManager

getSignalMastLogicList

public ArrayList<SignalMastLogic> getSignalMastLogicList()
Returns an arraylist of signalmastlogic

Specified by:
getSignalMastLogicList in interface SignalMastLogicManager
Returns:
An ArrayList of SignalMast logics

isSignalMastUsed

public boolean isSignalMastUsed(SignalMast mast)
Specified by:
isSignalMastUsed in interface SignalMastLogicManager

removeSignalMastLogic

public void removeSignalMastLogic(SignalMastLogic sml,
                                  SignalMast dest)
Remove a destination mast from the signalmast logic

Specified by:
removeSignalMastLogic in interface SignalMastLogicManager
Parameters:
sml - The signalmast logic of the source signal
dest - The destination mast

removeSignalMastLogic

public void removeSignalMastLogic(SignalMastLogic sml)
Completely remove the signalmast logic.

Specified by:
removeSignalMastLogic in interface SignalMastLogicManager

removeSignalMast

public void removeSignalMast(SignalMast mast)
Description copied from interface: SignalMastLogicManager
Completely remove the signalmast logic, for a specific signal mast

Specified by:
removeSignalMast in interface SignalMastLogicManager

disableLayoutEditorUse

public void disableLayoutEditorUse(SignalMast mast)
Specified by:
disableLayoutEditorUse in interface SignalMastLogicManager

registerSelf

protected void registerSelf()
By default, register this manager to store as configuration information. Override to change that.


dispose

public void dispose()
Description copied from interface: Manager
Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.

Specified by:
dispose in interface Manager
Specified by:
dispose in interface SignalMastLogicManager

initialise

public void initialise()
Used to initialise all the signalmast logics. primarily used after loading.

Specified by:
initialise in interface SignalMastLogicManager

getBeanBySystemName

public NamedBean getBeanBySystemName(String systemName)
Description copied from interface: Manager
Locate an instance based on a system name. Returns null if no instance already exists.

Specified by:
getBeanBySystemName in interface Manager
Parameters:
systemName - System Name of the required NamedBean
Returns:
requested NamedBean object or null if none exists

getBeanByUserName

public NamedBean getBeanByUserName(String userName)
Description copied from interface: Manager
Locate an instance based on a user name. Returns null if no instance already exists.

Specified by:
getBeanByUserName in interface Manager
Parameters:
userName - System Name of the required NamedBean
Returns:
requested NamedBean object or null if none exists

getNamedBean

public NamedBean getNamedBean(String name)
Description copied from interface: Manager
Locate an instance based on a name. Returns null if no instance already exists.

Specified by:
getNamedBean in interface Manager
Parameters:
name - System Name of the required NamedBean
Returns:
requested NamedBean object or null if none exists

systemLetter

@Deprecated
public char systemLetter()
Deprecated. 

Specified by:
systemLetter in interface Manager
Returns:
The system-specific prefix letter for a specific implementation

getSystemPrefix

public String getSystemPrefix()
Description copied from interface: Manager
Provides access to the system prefix string. This was previously called the "System letter"

Specified by:
getSystemPrefix in interface Manager

typeLetter

public char typeLetter()
Specified by:
typeLetter in interface Manager
Returns:
The type letter for a specific implementation

makeSystemName

public String makeSystemName(String s)
Specified by:
makeSystemName in interface Manager
Returns:
A system name from a user input, typically a number.

getSystemNameArray

public String[] getSystemNameArray()
Specified by:
getSystemNameArray in interface Manager

getSystemNameList

public List<String> getSystemNameList()
Specified by:
getSystemNameList in interface Manager

getNamedBeanList

public List<NamedBean> getNamedBeanList()
Specified by:
getNamedBeanList in interface Manager

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Description copied from interface: Manager
At a minimum, subclasses must notify of changes to the list of available NamedBeans; they may have other properties that will also notify.

Specified by:
addPropertyChangeListener in interface Manager

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Description copied from interface: Manager
At a minimum, subclasses must notify of changes to the list of available NamedBeans; they may have other properties that will also notify.

Specified by:
removePropertyChangeListener in interface Manager

firePropertyChange

protected void firePropertyChange(String p,
                                  Object old,
                                  Object n)

register

public void register(NamedBean n)
Description copied from interface: Manager
Remember a NamedBean Object created outside the manager.

The non-system-specific SignalHeadManagers use this method extensively.

Specified by:
register in interface Manager

deregister

public void deregister(NamedBean n)
Description copied from interface: Manager
Forget a NamedBean Object created outside the manager.

The non-system-specific RouteManager uses this method.

Specified by:
deregister in interface Manager

getSignalLogicDelay

public long getSignalLogicDelay()
Specified by:
getSignalLogicDelay in interface SignalMastLogicManager

setSignalLogicDelay

public void setSignalLogicDelay(long l)
Specified by:
setSignalLogicDelay in interface SignalMastLogicManager

discoverSignallingDest

public void discoverSignallingDest(SignalMast source,
                                   LayoutEditor layout)
                            throws JmriException
Discover valid destination signalmasts for a given source signal on a given layout editor panel.

Specified by:
discoverSignallingDest in interface SignalMastLogicManager
Parameters:
source - Source SignalMast
layout - Layout Editor panel to check.
Throws:
JmriException

automaticallyDiscoverSignallingPairs

public void automaticallyDiscoverSignallingPairs()
                                          throws JmriException
Discover all possible valid source and destination signalmasts past pairs on all layout editor panels.

Specified by:
automaticallyDiscoverSignallingPairs in interface SignalMastLogicManager
Throws:
JmriException

generateSection

public void generateSection()


Copyright © 1997-2013 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads