jmri.jmrix.powerline
Class SerialLightManager

java.lang.Object
  extended by jmri.managers.AbstractManager
      extended by jmri.managers.AbstractLightManager
          extended by jmri.jmrix.powerline.SerialLightManager
All Implemented Interfaces:
PropertyChangeListener, Serializable, EventListener, LightManager, Manager
Direct Known Subclasses:
SpecificLightManager, SpecificLightManager, SpecificLightManager, SpecificLightManager

public abstract class SerialLightManager
extends AbstractLightManager

Implement light manager for powerline serial systems

System names are "PLnnn", where nnn is the bit number without padding.

Author:
Dave Duchamp Copyright (C) 2004, Bob Jacobsen Copyright (C) 2006, 2007, 2008 Converted to multiple connection, kcameron Copyright (C) 2011
See Also:
Serialized Form

Field Summary
 
Fields inherited from class jmri.managers.AbstractManager
_tsys, _tuser
 
Fields inherited from interface jmri.Manager
AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXS, MEMORIES, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
 
Constructor Summary
SerialLightManager(SerialTrafficController tc)
           
 
Method Summary
 Light createNewLight(String systemName, String userName)
          Method to create a new Light based on the system name Returns null if the system name is not in a valid format Assumes calling method has checked that a Light with this system name does not already exist
protected abstract  Light createNewSpecificLight(String systemName, String userName)
          Create light of a specific type for the interface
 String getSystemPrefix()
          Returns the system letter
 String normalizeSystemName(String systemName)
          Public method to normalize a system name Returns a normalized system name if system name has a valid format, else returns "".
 boolean supportsVariableLights(String systemName)
          Returns 'true' to indicate this system can support variable lights
 boolean validSystemNameConfig(String systemName)
          Public method to validate system name for configuration returns 'true' if system name has a valid meaning in current configuration, else returns 'false'
 boolean validSystemNameFormat(String systemName)
          Public method to validate system name format returns 'true' if system name has a valid format, else returns 'false'
 
Methods inherited from class jmri.managers.AbstractLightManager
activateAllLights, allowMultipleAdditions, convertSystemNameToAlternate, getBySystemName, getByUserName, getLight, getXMLOrder, newLight, provideLight, typeLetter
 
Methods inherited from class jmri.managers.AbstractManager
addPropertyChangeListener, deregister, dispose, firePropertyChange, getBeanBySystemName, getInstanceBySystemName, getInstanceByUserName, getSystemNameArray, getSystemNameList, makeSystemName, propertyChange, register, registerSelf, removePropertyChangeListener, systemLetter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.LightManager
dispose, getSystemNameList
 
Methods inherited from interface jmri.Manager
addPropertyChangeListener, deregister, getBeanBySystemName, getSystemNameArray, makeSystemName, register, removePropertyChangeListener, systemLetter
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Constructor Detail

SerialLightManager

public SerialLightManager(SerialTrafficController tc)
Method Detail

getSystemPrefix

public String getSystemPrefix()
Returns the system letter


createNewLight

public Light createNewLight(String systemName,
                            String userName)
Method to create a new Light based on the system name Returns null if the system name is not in a valid format Assumes calling method has checked that a Light with this system name does not already exist

Specified by:
createNewLight in class AbstractLightManager
Returns:
new null

createNewSpecificLight

protected abstract Light createNewSpecificLight(String systemName,
                                                String userName)
Create light of a specific type for the interface


validSystemNameFormat

public boolean validSystemNameFormat(String systemName)
Public method to validate system name format returns 'true' if system name has a valid format, else returns 'false'


validSystemNameConfig

public boolean validSystemNameConfig(String systemName)
Public method to validate system name for configuration returns 'true' if system name has a valid meaning in current configuration, else returns 'false'


normalizeSystemName

public String normalizeSystemName(String systemName)
Public method to normalize a system name

Returns a normalized system name if system name has a valid format, else returns "".

Specified by:
normalizeSystemName in interface LightManager
Overrides:
normalizeSystemName in class AbstractLightManager

supportsVariableLights

public boolean supportsVariableLights(String systemName)
Returns 'true' to indicate this system can support variable lights

Specified by:
supportsVariableLights in interface LightManager
Overrides:
supportsVariableLights in class AbstractLightManager


Copyright © 1997 - 2011 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