use of jmri.jmrit.symbolicprog.KnownLocoSelPane in project JMRI by JMRI.
the class PaneEditAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
if (log.isDebugEnabled()) {
log.debug("Pane programmer requested");
}
// create the initial frame that steers
final JmriJFrame f = new JmriJFrame(SymbolicProgBundle.getMessage("FrameEditEntrySetup"));
f.getContentPane().setLayout(new BoxLayout(f.getContentPane(), BoxLayout.Y_AXIS));
// add the Roster menu
JMenuBar menuBar = new JMenuBar();
// menuBar.setBorder(new BevelBorder(BevelBorder.RAISED));
menuBar.add(new jmri.jmrit.roster.swing.RosterMenu(SymbolicProgBundle.getMessage("MenuRoster"), jmri.jmrit.roster.swing.RosterMenu.MAINMENU, f));
f.setJMenuBar(menuBar);
// known entry, no programmer
JPanel pane1 = new // not programming
KnownLocoSelPane(// not programming
false) {
@Override
protected void startProgrammer(DecoderFile decoderFile, RosterEntry re, String filename) {
String title = SymbolicProgBundle.getMessage("FrameEditEntryTitle");
JFrame p = new PaneProgFrame(decoderFile, re, title, "programmers" + File.separator + filename + ".xml", null, false) {
@Override
protected JPanel getModePane() {
return null;
}
};
p.pack();
p.setVisible(true);
}
};
// load primary frame
pane1.setAlignmentX(JLabel.CENTER_ALIGNMENT);
f.getContentPane().add(pane1);
f.pack();
if (log.isDebugEnabled()) {
log.debug("Tab-Programmer setup created");
}
f.setVisible(true);
}
use of jmri.jmrit.symbolicprog.KnownLocoSelPane in project JMRI by JMRI.
the class PaneOpsProgAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
if (log.isDebugEnabled()) {
log.debug("Pane programmer requested");
}
// create the initial frame that steers
final JmriJFrame f = new JmriJFrame(SymbolicProgBundle.getMessage("FrameOpsProgrammerSetup"));
f.getContentPane().setLayout(new BoxLayout(f.getContentPane(), BoxLayout.Y_AXIS));
// add the Roster menu
JMenuBar menuBar = new JMenuBar();
// menuBar.setBorder(new BevelBorder(BevelBorder.RAISED));
menuBar.add(new jmri.jmrit.roster.swing.RosterMenu(SymbolicProgBundle.getMessage("MenuRoster"), jmri.jmrit.roster.swing.RosterMenu.MAINMENU, f));
f.setJMenuBar(menuBar);
// known loco on main track
JPanel pane1 = new // no ident in ops mode yet
KnownLocoSelPane(// no ident in ops mode yet
false) {
@Override
protected void startProgrammer(DecoderFile decoderFile, RosterEntry re, String filename) {
String title = java.text.MessageFormat.format(SymbolicProgBundle.getMessage("FrameOpsProgrammerTitle"), new Object[] { re.getId() });
// find the ops-mode programmer
int address = Integer.parseInt(re.getDccAddress());
boolean longAddr = re.isLongAddress();
Programmer programmer = InstanceManager.getDefault(jmri.ProgrammerManager.class).getAddressedProgrammer(longAddr, address);
// and created the frame
JFrame p = new PaneOpsProgFrame(decoderFile, re, title, "programmers" + File.separator + filename + ".xml", programmer);
p.pack();
p.setVisible(true);
// f.setVisible(false);
// f.dispose();
}
};
// load primary frame
pane1.setAlignmentX(JLabel.CENTER_ALIGNMENT);
f.getContentPane().add(pane1);
f.pack();
if (log.isDebugEnabled()) {
log.debug("Tab-Programmer setup created");
}
f.setVisible(true);
}
use of jmri.jmrit.symbolicprog.KnownLocoSelPane in project JMRI by JMRI.
the class AutoSpeedAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
if (log.isInfoEnabled()) {
log.debug("auto speed tool requested");
}
// create the initial frame that steers
final JFrame f = new JFrame("Auto-speed Tool Setup");
f.getContentPane().setLayout(new BoxLayout(f.getContentPane(), BoxLayout.Y_AXIS));
// add the Roster menu
JMenuBar menuBar = new JMenuBar();
// menuBar.setBorder(new BevelBorder(BevelBorder.RAISED));
menuBar.add(new jmri.jmrit.roster.swing.RosterMenu("Roster", jmri.jmrit.roster.swing.RosterMenu.MAINMENU, f));
f.setJMenuBar(menuBar);
// known loco on main track
JPanel pane1 = new // no ident in ops mode yet
KnownLocoSelPane(// no ident in ops mode yet
false) {
@Override
protected void startProgrammer(DecoderFile decoderFile, RosterEntry re, String filename) {
String title = "Set speed info for " + re.getId() + " on main track";
// find the ops-mode programmer
int address = Integer.parseInt(re.getDccAddress());
boolean longAddr = true;
if (address < 100) {
longAddr = false;
}
Programmer programmer = InstanceManager.getDefault(jmri.ProgrammerManager.class).getAddressedProgrammer(longAddr, address);
// and created the frame
JFrame p = new PaneOpsProgFrame(decoderFile, re, title, "programmers" + File.separator + filename + ".xml", programmer);
p.pack();
p.setVisible(true);
f.setVisible(false);
f.dispose();
}
};
// load primary frame
pane1.setAlignmentX(JLabel.CENTER_ALIGNMENT);
f.getContentPane().add(pane1);
f.pack();
if (log.isInfoEnabled()) {
log.debug("setup created");
}
f.setVisible(true);
}
Aggregations