use of jmri.managers.AbstractSignalHeadManager in project JMRI by JMRI.
the class AbstractSignalHeadManagerXml method replaceSignalHeadManager.
/**
* Replace the current signal head manager, if there is one, with one newly
* created during a load operation. This is skipped if they are of the same
* absolute type.
*/
protected void replaceSignalHeadManager() {
if (InstanceManager.getDefault(jmri.SignalHeadManager.class).getClass().getName().equals(AbstractSignalHeadManager.class.getName())) {
return;
}
// if old manager exists, remove it from configuration process
if (InstanceManager.getNullableDefault(jmri.SignalHeadManager.class) != null) {
InstanceManager.getDefault(jmri.ConfigureManager.class).deregister(InstanceManager.getDefault(jmri.SignalHeadManager.class));
}
// register new one with InstanceManager
AbstractSignalHeadManager pManager = new AbstractSignalHeadManager();
InstanceManager.setSignalHeadManager(pManager);
// register new one for configuration
ConfigureManager cm = InstanceManager.getNullableDefault(jmri.ConfigureManager.class);
if (cm != null) {
cm.registerConfig(pManager, jmri.Manager.SIGNALHEADS);
}
}
use of jmri.managers.AbstractSignalHeadManager in project JMRI by JMRI.
the class JUnitUtil method initInternalSignalHeadManager.
public static void initInternalSignalHeadManager() {
SignalHeadManager m = new AbstractSignalHeadManager();
InstanceManager.setSignalHeadManager(m);
if (InstanceManager.getNullableDefault(ConfigureManager.class) != null) {
InstanceManager.getDefault(ConfigureManager.class).registerConfig(m, jmri.Manager.SIGNALHEADS);
}
}
Aggregations