jmri
Class SectionManager

java.lang.Object
  extended by jmri.implementation.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.

Author:
Dave Duchamp Copyright (C) 2008

Field Summary
 
Fields inherited from class jmri.implementation.AbstractManager
_tsys, _tuser
 
Constructor Summary
SectionManager()
           
 
Method Summary
 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.
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 systemLetter()
           
 char typeLetter()
           
 int validateAllSections(JmriJFrame frame, LayoutEditor lePanel)
          Validates all Sections
 
Methods inherited from class jmri.implementation.AbstractManager
addPropertyChangeListener, deregister, dispose, firePropertyChange, getInstanceBySystemName, getInstanceByUserName, getSystemNameArray, getSystemNameList, makeSystemName, propertyChange, register, registerSelf, removePropertyChangeListener
 
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
 

Constructor Detail

SectionManager

public SectionManager()
Method Detail

systemLetter

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

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.


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


instance

public static SectionManager instance()


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