/** Disables the load program action. */ public void disableLoadProgram() { loadProgramButton.setEnabled(false); }
// Initializes this component. private void jbInit() { fileChooser.setFileFilter(new ScriptFileFilter()); this.getContentPane().setLayout(null); Hashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>(); JLabel slowLabel = new JLabel("Slow"); slowLabel.setFont(Utilities.thinLabelsFont); JLabel fastLabel = new JLabel("Fast"); fastLabel.setFont(Utilities.thinLabelsFont); labelTable.put(1, slowLabel); labelTable.put(5, fastLabel); speedSlider.addChangeListener( new ChangeListener() { public void stateChanged(ChangeEvent e) { SpeedSlider_stateChanged(e); } }); speedSlider.setLabelTable(labelTable); speedSlider.setMajorTickSpacing(1); speedSlider.setPaintTicks(true); speedSlider.setPaintLabels(true); speedSlider.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); speedSlider.setPreferredSize(new Dimension(95, 50)); speedSlider.setMinimumSize(new Dimension(95, 50)); speedSlider.setToolTipText("Speed"); speedSlider.setMaximumSize(new Dimension(95, 50)); final Dimension buttonSize = new Dimension(39, 39); loadProgramButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { loadProgramButton_actionPerformed(); } }); loadProgramButton.setMaximumSize(buttonSize); loadProgramButton.setMinimumSize(buttonSize); loadProgramButton.setPreferredSize(buttonSize); loadProgramButton.setSize(buttonSize); loadProgramButton.setToolTipText("Load Program"); loadProgramButton.setIcon(loadProgramIcon); ffwdButton.setMaximumSize(buttonSize); ffwdButton.setMinimumSize(buttonSize); ffwdButton.setPreferredSize(buttonSize); ffwdButton.setToolTipText("Run"); ffwdButton.setIcon(ffwdIcon); ffwdButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { ffwdButton_actionPerformed(); } }); stopButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { stopButton_actionPerformed(); } }); stopButton.setMaximumSize(buttonSize); stopButton.setMinimumSize(buttonSize); stopButton.setPreferredSize(buttonSize); stopButton.setToolTipText("Stop"); stopButton.setIcon(stopIcon); rewindButton.setMaximumSize(buttonSize); rewindButton.setMinimumSize(buttonSize); rewindButton.setPreferredSize(buttonSize); rewindButton.setToolTipText("Reset"); rewindButton.setIcon(rewindIcon); rewindButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { rewindButton_actionPerformed(); } }); scriptButton.setMaximumSize(buttonSize); scriptButton.setMinimumSize(buttonSize); scriptButton.setPreferredSize(buttonSize); scriptButton.setToolTipText("Load Script"); scriptButton.setIcon(scriptIcon); scriptButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { scriptButton_actionPerformed(); } }); breakButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { breakButton_actionPerformed(); } }); breakButton.setMaximumSize(buttonSize); breakButton.setMinimumSize(buttonSize); breakButton.setPreferredSize(buttonSize); breakButton.setToolTipText("Open breakpoint panel"); breakButton.setIcon(breakIcon); breakpointWindow.addBreakpointListener(this); singleStepButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { singleStepButton_actionPerformed(); } }); singleStepButton.setMaximumSize(buttonSize); singleStepButton.setMinimumSize(buttonSize); singleStepButton.setPreferredSize(buttonSize); singleStepButton.setSize(buttonSize); singleStepButton.setToolTipText("Single Step"); singleStepButton.setIcon(singleStepIcon); stepOverButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { stepOverButton_actionPerformed(); } }); stepOverButton.setMaximumSize(buttonSize); stepOverButton.setMinimumSize(buttonSize); stepOverButton.setPreferredSize(buttonSize); stepOverButton.setSize(buttonSize); stepOverButton.setToolTipText("Step Over"); stepOverButton.setIcon(stepOverIcon); animationCombo.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { animationCombo_actionPerformed(); } }); formatCombo.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { formatCombo_actionPerformed(); } }); additionalDisplayCombo.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { additionalDisplayCombo_actionPerformed(); } }); messageLbl.setFont(Utilities.statusLineFont); messageLbl.setBorder(BorderFactory.createLoweredBevelBorder()); messageLbl.setBounds(new Rectangle(0, 667, CONTROLLER_WIDTH - 8, 25)); toolBar = new JToolBar(); toolBar.setSize(new Dimension(TOOLBAR_WIDTH, TOOLBAR_HEIGHT)); toolBar.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 0)); toolBar.setFloatable(false); toolBar.setLocation(0, 0); toolBar.setBorder(BorderFactory.createEtchedBorder()); arrangeToolBar(); this.getContentPane().add(toolBar, null); toolBar.revalidate(); toolBar.repaint(); repaint(); // Creating the menu bar menuBar = new JMenuBar(); arrangeMenu(); setJMenuBar(menuBar); this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); this.getContentPane().add(messageLbl, null); setControllerSize(); // sets the frame to be visible. setVisible(true); }
/** Disables the rewind action. */ public void disableRewind() { rewindButton.setEnabled(false); rewindMenuItem.setEnabled(false); }
/** Enables the load program action. */ public void enableLoadProgram() { loadProgramButton.setEnabled(true); }
/** Disables the eject action. */ public void disableScript() { scriptButton.setEnabled(false); scriptMenuItem.setEnabled(false); }
/** Enables the rewind action. */ public void enableRewind() { rewindButton.setEnabled(true); rewindMenuItem.setEnabled(true); }
/** Disables the stop action. */ public void disableStop() { stopButton.setEnabled(false); stopMenuItem.setEnabled(false); }
/** Enables the eject action. */ public void enableScript() { scriptButton.setEnabled(true); scriptMenuItem.setEnabled(true); }
/** Enables the stop action. */ public void enableStop() { stopButton.setEnabled(true); stopMenuItem.setEnabled(true); }
/** Disables the fast forward action. */ public void disableFastForward() { ffwdButton.setEnabled(false); ffwdMenuItem.setEnabled(false); }
/** Enables the fast forward action. */ public void enableFastForward() { ffwdButton.setEnabled(true); ffwdMenuItem.setEnabled(true); }
/** Disables the single step action. */ public void disableSingleStep() { singleStepButton.setEnabled(false); stepOverButton.setEnabled(false); singleStepMenuItem.setEnabled(false); }
/** Enables the single step action. */ public void enableSingleStep() { singleStepButton.setEnabled(true); stepOverButton.setEnabled(true); singleStepMenuItem.setEnabled(true); }