001package jmri.jmrit.progsupport;
002
003import jmri.Programmer;
004
005/**
006 * Provide a JPanel to configure the programming mode.
007 * <p>
008 * The using code should get a configured programmer with getProgrammer().
009 * <p>
010 * This pane will only display ops mode options if ops mode is available, as
011 * evidenced by an attempt to get an ops mode programmer at startup time.
012 * <p>
013 * For service mode, you can get the programmer either from here or direct from
014 * the instance manager. For ops mode, you have to get it from here.
015 * <p>
016 * Note that you should call the dispose() method when you're really done, so
017 * that a ProgModeSelector object can disconnect its listeners.
018 *
019 * @author Bob Jacobsen Copyright (C) 2001
020 */
021public abstract class ProgModeSelector extends javax.swing.JPanel {
022
023    /**
024     * Get the configured programmer.
025     * @return the programmer.
026     */
027    abstract public Programmer getProgrammer();
028
029    /**
030     * Does this object have sufficient selection information to provide a
031     * programmer?
032     *
033     * @return true if a programmer is available
034     */
035    abstract public boolean isSelected();
036
037    /**
038     * Enable/Disable the selection aspect of whatever GUI is presented
039     * <p>
040     * Default beavior is to do nothing.
041     *
042     * @param enabled false disables GUI user changes
043     */
044    @Override
045    public void setEnabled(boolean enabled) {
046    }
047
048    /**
049     * Clean up when done. Required.
050     */
051    abstract public void dispose();
052
053}