Search in sources :

Example 1 with TripleTurnoutSignalHead

use of jmri.implementation.TripleTurnoutSignalHead in project JMRI by JMRI.

the class TripleTurnoutSignalHeadXml method store.

/**
     * Default implementation for storing the contents of a
     * TripleTurnoutSignalHead
     *
     * @param o Object to store, of type TripleTurnoutSignalHead
     * @return Element containing the complete info
     */
@Override
public Element store(Object o) {
    TripleTurnoutSignalHead p = (TripleTurnoutSignalHead) o;
    Element element = new Element("signalhead");
    element.setAttribute("class", this.getClass().getName());
    // include contents
    element.addContent(new Element("systemName").addContent(p.getSystemName()));
    storeCommon(p, element);
    element.addContent(addTurnoutElement(p.getGreen(), "green"));
    element.addContent(addTurnoutElement(p.getYellow(), "yellow"));
    element.addContent(addTurnoutElement(p.getRed(), "red"));
    return element;
}
Also used : TripleTurnoutSignalHead(jmri.implementation.TripleTurnoutSignalHead) Element(org.jdom2.Element)

Example 2 with TripleTurnoutSignalHead

use of jmri.implementation.TripleTurnoutSignalHead in project JMRI by JMRI.

the class TripleTurnoutSignalHeadXml method load.

@Override
public boolean load(Element shared, Element perNode) {
    List<Element> l = shared.getChildren("turnoutname");
    if (l.size() == 0) {
        l = shared.getChildren("turnout");
    }
    NamedBeanHandle<Turnout> green = loadTurnout(l.get(0));
    NamedBeanHandle<Turnout> yellow = loadTurnout(l.get(1));
    NamedBeanHandle<Turnout> red = loadTurnout(l.get(2));
    // put it together
    String sys = getSystemName(shared);
    String uname = getUserName(shared);
    SignalHead h;
    if (uname == null) {
        h = new TripleTurnoutSignalHead(sys, green, yellow, red);
    } else {
        h = new TripleTurnoutSignalHead(sys, uname, green, yellow, red);
    }
    loadCommon(h, shared);
    InstanceManager.getDefault(jmri.SignalHeadManager.class).register(h);
    return true;
}
Also used : TripleTurnoutSignalHead(jmri.implementation.TripleTurnoutSignalHead) Element(org.jdom2.Element) TripleTurnoutSignalHead(jmri.implementation.TripleTurnoutSignalHead) SignalHead(jmri.SignalHead) Turnout(jmri.Turnout)

Example 3 with TripleTurnoutSignalHead

use of jmri.implementation.TripleTurnoutSignalHead in project JMRI by JMRI.

the class SignalHeadTableAction method makeEditSignalWindow.

void makeEditSignalWindow() {
    // keep border and label names the same as in typeChanged() above
    String eSName = _curSignal.getSystemName();
    if (editingHead) {
        if (eSName.equals(editSysName)) {
            editFrame.setVisible(true);
        } else {
            log.error("Attempt to edit two signal heads at the same time-" + editSysName + "-and-" + eSName + "-");
            String msg = Bundle.getMessage("WarningEdit", new Object[] { editSysName, eSName });
            JOptionPane.showMessageDialog(editFrame, msg, Bundle.getMessage("WarningTitle"), JOptionPane.ERROR_MESSAGE);
            editFrame.setVisible(true);
            return;
        }
    }
    // not currently editing a signal head
    editSysName = eSName;
    editingHead = true;
    curS = InstanceManager.getDefault(jmri.SignalHeadManager.class).getBySystemName(editSysName);
    if (editFrame == null) {
        dccSignalPanelEdt();
        eto1 = new BeanSelectCreatePanel(InstanceManager.turnoutManagerInstance(), null);
        eto2 = new BeanSelectCreatePanel(InstanceManager.turnoutManagerInstance(), null);
        eto3 = new BeanSelectCreatePanel(InstanceManager.turnoutManagerInstance(), null);
        eto4 = new BeanSelectCreatePanel(InstanceManager.turnoutManagerInstance(), null);
        eto5 = new BeanSelectCreatePanel(InstanceManager.turnoutManagerInstance(), null);
        eto6 = new BeanSelectCreatePanel(InstanceManager.turnoutManagerInstance(), null);
        eto7 = new BeanSelectCreatePanel(InstanceManager.turnoutManagerInstance(), null);
        // set up a new edit window
        editFrame = new JmriJFrame(Bundle.getMessage("TitleEditSignalHead"), false, true);
        editFrame.addHelpMenu("package.jmri.jmrit.beantable.SignalAddEdit", true);
        editFrame.getContentPane().setLayout(new BorderLayout());
        JPanel panelHeader = new JPanel();
        panelHeader.setLayout(new BoxLayout(panelHeader, BoxLayout.Y_AXIS));
        JPanel p;
        p = new JPanel();
        p.setLayout(new FlowLayout());
        p.add(signalType);
        panelHeader.add(p);
        panelHeader.add(new JSeparator());
        p = new JPanel();
        p.setLayout(new FlowLayout());
        p.add(eSystemNameLabel);
        p.add(eSystemName);
        p.add(eSysNameLabel);
        p.add(dccOffSetAddressEdt);
        dccOffSetAddressEdt.setToolTipText(Bundle.getMessage("DccOffsetTooltip"));
        panelHeader.add(p);
        p = new JPanel();
        p.setLayout(new FlowLayout());
        p.add(eUserNameLabel);
        p.add(eUserName);
        panelHeader.add(p);
        editFrame.getContentPane().add(panelHeader, BorderLayout.PAGE_START);
        // create seven boxes for input information, and put into pane
        JPanel panelCentre = new JPanel();
        panelCentre.setLayout(new BoxLayout(panelCentre, BoxLayout.Y_AXIS));
        ev1Panel = new JPanel();
        ev1Panel.setLayout(defaultFlow);
        ev1Panel.add(eto1);
        ev1Panel.add(es1Box);
        ev1Panel.add(emsaBox);
        emsaBox.setToolTipText(Bundle.getMessage("SignalHeadMergTooltip"));
        ev1Panel.setBorder(ev1Border);
        panelCentre.add(ev1Panel);
        ev2Panel = new JPanel();
        ev2Panel.setLayout(defaultFlow);
        ev2Panel.add(eto2);
        ev2Panel.add(es2Box);
        ev2Panel.add(es2aBox);
        ev2Panel.add(emstBox);
        emstBox.setToolTipText(Bundle.getMessage("SignalHeadUseTooltip"));
        ev2Panel.add(dccSignalPanelEdt);
        ev2Panel.setBorder(ev2Border);
        panelCentre.add(ev2Panel);
        ev3Panel = new JPanel();
        ev3Panel.setLayout(defaultFlow);
        ev3Panel.add(eto3);
        ev3Panel.add(es3Box);
        ev3Panel.add(es3aBox);
        ev3Panel.setBorder(ev3Border);
        panelCentre.add(ev3Panel);
        ev4Panel = new JPanel();
        ev4Panel.setLayout(defaultFlow);
        ev4Panel.add(eto4);
        ev4Panel.add(es4Box);
        ev4Panel.setBorder(ev4Border);
        panelCentre.add(ev4Panel);
        ev5Panel = new JPanel();
        ev5Panel.setLayout(defaultFlow);
        ev5Panel.add(eto5);
        ev5Panel.add(es5Box);
        ev5Panel.setBorder(ev5Border);
        panelCentre.add(ev5Panel);
        ev6Panel = new JPanel();
        ev6Panel.setLayout(defaultFlow);
        ev6Panel.add(eto6);
        ev6Panel.add(es6Box);
        ev6Panel.setBorder(ev6Border);
        panelCentre.add(ev6Panel);
        ev7Panel = new JPanel();
        ev7Panel.setLayout(defaultFlow);
        ev7Panel.add(eto7);
        ev7Panel.add(es7Box);
        ev7Panel.setBorder(ev7Border);
        panelCentre.add(ev7Panel);
        p = new JPanel();
        p.setLayout(defaultFlow);
        p.add(evtLabel);
        p.add(etot);
        p.add(estBox);
        panelCentre.add(p);
        JScrollPane scrollPane = new JScrollPane(panelCentre);
        editFrame.getContentPane().add(scrollPane, BorderLayout.CENTER);
        JPanel panelBottom = new JPanel();
        panelBottom.setLayout(new BoxLayout(panelBottom, BoxLayout.Y_AXIS));
        // add buttons
        p = new JPanel();
        p.setLayout(new FlowLayout(FlowLayout.TRAILING));
        JButton cancel;
        p.add(cancel = new JButton(Bundle.getMessage("ButtonCancel")));
        cancel.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                cancelPressed(e);
            }
        });
        JButton update;
        p.add(update = new JButton(Bundle.getMessage("ButtonUpdate")));
        update.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                updatePressed(e);
            }
        });
        panelBottom.add(p);
        editFrame.getContentPane().add(panelBottom, BorderLayout.PAGE_END);
        editFrame.addWindowListener(new java.awt.event.WindowAdapter() {

            @Override
            public void windowClosing(java.awt.event.WindowEvent e) {
                cancelPressed(null);
            }
        });
    } else {
        eto1.refresh();
        eto2.refresh();
        eto3.refresh();
        eto4.refresh();
        eto5.refresh();
        eto6.refresh();
        eto7.refresh();
    }
    // default the seven optional items to hidden, and system name to visible
    eSystemName.setVisible(false);
    eSysNameLabel.setVisible(true);
    eUserNameLabel.setVisible(true);
    eUserName.setVisible(true);
    ev1Panel.setVisible(false);
    dccOffSetAddressEdt.setVisible(false);
    eto1.setVisible(false);
    es1Box.setVisible(false);
    ev2Panel.setVisible(false);
    eto2.setVisible(false);
    es2Box.setVisible(false);
    es2aBox.setVisible(false);
    dccSignalPanelEdt.setVisible(false);
    ev3Panel.setVisible(false);
    eto3.setVisible(false);
    es3Box.setVisible(false);
    es3aBox.setVisible(false);
    ev4Panel.setVisible(false);
    eto4.setVisible(false);
    es4Box.setVisible(false);
    ev5Panel.setVisible(false);
    eto5.setVisible(false);
    es5Box.setVisible(false);
    ev6Panel.setVisible(false);
    eto6.setVisible(false);
    es6Box.setVisible(false);
    ev7Panel.setVisible(false);
    eto7.setVisible(false);
    es7Box.setVisible(false);
    evtLabel.setVisible(false);
    etot.setVisible(false);
    estBox.setVisible(false);
    emstBox.setVisible(false);
    emsaBox.setVisible(false);
    // determine class name of signal head and initialize edit panel for this class of signal
    className = curS.getClass().getName();
    if (className.equals("jmri.implementation.QuadOutputSignalHead")) {
        signalType.setText(quadOutput);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
        ev1Border.setTitle(Bundle.getMessage("LabelGreenTurnoutNumber"));
        ev1Panel.setVisible(true);
        eto1.setVisible(true);
        et1 = ((TripleTurnoutSignalHead) curS).getGreen().getBean();
        eto1.setDefaultNamedBean(et1);
        ev2Border.setTitle(Bundle.getMessage("LabelYellowTurnoutNumber"));
        ev2Panel.setVisible(true);
        eto2.setVisible(true);
        eto2.setDefaultNamedBean(((TripleTurnoutSignalHead) curS).getYellow().getBean());
        ev3Border.setTitle(Bundle.getMessage("LabelRedTurnoutNumber"));
        ev3Panel.setVisible(true);
        eto3.setVisible(true);
        eto3.setDefaultNamedBean(((TripleTurnoutSignalHead) curS).getRed().getBean());
        ev4Border.setTitle(Bundle.getMessage("LabelLunarTurnoutNumber"));
        ev4Panel.setVisible(true);
        eto4.setVisible(true);
        eto4.setDefaultNamedBean(((QuadOutputSignalHead) curS).getLunar().getBean());
    } else if (className.equals("jmri.implementation.TripleTurnoutSignalHead")) {
        signalType.setText(tripleTurnout);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
        ev1Border.setTitle(Bundle.getMessage("LabelGreenTurnoutNumber"));
        ev1Panel.setVisible(true);
        eto1.setVisible(true);
        eto1.setDefaultNamedBean(((TripleTurnoutSignalHead) curS).getGreen().getBean());
        ev2Border.setTitle(Bundle.getMessage("LabelYellowTurnoutNumber"));
        ev2Panel.setVisible(true);
        eto2.setVisible(true);
        eto2.setDefaultNamedBean(((TripleTurnoutSignalHead) curS).getYellow().getBean());
        ev3Border.setTitle(Bundle.getMessage("LabelRedTurnoutNumber"));
        ev3Panel.setVisible(true);
        eto3.setVisible(true);
        eto3.setDefaultNamedBean(((TripleTurnoutSignalHead) curS).getRed().getBean());
    } else if (className.equals("jmri.implementation.TripleOutputSignalHead")) {
        signalType.setText(tripleOutput);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
        ev1Border.setTitle(Bundle.getMessage("LabelGreenTurnoutNumber"));
        ev1Panel.setVisible(true);
        eto1.setVisible(true);
        eto1.setDefaultNamedBean(((TripleOutputSignalHead) curS).getGreen().getBean());
        ev2Border.setTitle(Bundle.getMessage("LabelBlueTurnoutNumber"));
        ev2Panel.setVisible(true);
        eto2.setVisible(true);
        eto2.setDefaultNamedBean(((TripleOutputSignalHead) curS).getBlue().getBean());
        ev3Border.setTitle(Bundle.getMessage("LabelRedTurnoutNumber"));
        ev3Panel.setVisible(true);
        eto3.setVisible(true);
        eto3.setDefaultNamedBean(((TripleOutputSignalHead) curS).getRed().getBean());
    } else if (className.equals("jmri.implementation.DoubleTurnoutSignalHead")) {
        signalType.setText(doubleTurnout);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
        ev1Border.setTitle(Bundle.getMessage("LabelGreenTurnoutNumber"));
        ev1Panel.setVisible(true);
        eto1.setVisible(true);
        eto1.setDefaultNamedBean(((DoubleTurnoutSignalHead) curS).getGreen().getBean());
        ev2Border.setTitle(Bundle.getMessage("LabelRedTurnoutNumber"));
        ev2Panel.setVisible(true);
        eto2.setVisible(true);
        eto2.setDefaultNamedBean(((DoubleTurnoutSignalHead) curS).getRed().getBean());
    } else if (className.equals("jmri.implementation.SingleTurnoutSignalHead")) {
        signalType.setText(singleTurnout);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
        ev1Border.setTitle(Bundle.getMessage("LabelTurnoutNumber"));
        ev1Panel.setVisible(true);
        eto1.setVisible(true);
        eto1.setDefaultNamedBean(((SingleTurnoutSignalHead) curS).getOutput().getBean());
        ev2Border.setTitle(Bundle.getMessage("LabelTurnoutClosedAppearance"));
        ev2Panel.setVisible(true);
        es2aBox.setVisible(true);
        setSignalStateInBox(es2aBox, ((SingleTurnoutSignalHead) curS).getOnAppearance());
        ev3Border.setTitle(Bundle.getMessage("LabelTurnoutThrownAppearance"));
        ev3Panel.setVisible(true);
        es3aBox.setVisible(true);
        setSignalStateInBox(es3aBox, ((SingleTurnoutSignalHead) curS).getOffAppearance());
    } else if (className.equals("jmri.implementation.VirtualSignalHead")) {
        signalType.setText(virtualHead);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
    } else if (className.equals("jmri.implementation.LsDecSignalHead")) {
        // LDT LS-DEC
        signalType.setText(lsDec);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
        ev1Border.setTitle(Bundle.getMessage("LabelGreenTurnoutNumber"));
        ev1Panel.setVisible(true);
        eto1.setVisible(true);
        eto1.setDefaultNamedBean(((jmri.implementation.LsDecSignalHead) curS).getGreen().getBean());
        es1Box.setVisible(true);
        setTurnoutStateInBox(es1Box, ((jmri.implementation.LsDecSignalHead) curS).getGreenState(), turnoutStateValues);
        ev2Border.setTitle(Bundle.getMessage("LabelYellowTurnoutNumber"));
        ev2Panel.setVisible(true);
        eto2.setVisible(true);
        eto2.setDefaultNamedBean(((jmri.implementation.LsDecSignalHead) curS).getYellow().getBean());
        es2Box.setVisible(true);
        setTurnoutStateInBox(es2Box, ((jmri.implementation.LsDecSignalHead) curS).getYellowState(), turnoutStateValues);
        ev3Border.setTitle(Bundle.getMessage("LabelRedTurnoutNumber"));
        ev3Panel.setVisible(true);
        eto3.setVisible(true);
        eto3.setDefaultNamedBean(((jmri.implementation.LsDecSignalHead) curS).getRed().getBean());
        es3Box.setVisible(true);
        setTurnoutStateInBox(es3Box, ((jmri.implementation.LsDecSignalHead) curS).getRedState(), turnoutStateValues);
        ev4Border.setTitle(Bundle.getMessage("LabelFlashGreenTurnoutNumber"));
        ev4Panel.setVisible(true);
        eto4.setVisible(true);
        eto4.setDefaultNamedBean(((jmri.implementation.LsDecSignalHead) curS).getFlashGreen().getBean());
        es4Box.setVisible(true);
        setTurnoutStateInBox(es4Box, ((jmri.implementation.LsDecSignalHead) curS).getFlashGreenState(), turnoutStateValues);
        ev5Border.setTitle(Bundle.getMessage("LabelFlashYellowTurnoutNumber"));
        ev5Panel.setVisible(true);
        eto5.setVisible(true);
        eto5.setDefaultNamedBean(((jmri.implementation.LsDecSignalHead) curS).getFlashYellow().getBean());
        es5Box.setVisible(true);
        setTurnoutStateInBox(es5Box, ((jmri.implementation.LsDecSignalHead) curS).getFlashYellowState(), turnoutStateValues);
        ev6Border.setTitle(Bundle.getMessage("LabelFlashRedTurnoutNumber"));
        ev6Panel.setVisible(true);
        eto6.setVisible(true);
        eto6.setDefaultNamedBean(((jmri.implementation.LsDecSignalHead) curS).getFlashRed().getBean());
        es6Box.setVisible(true);
        setTurnoutStateInBox(es6Box, ((jmri.implementation.LsDecSignalHead) curS).getFlashRedState(), turnoutStateValues);
        ev7Border.setTitle(Bundle.getMessage("LabelDarkTurnoutNumber"));
        ev7Panel.setVisible(true);
        eto7.setVisible(true);
        eto7.setDefaultNamedBean(((jmri.implementation.LsDecSignalHead) curS).getDark().getBean());
        es7Box.setVisible(true);
        setTurnoutStateInBox(es7Box, ((jmri.implementation.LsDecSignalHead) curS).getDarkState(), turnoutStateValues);
    } else if (className.equals("jmri.implementation.SE8cSignalHead")) {
        handleSE8cEditSignal();
    } else if (className.equals("jmri.jmrix.grapevine.SerialSignalHead")) {
        signalType.setText(grapevine);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
    /*ev1Border.setTitle(Bundle.getMessage("LabelUserName"));
             ev1Panel.setVisible(true);
             eto1.setVisible(true);
             eto1.setText(curS.getUserName());*/
    } else if (className.equals("jmri.jmrix.acela.AcelaSignalHead")) {
        signalType.setText(acela);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
        /*ev1Border.setTitle(Bundle.getMessage("LabelUserName"));
             ev1Panel.setVisible(true);
             eto1.setVisible(true);
             eto1.setText(curS.getUserName());*/
        evtLabel.setText(Bundle.getMessage("LabelAspectType") + ":");
        etot.setVisible(false);
        AcelaNode tNode = AcelaAddress.getNodeFromSystemName(curS.getSystemName(), jmri.InstanceManager.getDefault(jmri.jmrix.acela.AcelaSystemConnectionMemo.class));
        if (tNode == null) {
            // node does not exist, ignore call
            log.error("Can't find new Acela Signal with name '" + curS.getSystemName());
            return;
        }
        int headnumber = Integer.parseInt(curS.getSystemName().substring(2, curS.getSystemName().length()));
        estBox.setVisible(true);
        setSignalheadTypeInBox(estBox, tNode.getOutputSignalHeadType(headnumber), signalheadTypeValues);
    } else if (className.equals("jmri.implementation.DccSignalHead")) {
        signalType.setText(dccSignalDecoder);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
        for (int i = 0; i < DccSignalHead.getDefaultValidStates().length; i++) {
            JSpinner tmp = dccAspectEdt[i];
            tmp.setValue(((DccSignalHead) curS).getOutputForAppearance(curS.getValidStates()[i]));
        //  tmp.setValue((Integer) DccSignalHead.getDefaultNumberForApperance(DccSignalHead.getDefaultValidStates()[i]))
        }
        dccOffSetAddressEdt.setVisible(true);
        dccOffSetAddressEdt.setSelected(((DccSignalHead) curS).useAddressOffSet());
        ev2Border.setTitle(Bundle.getMessage("LabelAspectNumbering"));
        ev2Panel.setVisible(true);
        dccSignalPanelEdt.setVisible(true);
    } else if (className.equals("jmri.implementation.MergSD2SignalHead")) {
        //Edit signal stuff to go here!
        signalType.setText(mergSignalDriver);
        eSystemNameLabel.setText(Bundle.getMessage("LabelSystemName"));
        eSysNameLabel.setText(curS.getSystemName());
        eUserNameLabel.setText(Bundle.getMessage("LabelUserName"));
        eUserName.setText(curS.getUserName());
        // same as line 1054
        ev1Border.setTitle(Bundle.getMessage("NumberOfAppearances"));
        ev1Panel.setVisible(true);
        setUkSignalAspectsFromBox(emsaBox, ((jmri.implementation.MergSD2SignalHead) curS).getAspects());
        eto1.setVisible(false);
        emsaBox.setVisible(true);
        //            emsaBox.setToolTipText(Bundle.getMessage("SignalHeadMergTooltip"));
        // same as line 1090
        ev2Border.setTitle(Bundle.getMessage("UseAs"));
        ev2Panel.setVisible(true);
        eto2.setVisible(false);
        emstBox.setVisible(true);
        if (((jmri.implementation.MergSD2SignalHead) curS).getHome()) {
            // "Home"
            setUkSignalType(emstBox, Bundle.getMessage("HomeSignal"));
        } else {
            //"Distant"
            setUkSignalType(emstBox, Bundle.getMessage("DistantSignal"));
        }
        //setUKSignalTypeFromBox(emstBox, ((jmri.implementation.MergSD2SignalHead)curS).getAspects());
        ev3Border.setTitle(Bundle.getMessage("InputNum", " 1 "));
        ev3Panel.setVisible(true);
        eto3.setVisible(true);
        eto3.setDefaultNamedBean(((jmri.implementation.MergSD2SignalHead) curS).getInput1().getBean());
        ev4Border.setTitle(Bundle.getMessage("InputNum", " 2 "));
        ev4Panel.setVisible(true);
        eto4.setVisible(true);
        if (((jmri.implementation.MergSD2SignalHead) curS).getInput2() != null) {
            eto4.setDefaultNamedBean(((jmri.implementation.MergSD2SignalHead) curS).getInput2().getBean());
        }
        ev5Border.setTitle(Bundle.getMessage("InputNum", " 3 "));
        ev5Panel.setVisible(true);
        eto5.setVisible(true);
        if (((jmri.implementation.MergSD2SignalHead) curS).getInput3() != null) {
            eto5.setDefaultNamedBean(((jmri.implementation.MergSD2SignalHead) curS).getInput3().getBean());
        }
        emsaBox.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                ukAspectChange(true);
            }
        });
        ukAspectChange(true);
    } else {
        log.error("Cannot edit SignalHead of unrecognized type: " + className);
    }
    // finish up
    editFrame.pack();
    editFrame.setVisible(true);
}
Also used : JPanel(javax.swing.JPanel) TripleTurnoutSignalHead(jmri.implementation.TripleTurnoutSignalHead) FlowLayout(java.awt.FlowLayout) ActionEvent(java.awt.event.ActionEvent) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) TripleOutputSignalHead(jmri.implementation.TripleOutputSignalHead) JSeparator(javax.swing.JSeparator) BorderLayout(java.awt.BorderLayout) BeanSelectCreatePanel(jmri.util.swing.BeanSelectCreatePanel) JScrollPane(javax.swing.JScrollPane) AcelaNode(jmri.jmrix.acela.AcelaNode) SingleTurnoutSignalHead(jmri.implementation.SingleTurnoutSignalHead) ActionListener(java.awt.event.ActionListener) JmriJFrame(jmri.util.JmriJFrame) QuadOutputSignalHead(jmri.implementation.QuadOutputSignalHead) JSpinner(javax.swing.JSpinner)

Aggregations

TripleTurnoutSignalHead (jmri.implementation.TripleTurnoutSignalHead)3 Element (org.jdom2.Element)2 BorderLayout (java.awt.BorderLayout)1 FlowLayout (java.awt.FlowLayout)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 BoxLayout (javax.swing.BoxLayout)1 JButton (javax.swing.JButton)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 JSeparator (javax.swing.JSeparator)1 JSpinner (javax.swing.JSpinner)1 SignalHead (jmri.SignalHead)1 Turnout (jmri.Turnout)1 QuadOutputSignalHead (jmri.implementation.QuadOutputSignalHead)1 SingleTurnoutSignalHead (jmri.implementation.SingleTurnoutSignalHead)1 TripleOutputSignalHead (jmri.implementation.TripleOutputSignalHead)1 AcelaNode (jmri.jmrix.acela.AcelaNode)1 JmriJFrame (jmri.util.JmriJFrame)1 BeanSelectCreatePanel (jmri.util.swing.BeanSelectCreatePanel)1