Search in sources :

Example 96 with JmriJFrame

use of jmri.util.JmriJFrame in project JMRI by JMRI.

the class SwitchboardEditor method connectNew.

/**
     * Create new bean and connect it to this switch.
     * Use type letter from switch label (S, T or L).
     */
protected void connectNew(String systemName) {
    log.debug("Request new bean");
    sysName.setText(systemName);
    userName.setText("");
    // provide etc.
    if (addFrame == null) {
        addFrame = new JmriJFrame(Bundle.getMessage("ConnectNewMenu", ""), false, true);
        addFrame.addHelpMenu("package.jmri.jmrit.display.switchboardEditor.SwitchboardEditor", true);
        addFrame.getContentPane().setLayout(new BoxLayout(addFrame.getContentPane(), BoxLayout.Y_AXIS));
        ActionListener okListener = (ActionEvent ev) -> {
            okAddPressed(ev);
        };
        ActionListener cancelListener = (ActionEvent ev) -> {
            cancelAddPressed(ev);
        };
        AddNewDevicePanel switchConnect = new AddNewDevicePanel(sysName, userName, "ButtonOK", okListener, cancelListener);
        // prevent user interference with switch label
        switchConnect.setSystemNameFieldIneditable();
        // activate OK button on Add new device pane
        switchConnect.setOK();
        addFrame.add(switchConnect);
    }
    addFrame.pack();
    addFrame.setVisible(true);
}
Also used : ActionListener(java.awt.event.ActionListener) JmriJFrame(jmri.util.JmriJFrame) ActionEvent(java.awt.event.ActionEvent) BoxLayout(javax.swing.BoxLayout) AddNewDevicePanel(jmri.jmrit.beantable.AddNewDevicePanel)

Example 97 with JmriJFrame

use of jmri.util.JmriJFrame in project JMRI by JMRI.

the class SwitchboardEditor method makeFrame.

/**
     * Create sequence of panels, etc. for layout: JFrame contains its
     * ContentPane which contains a JPanel with BoxLayout (p1) which contains a
     * JScollPane (js) which contains the targetPane.
     *
     * @param name name for the Switchboard
     */
public JmriJFrame makeFrame(String name) {
    JmriJFrame targetFrame = new JmriJFrame(name);
    targetFrame.setVisible(true);
    JMenuBar menuBar = new JMenuBar();
    JMenu editMenu = new JMenu(Bundle.getMessage("MenuEdit"));
    menuBar.add(editMenu);
    editMenu.add(new AbstractAction(Bundle.getMessage("OpenEditor")) {

        @Override
        public void actionPerformed(ActionEvent e) {
            setVisible(true);
        }
    });
    targetFrame.setJMenuBar(menuBar);
    targetFrame.addHelpMenu("package.jmri.jmrit.display.SwitchboardEditor", true);
    return targetFrame;
}
Also used : JmriJFrame(jmri.util.JmriJFrame) ActionEvent(java.awt.event.ActionEvent) AbstractAction(javax.swing.AbstractAction) JMenuBar(javax.swing.JMenuBar) JMenu(javax.swing.JMenu)

Example 98 with JmriJFrame

use of jmri.util.JmriJFrame in project JMRI by JMRI.

the class DispatcherPro method main.

// Main entry point
public static void main(String[] args) {
    // show splash screen early
    splash(true);
    Apps.setStartupInfo("DispatcherPro");
    setConfigFilename("DispatcherProConfig2.xml", args);
    JmriJFrame f = new JmriJFrame("DispatcherPro");
    createFrame(new DispatcherPro(f), f);
    log.debug("main initialization done");
    splash(false);
}
Also used : JmriJFrame(jmri.util.JmriJFrame)

Example 99 with JmriJFrame

use of jmri.util.JmriJFrame in project JMRI by JMRI.

the class InstallTest method main.

// Main entry point
public static void main(String[] args) {
    // show splash screen early
    splash(true);
    Apps.setStartupInfo("InstallTest");
    setConfigFilename("InstallTestConfig2.xml", args);
    JmriJFrame f = new JmriJFrame("InstallTest");
    createFrame(new InstallTest(f), f);
    log.debug("main initialization done");
    splash(false);
}
Also used : JmriJFrame(jmri.util.JmriJFrame)

Example 100 with JmriJFrame

use of jmri.util.JmriJFrame in project JMRI by JMRI.

the class PanelPro method main.

// Main entry point
public static void main(String[] args) {
    // show splash screen early
    splash(true);
    Apps.setStartupInfo("PanelPro");
    setConfigFilename("PanelProConfig2.xml", args);
    JmriJFrame f = new JmriJFrame("PanelPro");
    createFrame(new PanelPro(f), f);
    log.debug("main initialization done");
    splash(false);
}
Also used : JmriJFrame(jmri.util.JmriJFrame)

Aggregations

JmriJFrame (jmri.util.JmriJFrame)111 ActionEvent (java.awt.event.ActionEvent)46 BoxLayout (javax.swing.BoxLayout)44 JPanel (javax.swing.JPanel)44 JButton (javax.swing.JButton)38 ActionListener (java.awt.event.ActionListener)33 FlowLayout (java.awt.FlowLayout)30 JLabel (javax.swing.JLabel)30 Test (org.junit.Test)22 Container (java.awt.Container)20 JScrollPane (javax.swing.JScrollPane)20 JFrame (javax.swing.JFrame)16 JSeparator (javax.swing.JSeparator)10 JTable (javax.swing.JTable)10 JComboBox (javax.swing.JComboBox)9 TableColumn (javax.swing.table.TableColumn)9 TableColumnModel (javax.swing.table.TableColumnModel)9 ButtonGroup (javax.swing.ButtonGroup)8 JCheckBox (javax.swing.JCheckBox)8 JMenuBar (javax.swing.JMenuBar)8