/** * Set the value of panel * * @param newVar the new value of panel */ private void setPanel(final counts a, final connections cnc_a) { // creates a JPanel panel = new JPanel(); panel.setLayout(new ModifiedFlowLayout()); JButton clearButton = new JButton("CLEAR"); clearButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { drawPad.clear(a, cnc_a); taskbar.setText(null); } }); JButton wireButton = new JButton("WIRE "); wireButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { drawPad.wire(cnc_a, a); taskbar.setText("Add Wire by Mouse click."); } }); JButton slctButton = new JButton("SELECT"); slctButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { drawPad.select(a, cnc_a); taskbar.setText("Press & Drag to move component"); } }); JButton showOutputButton = new JButton("Show Output"); showOutputButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { drawPad.showOutputs(a, cnc_a); taskbar.setText("Click Hide Output, otherwise it will behave unpredictably"); } }); JButton hideOutputButton = new JButton("Hide Output"); hideOutputButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { drawPad.hideOutputs(a, cnc_a); taskbar.setText("Hide the Circuit component Expressions"); } }); // adds the buttons to the panel panel.add(clearButton); panel.add(wireButton); panel.add(slctButton); panel.add(showOutputButton); panel.add(hideOutputButton); // Default System Packages have some componentType-s. Those buttons are installed for (package_cls x : a.getPackage_list()) { this.add_componentType_buttons(x, a); } }