use of jmri.jmrix.ecos.EcosSystemConnectionMemo in project JMRI by JMRI.
the class EcosLocoTableTabAction method createModel.
@Override
protected void createModel() {
dataPanel = new JPanel();
dataTabs = new JTabbedPane();
dataPanel.setLayout(new BorderLayout());
java.util.List<EcosSystemConnectionMemo> list = jmri.InstanceManager.getList(EcosSystemConnectionMemo.class);
if (list != null) {
for (EcosSystemConnectionMemo eMemo : list) {
//We only want to add connections that have an active loco address manager
if (eMemo.getLocoAddressManager() != null) {
TabbedTableItem itemModel = new TabbedTableItem(eMemo.getUserName(), true, eMemo.getLocoAddressManager(), getNewTableAction(eMemo.getUserName(), eMemo));
tabbedTableArray.add(itemModel);
}
}
}
if (tabbedTableArray.size() == 1) {
EcosLocoTableAction table = (EcosLocoTableAction) tabbedTableArray.get(0).getAAClass();
table.addToPanel(this);
dataPanel.add(tabbedTableArray.get(0).getPanel(), BorderLayout.CENTER);
} else {
for (int x = 0; x < tabbedTableArray.size(); x++) {
EcosLocoTableAction table = (EcosLocoTableAction) tabbedTableArray.get(x).getAAClass();
table.addToPanel(this);
dataTabs.addTab(tabbedTableArray.get(x).getItemString(), null, tabbedTableArray.get(x).getPanel(), null);
}
dataTabs.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent evt) {
setMenuBar(f);
}
});
dataPanel.add(dataTabs, BorderLayout.CENTER);
}
init = true;
}
use of jmri.jmrix.ecos.EcosSystemConnectionMemo in project JMRI by JMRI.
the class EcosLocoToRosterTest method testCTor.
@Test
public void testCTor() {
EcosTrafficController tc = new EcosInterfaceScaffold();
EcosSystemConnectionMemo memo = new EcosSystemConnectionMemo(tc);
EcosLocoToRoster t = new EcosLocoToRoster(memo);
Assert.assertNotNull("exists", t);
}
Aggregations