use of jmri.jmrit.symbolicprog.tabbedframe.PaneOpsProgFrame in project JMRI by JMRI.
the class AddressPanel method openProgrammer.
/**
* Open a programmer for this address
*/
protected void openProgrammer() {
if (rosterEntry == null) {
return;
}
java.util.ResourceBundle rbt = java.util.ResourceBundle.getBundle("jmri.jmrit.symbolicprog.SymbolicProgBundle");
String title = java.text.MessageFormat.format(rbt.getString("FrameOpsProgrammerTitle"), new Object[] { rosterEntry.getId() });
// find the ops-mode programmer
int address = Integer.parseInt(rosterEntry.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(null, rosterEntry, title, "programmers" + File.separator + ProgDefault.getDefaultProgFile() + ".xml", programmer);
p.pack();
p.setVisible(true);
}
use of jmri.jmrit.symbolicprog.tabbedframe.PaneOpsProgFrame in project JMRI by JMRI.
the class RosterFrame method startProgrammer.
protected void startProgrammer(DecoderFile decoderFile, RosterEntry re, String filename) {
if (inStartProgrammer) {
log.debug("Call to start programmer has been called twice when the first call hasn't opened");
return;
}
if (!checkIfEntrySelected()) {
return;
}
try {
setCursor(new Cursor(Cursor.WAIT_CURSOR));
inStartProgrammer = true;
String title = re.getId();
JFrame progFrame = null;
if (edit.isSelected()) {
progFrame = new PaneProgFrame(decoderFile, re, title, "programmers" + File.separator + filename + ".xml", null, false) {
@Override
protected JPanel getModePane() {
return null;
}
};
} else if (service.isSelected()) {
progFrame = new PaneServiceProgFrame(decoderFile, re, title, "programmers" + File.separator + filename + ".xml", modePanel.getProgrammer()) {
};
} else if (ops.isSelected()) {
int address = Integer.parseInt(re.getDccAddress());
boolean longAddr = re.isLongAddress();
Programmer pProg = InstanceManager.getDefault(AddressedProgrammerManager.class).getAddressedProgrammer(longAddr, address);
progFrame = new PaneOpsProgFrame(decoderFile, re, title, "programmers" + File.separator + filename + ".xml", pProg);
}
if (progFrame == null) {
return;
}
progFrame.pack();
progFrame.setVisible(true);
} finally {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
inStartProgrammer = false;
}
use of jmri.jmrit.symbolicprog.tabbedframe.PaneOpsProgFrame 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