001package jmri.jmrit.symbolicprog.tabbedframe;
002
003import javax.swing.JPanel;
004import jmri.Programmer;
005import jmri.jmrit.decoderdefn.DecoderFile;
006import jmri.jmrit.roster.RosterEntry;
007import org.slf4j.Logger;
008import org.slf4j.LoggerFactory;
009
010/**
011 * Extend the PaneProgFrame to handle service (Global) mode operations.
012 * <p>
013 * If no programmer is provided, the programmer parts of the GUI are suppressed.
014 *
015 * @author Bob Jacobsen Copyright (C) 2002, 2008
016 */
017public class PaneServiceProgFrame extends PaneProgFrame {
018
019    jmri.jmrit.progsupport.ProgModeSelector modePane;
020
021    /**
022     * Provide the programming mode selection pane for inclusion
023     */
024    @Override
025    protected JPanel getModePane() {
026        // ensure initialization, even if invoked in ctor
027        if (modePane == null) {
028            modePane = new jmri.jmrit.progsupport.ProgServiceModeComboBox();
029        }
030        log.debug("invoked getModePane");
031        return modePane;
032    }
033
034    /**
035     * This invokes the parent ctor to do the real work.
036     * <p>
037     * That will call back to get the programming mode panel (provided)
038     * and to hear if there is read mode (depends).
039     * <p>
040     * Then, this sets the programming mode for the service
041     * programmer based on what's in the decoder file.
042     *
043     * @param decoderFile XML file defining the decoder contents.
044     * @param r           RosterEntry for information on this locomotive.
045     * @param name        frame title.
046     * @param file        programmer file.
047     * @param pProg       service programmer.
048     */
049    public PaneServiceProgFrame(DecoderFile decoderFile, RosterEntry r,
050            String name, String file, Programmer pProg) {
051        super(decoderFile, r, name, file, pProg, false);
052
053        pack();
054
055        if (log.isDebugEnabled()) {
056            log.debug("PaneServiceProgFrame \"{}\" constructed", name);
057        }
058    }
059
060    private final static Logger log = LoggerFactory.getLogger(PaneServiceProgFrame.class);
061
062}