jmri
Class SectionManager

Show UML class diagram
java.lang.Object
  extended by jmri.managers.AbstractManager
      extended by jmri.SectionManager
All Implemented Interfaces:
PropertyChangeListener, EventListener, Manager

public class SectionManager
extends AbstractManager
implements PropertyChangeListener

Basic Implementation of a SectionManager.

This doesn't have a "new" interface, since Sections are independently implemented, instead of being system-specific.

Note that Section system names must begin with IY, and be followed by a string, usually, but not always, a number. All alphabetic characters in a Section system name must be upper case. This is enforced when a Section is created.


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 SectionManager _instance
           
(package private)  int lastAutoSectionRef
           
(package private) static org.slf4j.Logger log
           
(package private)  DecimalFormat paddedNumber
           
 
Fields inherited from class jmri.managers.AbstractManager
_tsys, _tuser
 
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
SectionManager()
           
 
Method Summary
 Section createNewSection(String userName)
           
 Section createNewSection(String systemName, String userName)
          Method to create a new Section if the Section does not exist Returns null if a Section with the same systemName or userName already exists, or if there is trouble creating a new Section.
 void deleteSection(Section y)
          Remove an existing Section
 Section getBySystemName(String name)
           
 Section getByUserName(String key)
           
 Section getSection(String name)
          Method to get an existing Section.
 String getSystemPrefix()
          Provides access to the system prefix string.
 int getXMLOrder()
           
 void initializeBlockingSensors()
          Initialize all blocking sensors that exist - sets them to 'ACTIVE'
static SectionManager instance()
           
 int removeDirectionSensorsFromSSL(LayoutEditor lePanel)
          Removes direction sensors from SSL for all signals.
 int setupDirectionSensors(LayoutEditor lePanel)
          Checks direction sensors in SSL for signals.
 char typeLetter()
           
 int validateAllSections(JmriJFrame frame, LayoutEditor lePanel)
          Validates all Sections
 
Methods inherited from class jmri.managers.AbstractManager
addPropertyChangeListener, deregister, dispose, firePropertyChange, getBeanBySystemName, getBeanByUserName, getInstanceBySystemName, getInstanceByUserName, getNamedBean, getNamedBeanList, 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 java.beans.PropertyChangeListener
propertyChange
 

Field Detail

paddedNumber

DecimalFormat paddedNumber

lastAutoSectionRef

int lastAutoSectionRef

_instance

static SectionManager _instance

log

static org.slf4j.Logger log
Constructor Detail

SectionManager

public SectionManager()
Method Detail

getXMLOrder

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

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

createNewSection

public Section createNewSection(String systemName,
                                String userName)
Method to create a new Section if the Section does not exist Returns null if a Section with the same systemName or userName already exists, or if there is trouble creating a new Section.


createNewSection

public Section createNewSection(String userName)

deleteSection

public void deleteSection(Section y)
Remove an existing Section


getSection

public Section getSection(String name)
Method to get an existing Section. First looks up assuming that name is a User Name. If this fails looks up assuming that name is a System Name. If both fail, returns null.


getBySystemName

public Section getBySystemName(String name)

getByUserName

public Section getByUserName(String key)

validateAllSections

public int validateAllSections(JmriJFrame frame,
                               LayoutEditor lePanel)
Validates all Sections


setupDirectionSensors

public int setupDirectionSensors(LayoutEditor lePanel)
Checks direction sensors in SSL for signals. Returns '0' for no errors Returns n, where n is a positive number for number of errors or warnings Returns -1 if there is no LayoutEditor panel Returns -2 if there are no Sections defined


removeDirectionSensorsFromSSL

public int removeDirectionSensorsFromSSL(LayoutEditor lePanel)
Removes direction sensors from SSL for all signals. Returns '0' for no errors Returns n, where n is a positive number for number of errors or warnings Returns -1 if there is no LayoutEditor panel Returns -2 if there are no Sections defined


initializeBlockingSensors

public void initializeBlockingSensors()
Initialize all blocking sensors that exist - sets them to 'ACTIVE'


instance

public static SectionManager instance()


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