Search in sources :

Example 21 with DecoderFile

use of jmri.jmrit.decoderdefn.DecoderFile in project JMRI by JMRI.

the class NewLocoSelPane method openButton.

/**
     * Handle pushing the open programmer button by finding names, then calling
     * a template method
     */
protected void openButton() {
    // find the decoderFile object
    DecoderFile decoderFile = DecoderIndexFile.instance().fileFromTitle((String) decoderBox.getSelectedItem());
    if (log.isDebugEnabled()) {
        log.debug("decoder file: " + decoderFile.getFilename());
    }
    // create a dummy RosterEntry with the decoder info
    RosterEntry re = new RosterEntry();
    re.setDecoderFamily(decoderFile.getFamily());
    re.setDecoderModel(decoderFile.getModel());
    re.setId(Bundle.getMessage("LabelNewDecoder"));
    // note we're leaving the filename information as null
    // add the new roster entry to the in-memory roster
    Roster.getDefault().addEntry(re);
    startProgrammer(decoderFile, re);
}
Also used : DecoderFile(jmri.jmrit.decoderdefn.DecoderFile) RosterEntry(jmri.jmrit.roster.RosterEntry)

Aggregations

DecoderFile (jmri.jmrit.decoderdefn.DecoderFile)21 RosterEntry (jmri.jmrit.roster.RosterEntry)12 JFrame (javax.swing.JFrame)8 BoxLayout (javax.swing.BoxLayout)7 JPanel (javax.swing.JPanel)7 JMenuBar (javax.swing.JMenuBar)6 JmriJFrame (jmri.util.JmriJFrame)5 JMenu (javax.swing.JMenu)3 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)3 TreeNode (javax.swing.tree.TreeNode)3 TreePath (javax.swing.tree.TreePath)3 KnownLocoSelPane (jmri.jmrit.symbolicprog.KnownLocoSelPane)3 WindowAdapter (java.awt.event.WindowAdapter)2 WindowEvent (java.awt.event.WindowEvent)2 JSeparator (javax.swing.JSeparator)2 TreeSelectionEvent (javax.swing.event.TreeSelectionEvent)2 TreeSelectionListener (javax.swing.event.TreeSelectionListener)2 Programmer (jmri.Programmer)2 CombinedLocoSelTreePane (jmri.jmrit.symbolicprog.CombinedLocoSelTreePane)2 BorderLayout (java.awt.BorderLayout)1