}
@Override
public void actionPerformed(ActionEvent event) {
Object src = event.getSource();
Project proj = frame.getProject();
Circuit cur = proj == null ? null : proj.getCurrentCircuit();
if (src == LogisimMenuBar.ADD_CIRCUIT) {
ProjectCircuitActions.doAddCircuit(proj);
} else if (src == LogisimMenuBar.MOVE_CIRCUIT_UP) {
ProjectCircuitActions.doMoveCircuit(proj, cur, -1);
} else if (src == LogisimMenuBar.MOVE_CIRCUIT_DOWN) {
ProjectCircuitActions.doMoveCircuit(proj, cur, 1);
} else if (src == LogisimMenuBar.SET_MAIN_CIRCUIT) {
ProjectCircuitActions.doSetAsMainCircuit(proj, cur);
} else if (src == LogisimMenuBar.REMOVE_CIRCUIT) {
ProjectCircuitActions.doRemoveCircuit(proj, cur);
} else if (src == LogisimMenuBar.EDIT_LAYOUT) {
frame.setEditorView(Frame.EDIT_LAYOUT);
} else if (src == LogisimMenuBar.EDIT_APPEARANCE) {
frame.setEditorView(Frame.EDIT_APPEARANCE);
} else if (src == LogisimMenuBar.VIEW_TOOLBOX) {
frame.setExplorerView(Frame.VIEW_TOOLBOX);
} else if (src == LogisimMenuBar.VIEW_SIMULATION) {
frame.setExplorerView(Frame.VIEW_SIMULATION);
} else if (src == LogisimMenuBar.REVERT_APPEARANCE) {
proj.doAction(new RevertAppearanceAction(cur));
} else if (src == LogisimMenuBar.ANALYZE_CIRCUIT) {
ProjectCircuitActions.doAnalyze(proj, cur);
} else if (src == LogisimMenuBar.CIRCUIT_STATS) {
StatisticsDialog.show(frame, proj.getLogisimFile(), cur);
}
}