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);
}
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;
}
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);
}
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);
}
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);
}
Aggregations