Example #1
0
 @Override
 public void actionPerformed(ActionEvent e) {
     Object source = e.getSource();
     if (source == editLayout) {
         proj.setCurrentCircuit(circuit);
         proj.getFrame().setEditorView(Frame.EDIT_LAYOUT);
     } else if (source == editAppearance) {
         proj.setCurrentCircuit(circuit);
         proj.getFrame().setEditorView(Frame.EDIT_APPEARANCE);
     } else if (source == analyze) {
         ProjectCircuitActions.doAnalyze(proj, circuit);
     } else if (source == stats) {
         JFrame frame = (JFrame) SwingUtilities.getRoot(this);
         StatisticsDialog.show(frame, proj.getLogisimFile(), circuit);
     } else if (source == main) {
         ProjectCircuitActions.doSetAsMainCircuit(proj, circuit);
     } else if (source == remove) {
         ProjectCircuitActions.doRemoveCircuit(proj, circuit);
     }
 }
Example #2
0
 @Override
 public void actionPerformed(ActionEvent e) {
     Object src = e.getSource();
     if (src == add) {
         ProjectCircuitActions.doAddCircuit(proj);
     } else if (src == loadBuiltin) {
         ProjectLibraryActions.doLoadBuiltinLibrary(proj);
     } else if (src == loadLogisim) {
         ProjectLibraryActions.doLoadLogisimLibrary(proj);
     } else if (src == loadJar) {
         ProjectLibraryActions.doLoadJarLibrary(proj);
     }
 }