|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TurnoutManager
Locate a Turnout object representing some specific turnout on the layout.
Turnout objects are obtained from a TurnoutManager, which in turn is generally located from the InstanceManager. A typical call sequence might be:
Turnout turnout = InstanceManager.turnoutManagerInstance().provideTurnout("23");
Each turnout has a two names. The "user" name is entirely free form, and can be used for any purpose. The "system" name is provided by the system-specific implementations, and provides a unique mapping to the layout control system (e.g. LocoNet, NCE, etc) and address within that system.
Much of the book-keeping is implemented in the AbstractTurnoutManager class, which can form the basis for a system-specific implementation.
A sample use of the TurnoutManager interface can be seen in the jmri.jmrit.simpleturnoutctrl.SimpleTurnoutCtrlFrame class, which provides a simple GUI for controlling a single turnout.
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.
Turnout,
InstanceManager,
SimpleTurnoutCtrlFrame| Method Summary | |
|---|---|
int |
askControlType(String systemName)
Get from the user, the type of output to be used bits to control a turnout. |
int |
askNumControlBits(String systemName)
Get from the user, the number of addressed bits used to control a turnout. |
Turnout |
getBySystemName(String systemName)
Locate an instance based on a system name. |
Turnout |
getByUserName(String userName)
Locate an instance based on a user name. |
String |
getClosedText()
Get text to be used for the Turnout.CLOSED state in user communication. |
List<String> |
getSystemNameList()
Get a list of all Turnouts' system names. |
String |
getThrownText()
Get text to be used for the Turnout.THROWN state in user communication. |
Turnout |
getTurnout(String name)
Locate via user name, then system name if needed. |
String[] |
getValidOperationTypes()
Get a list of the valid TurnoutOPeration subtypes for use with turnouts of this system |
Turnout |
newTurnout(String systemName,
String userName)
Return an instance with the specified system and user names. |
Turnout |
provideTurnout(String name)
Locate via user name, then system name if needed. |
| Methods inherited from interface jmri.Manager |
|---|
addPropertyChangeListener, deregister, dispose, getSystemNameArray, makeSystemName, register, removePropertyChangeListener, systemLetter, typeLetter |
| Method Detail |
|---|
Turnout provideTurnout(String name)
name -
Turnout getTurnout(String name)
name -
Turnout getBySystemName(String systemName)
Turnout getByUserName(String userName)
Turnout newTurnout(String systemName,
String userName)
This will always return a valid object reference; a new object will be created if necessary. In that case:
List<String> getSystemNameList()
getSystemNameList in interface ManagerString getClosedText()
String getThrownText()
String[] getValidOperationTypes()
int askNumControlBits(String systemName)
int askControlType(String systemName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||