jmri
Class DefaultSignalHead

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

public abstract class DefaultSignalHead
extends AbstractSignalHead

Default implementation of the basic logic of the SignalHead interface.

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

Field Summary
protected  boolean mFlashOn
          Should a flashing signal be on (lit) now?
 
Fields inherited from class jmri.AbstractSignalHead
mAppearance, mHeld, mLit
 
Fields inherited from interface jmri.SignalHead
DARK, FLASHGREEN, FLASHRED, FLASHYELLOW, GREEN, RED, YELLOW
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
DefaultSignalHead(String systemName)
           
DefaultSignalHead(String systemName, String userName)
           
 
Method Summary
 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.AbstractSignalHead
getAppearance, getHeld, getLit, getState, setState
 
Methods inherited from class jmri.AbstractNamedBean
addPropertyChangeListener, dispose, firePropertyChange, getComment, getNumPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, 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, getNumPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, 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()


Copyright © 1997 - 2008 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: SourceForge_Logo