Search in sources :

Example 11 with OBlockManager

use of jmri.jmrit.logix.OBlockManager in project JMRI by JMRI.

the class CircuitBuilder method makeMenu.

/**
     * Makes menu for ControlPanelEditor Called by ControlPanelEditor at init
     * before contents have been loaded
     */
protected JMenu makeMenu() {
    if (_circuitMenu == null) {
        _circuitMenu = new JMenu(Bundle.getMessage("CircuitBuilder"));
        _circuitMap = new HashMap<OBlock, ArrayList<Positionable>>();
        OBlockManager manager = InstanceManager.getDefault(jmri.jmrit.logix.OBlockManager.class);
        String[] sysNames = manager.getSystemNameArray();
        for (int i = 0; i < sysNames.length; i++) {
            OBlock block = manager.getBySystemName(sysNames[i]);
            _circuitMap.put(block, new ArrayList<Positionable>());
        }
    }
    makeCircuitMenu();
    return _circuitMenu;
}
Also used : ArrayList(java.util.ArrayList) OBlockManager(jmri.jmrit.logix.OBlockManager) Positionable(jmri.jmrit.display.Positionable) OBlock(jmri.jmrit.logix.OBlock) JMenu(javax.swing.JMenu)

Example 12 with OBlockManager

use of jmri.jmrit.logix.OBlockManager in project JMRI by JMRI.

the class CircuitBuilder method errorCheck.

private void errorCheck() {
    WarrantTableAction.initPathPortalCheck();
    OBlockManager manager = InstanceManager.getDefault(jmri.jmrit.logix.OBlockManager.class);
    String[] sysNames = manager.getSystemNameArray();
    for (int i = 0; i < sysNames.length; i++) {
        WarrantTableAction.checkPathPortals(manager.getBySystemName(sysNames[i]));
    }
    if (!WarrantTableAction.showPathPortalErrors()) {
        JOptionPane.showMessageDialog(_editCircuitFrame, Bundle.getMessage("blocksEtcOK"), Bundle.getMessage("ButtonOK"), javax.swing.JOptionPane.INFORMATION_MESSAGE);
    }
}
Also used : OBlockManager(jmri.jmrit.logix.OBlockManager)

Aggregations

OBlockManager (jmri.jmrit.logix.OBlockManager)12 OBlock (jmri.jmrit.logix.OBlock)8 Portal (jmri.jmrit.logix.Portal)4 Point (java.awt.Point)3 ArrayList (java.util.ArrayList)3 JMenu (javax.swing.JMenu)2 NamedBean (jmri.NamedBean)2 Path (jmri.Path)2 Positionable (jmri.jmrit.display.Positionable)2 OPath (jmri.jmrit.logix.OPath)2 Element (org.jdom2.Element)2 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 PropertyVetoException (java.beans.PropertyVetoException)1 ParseException (java.text.ParseException)1 Iterator (java.util.Iterator)1 Entry (java.util.Map.Entry)1 JMenuItem (javax.swing.JMenuItem)1 Editor (jmri.jmrit.display.Editor)1 IndicatorTrack (jmri.jmrit.display.IndicatorTrack)1