|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.managers.AbstractManager
jmri.NamedBeanHandleManager
public class NamedBeanHandleManager
Instance for controlling the issuing of NamedBeanHandles.
This Manager will only issue out one NamedBeanHandle per Bean/Name request. The Manager also deals with updates and changes to the names of Beans, along with moving usernames between different beans.
If a beans username is changed by the user, then the name will be updated in the NamedBeanHandle. If a username is moved from one bean to another, then the bean reference will be updated and the propertyChangeListener attached to that bean will also be moved, so long as the correct method of adding the listener has been used.
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 |
|---|
| Fields inherited from class jmri.managers.AbstractManager |
|---|
_tsys, _tuser |
| Fields inherited from interface jmri.Manager |
|---|
AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXS, MEMORIES, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS |
| Constructor Summary | |
|---|---|
NamedBeanHandleManager()
|
|
| Method Summary | ||
|---|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
At a minimum, subclasses must notify of changes to the list of available NamedBeans; they may have other properties that will also notify. |
|
void |
deregister(NamedBean n)
Forget a NamedBean Object created outside the manager. |
|
void |
dispose()
Free resources when no longer used. |
|
protected void |
firePropertyChange(String p,
Object old,
Object n)
|
|
|
getNamedBeanHandle(String name,
T bean)
|
|
String[] |
getSystemNameArray()
|
|
List<String> |
getSystemNameList()
|
|
String |
getSystemPrefix()
Provides access to the system prefix string. |
|
int |
getXMLOrder()
|
|
|
inUse(String name,
T bean)
|
|
String |
makeSystemName(String s)
|
|
|
moveBean(T oldBean,
T newBean,
String name)
A method to effectivily move a name from one bean to another. |
|
|
newNamedBeanHandle(String name,
T bean,
Class<T> type)
|
|
void |
register(NamedBean n)
Remember a NamedBean Object created outside the manager. |
|
protected void |
registerSelf()
Don't want to store this information |
|
void |
removePropertyChangeListener(PropertyChangeListener l)
At a minimum, subclasses must notify of changes to the list of available NamedBeans; they may have other properties that will also notify. |
|
|
renameBean(String oldName,
String newName,
T bean)
A Method to update the name on a bean. |
|
char |
systemLetter()
Provide access to deprecated method temporarilly |
|
char |
typeLetter()
|
|
void |
updateBeanFromSystemToUser(NamedBean bean)
|
|
void |
updateBeanFromUserToSystem(NamedBean bean)
|
|
| Methods inherited from class jmri.managers.AbstractManager |
|---|
getBeanBySystemName, getInstanceBySystemName, getInstanceByUserName, propertyChange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NamedBeanHandleManager()
| Method Detail |
|---|
public <T> NamedBeanHandle<T> getNamedBeanHandle(String name,
T bean)
public <T> void renameBean(String oldName,
String newName,
T bean)
public <T> void moveBean(T oldBean,
T newBean,
String name)
public void updateBeanFromUserToSystem(NamedBean bean)
public void updateBeanFromSystemToUser(NamedBean bean)
throws JmriException
JmriException
public <T> boolean inUse(String name,
T bean)
public <T> NamedBeanHandle<T> newNamedBeanHandle(String name,
T bean,
Class<T> type)
public void dispose()
Manager
dispose in interface Managerdispose in class AbstractManagerprotected void registerSelf()
registerSelf in class AbstractManagerpublic char systemLetter()
AbstractManager
systemLetter in interface ManagersystemLetter in class AbstractManagerpublic String getSystemPrefix()
Manager
getSystemPrefix in interface Managerpublic char typeLetter()
typeLetter in interface Managerpublic String makeSystemName(String s)
makeSystemName in interface ManagermakeSystemName in class AbstractManagerpublic String[] getSystemNameArray()
getSystemNameArray in interface ManagergetSystemNameArray in class AbstractManagerpublic List<String> getSystemNameList()
getSystemNameList in interface ManagergetSystemNameList in class AbstractManagerpublic void addPropertyChangeListener(PropertyChangeListener l)
Manager
addPropertyChangeListener in interface ManageraddPropertyChangeListener in class AbstractManagerpublic void removePropertyChangeListener(PropertyChangeListener l)
Manager
removePropertyChangeListener in interface ManagerremovePropertyChangeListener in class AbstractManager
protected void firePropertyChange(String p,
Object old,
Object n)
firePropertyChange in class AbstractManagerpublic void register(NamedBean n)
AbstractManagerThe non-system-specific SignalHeadManagers use this method extensively.
register in interface Managerregister in class AbstractManagerpublic void deregister(NamedBean n)
AbstractManagerThe non-system-specific RouteManager uses this method.
deregister in interface Managerderegister in class AbstractManagerpublic int getXMLOrder()
getXMLOrder in interface ManagergetXMLOrder in class AbstractManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||