001package apps.gui3.dp3;
002
003import apps.gui3.Apps3;
004import jmri.Application;
005import jmri.jmrit.roster.swing.RosterFrame;
006
007/**
008 * Standalone DecoderPro3 Window.
009 */
010public class DecoderPro3Window extends RosterFrame {
011
012    /**
013     * Loads DecoderPro 3 with the default set of menus and toolbars
014     */
015    public DecoderPro3Window() {
016        super(Application.getApplicationName());
017    }
018
019    /**
020     * Loads DecoderPro 3 with specific menu and toolbar files.
021     *
022     * @param menuFile XML file with menu structure
023     * @param toolbarFile XML file with toolbar structure
024     */
025    public DecoderPro3Window(String menuFile, String toolbarFile) {
026        super(Application.getApplicationName(),
027                menuFile,
028                toolbarFile);
029        this.setNewWindowAction(new DecoderPro3Action("newWindow", this));
030    }
031
032    // for some reason, the super implementation does not get called automatically
033    @Override
034    public void remoteCalls(String[] args) {
035        super.remoteCalls(args);
036    }
037
038    @Override
039    protected void additionsToToolBar() {
040        // This value may return null if the DP3 window has been called from the traditional JMRI menu frame
041        if (Apps3.buttonSpace() != null) {
042            getToolBar().add(Apps3.buttonSpace());
043        }
044        super.additionsToToolBar();
045    }
046
047}