}
private void computeEnabled() {
Project proj = frame.getProject();
LogisimFile file = proj.getLogisimFile();
Circuit cur = proj.getCurrentCircuit();
int curIndex = file.getCircuits().indexOf(cur);
boolean isProjectCircuit = curIndex >= 0;
String editorView = frame.getEditorView();
String explorerView = frame.getExplorerView();
boolean canSetMain = false;
boolean canMoveUp = false;
boolean canMoveDown = false;
boolean canRemove = false;
boolean canRevert = false;
boolean viewAppearance = editorView.equals(Frame.EDIT_APPEARANCE);
boolean viewLayout = editorView.equals(Frame.EDIT_LAYOUT);
boolean viewToolbox = explorerView.equals(Frame.VIEW_TOOLBOX);
boolean viewSimulation = explorerView.equals(Frame.VIEW_SIMULATION);
if (isProjectCircuit) {
List<?> tools = proj.getLogisimFile().getTools();
canSetMain = proj.getLogisimFile().getMainCircuit() != cur;
canMoveUp = curIndex > 0;
canMoveDown = curIndex < tools.size() - 1;
canRemove = tools.size() > 1;
canRevert = viewAppearance
&& !cur.getAppearance().isDefaultAppearance();
}
menubar.setEnabled(LogisimMenuBar.ADD_CIRCUIT, true);
menubar.setEnabled(LogisimMenuBar.MOVE_CIRCUIT_UP, canMoveUp);
menubar.setEnabled(LogisimMenuBar.MOVE_CIRCUIT_DOWN, canMoveDown);