jmri.implementation
Class DefaultSignalHead

java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.AbstractSignalHead
          extended by jmri.implementation.DefaultSignalHead
All Implemented Interfaces:
Serializable, NamedBean, SignalHead
Direct Known Subclasses:
AcelaSignalHead, DoubleTurnoutSignalHead, LsDecSignalHead, MergSD2SignalHead, SE8cSignalHead, SE8cSignalHead, SerialSignalHead, VirtualSignalHead

public abstract class DefaultSignalHead
extends AbstractSignalHead

Default implementation of the basic logic of the SignalHead interface. This class only claims support for the Red, Yellow and Green appearances, and their corressponding flashing forms. Support for Lunar is deferred to DefaultLunarSignalHead.

Author:
Bob Jacobsen Copyright (C) 2001, 2009
See Also:
Serialized Form

Field Summary
protected  boolean mFlashOn
          Should a flashing signal be on (lit) now?
 
Fields inherited from class jmri.implementation.AbstractSignalHead
mAppearance, mHeld, mLit
 
Fields inherited from interface jmri.SignalHead
DARK, FLASHGREEN, FLASHLUNAR, FLASHRED, FLASHYELLOW, GREEN, LUNAR, RED, YELLOW
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
DefaultSignalHead(String systemName)
           
DefaultSignalHead(String systemName, String userName)
           
 
Method Summary
 String[] getValidStateNames()
           
 int[] getValidStates()
           
 void setAppearance(int newAppearance)
           
 void setHeld(boolean newHeld)
          Set the held parameter.
 void setLit(boolean newLit)
           
protected  void startFlash()
           
protected  void stopFlash()
           
protected abstract  void updateOutput()
          Type-specific routine to handle output to the layout hardware.
 
Methods inherited from class jmri.implementation.AbstractSignalHead
getAppearance, getAppearanceName, getAppearanceName, getDefaultStateName, getDefaultValidStateNames, getDefaultValidStates, getHeld, getLit, getState, setState
 
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, dispose, firePropertyChange, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, dispose, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName
 

Field Detail

mFlashOn

protected boolean mFlashOn
Should a flashing signal be on (lit) now?

Constructor Detail

DefaultSignalHead

public DefaultSignalHead(String systemName,
                         String userName)

DefaultSignalHead

public DefaultSignalHead(String systemName)
Method Detail

setAppearance

public void setAppearance(int newAppearance)

setLit

public void setLit(boolean newLit)

setHeld

public void setHeld(boolean newHeld)
Set the held parameter.

Note that this does not directly effect the output on the layout; the held parameter is a local variable which effects the aspect only via higher-level logic


updateOutput

protected abstract void updateOutput()
Type-specific routine to handle output to the layout hardware. Does not notify listeners of changes; that's done elsewhere. Should use the following variables to determine what to send:


startFlash

protected void startFlash()

stopFlash

protected void stopFlash()

getValidStates

public int[] getValidStates()
Specified by:
getValidStates in interface SignalHead
Overrides:
getValidStates in class AbstractSignalHead

getValidStateNames

public String[] getValidStateNames()
Specified by:
getValidStateNames in interface SignalHead
Overrides:
getValidStateNames in class AbstractSignalHead


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