本文整理汇总了Java中com.cburch.logisim.gui.menu.LogisimMenuBar类的典型用法代码示例。如果您正苦于以下问题:Java LogisimMenuBar类的具体用法?Java LogisimMenuBar怎么用?Java LogisimMenuBar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LogisimMenuBar类属于com.cburch.logisim.gui.menu包,在下文中一共展示了LogisimMenuBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
Component c = tabbedPane.getSelectedComponent();
if (c instanceof JScrollPane) {
c = ((JScrollPane) c).getViewport().getView();
}
if (!(c instanceof TabInterface))
return;
TabInterface tab = (TabInterface) c;
if (src == LogisimMenuBar.CUT) {
tab.copy();
tab.delete();
} else if (src == LogisimMenuBar.COPY) {
tab.copy();
} else if (src == LogisimMenuBar.PASTE) {
tab.paste();
} else if (src == LogisimMenuBar.DELETE) {
tab.delete();
} else if (src == LogisimMenuBar.SELECT_ALL) {
tab.selectAll();
}
}
示例2: SimulationToolbarModel
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
public SimulationToolbarModel(Project project, MenuListener menu) {
this.project = project;
simEnable = new LogisimToolbarItem(menu, "simplay.png", LogisimMenuBar.SIMULATE_ENABLE,
Strings.getter("simulateEnableStepsTip"));
simStep = new LogisimToolbarItem(menu, "simstep.png", LogisimMenuBar.SIMULATE_STEP,
Strings.getter("simulateStepTip"));
tickEnable = new LogisimToolbarItem(menu, "simtplay.png", LogisimMenuBar.TICK_ENABLE,
Strings.getter("simulateEnableTicksTip"));
tickStep = new LogisimToolbarItem(menu, "simtstep.png", LogisimMenuBar.TICK_STEP,
Strings.getter("simulateTickTip"));
items = UnmodifiableList.create(new ToolbarItem[] { simEnable, simStep, tickEnable, tickStep, });
menu.getMenuBar().addEnableListener(this);
stateChanged(null);
}
示例3: computeEnabled
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
@Override
public void computeEnabled() {
Project proj = frame.getProject();
Selection sel = proj == null ? null : proj.getSelection();
boolean selEmpty = (sel == null ? true : sel.isEmpty());
boolean canChange = proj != null && proj.getLogisimFile().contains(proj.getCurrentCircuit());
boolean selectAvailable = false;
for (Library lib : proj.getLogisimFile().getLibraries()) {
if (lib instanceof Base)
selectAvailable = true;
}
setEnabled(LogisimMenuBar.CUT, !selEmpty && selectAvailable && canChange);
setEnabled(LogisimMenuBar.COPY, !selEmpty && selectAvailable);
setEnabled(LogisimMenuBar.PASTE, selectAvailable && canChange && !Clipboard.isEmpty());
setEnabled(LogisimMenuBar.DELETE, !selEmpty && selectAvailable && canChange);
setEnabled(LogisimMenuBar.DUPLICATE, !selEmpty && selectAvailable && canChange);
setEnabled(LogisimMenuBar.SELECT_ALL, selectAvailable);
setEnabled(LogisimMenuBar.RAISE, false);
setEnabled(LogisimMenuBar.LOWER, false);
setEnabled(LogisimMenuBar.RAISE_TOP, false);
setEnabled(LogisimMenuBar.LOWER_BOTTOM, false);
setEnabled(LogisimMenuBar.ADD_CONTROL, false);
setEnabled(LogisimMenuBar.REMOVE_CONTROL, false);
}
示例4: ProjectToolbarModel
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
public ProjectToolbarModel(Frame frame, MenuListener menu) {
this.frame = frame;
itemAdd = new LogisimToolbarItem(menu, "projadd.gif", LogisimMenuBar.ADD_CIRCUIT,
Strings.getter("projectAddCircuitTip"));
itemUp = new LogisimToolbarItem(menu, "projup.gif", LogisimMenuBar.MOVE_CIRCUIT_UP,
Strings.getter("projectMoveCircuitUpTip"));
itemDown = new LogisimToolbarItem(menu, "projdown.gif", LogisimMenuBar.MOVE_CIRCUIT_DOWN,
Strings.getter("projectMoveCircuitDownTip"));
itemDelete = new LogisimToolbarItem(menu, "projdel.gif", LogisimMenuBar.REMOVE_CIRCUIT,
Strings.getter("projectRemoveCircuitTip"));
itemLayout = new LogisimToolbarItem(menu, "projlayo.gif", LogisimMenuBar.EDIT_LAYOUT,
Strings.getter("projectEditLayoutTip"));
itemAppearance = new LogisimToolbarItem(menu, "projapp.gif", LogisimMenuBar.EDIT_APPEARANCE,
Strings.getter("projectEditAppearanceTip"));
items = UnmodifiableList.create(new ToolbarItem[] { itemAdd, itemUp, itemDown, itemDelete,
new ToolbarSeparator(4), itemLayout, itemAppearance, });
menu.addEnabledListener(this);
}
示例5: register
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
private void register() {
menubar.addActionListener(LogisimMenuBar.CUT, this);
menubar.addActionListener(LogisimMenuBar.COPY, this);
menubar.addActionListener(LogisimMenuBar.PASTE, this);
menubar.addActionListener(LogisimMenuBar.DELETE, this);
menubar.addActionListener(LogisimMenuBar.DUPLICATE, this);
menubar.addActionListener(LogisimMenuBar.SELECT_ALL, this);
menubar.addActionListener(LogisimMenuBar.RAISE, this);
menubar.addActionListener(LogisimMenuBar.LOWER, this);
menubar.addActionListener(LogisimMenuBar.RAISE_TOP, this);
menubar.addActionListener(LogisimMenuBar.LOWER_BOTTOM, this);
menubar.addActionListener(LogisimMenuBar.ADD_CONTROL, this);
menubar.addActionListener(LogisimMenuBar.REMOVE_CONTROL, this);
if (handler != null)
handler.computeEnabled();
}
示例6: ExplorerToolbarModel
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
public ExplorerToolbarModel(Frame frame, MenuListener menu) {
this.frame = frame;
itemToolbox = new LogisimToolbarItem(menu, "projtool.gif", LogisimMenuBar.VIEW_TOOLBOX,
Strings.getter("projectViewToolboxTip"));
itemSimulation = new LogisimToolbarItem(menu, "projsim.gif", LogisimMenuBar.VIEW_SIMULATION,
Strings.getter("projectViewSimulationTip"));
itemLayout = new LogisimToolbarItem(menu, "projlayo.gif", LogisimMenuBar.EDIT_LAYOUT,
Strings.getter("projectEditLayoutTip"));
itemAppearance = new LogisimToolbarItem(menu, "projapp.gif", LogisimMenuBar.EDIT_APPEARANCE,
Strings.getter("projectEditAppearanceTip"));
items = UnmodifiableList.create(new ToolbarItem[] { itemToolbox, itemSimulation, new ToolbarSeparator(4),
itemLayout, itemAppearance, });
menu.addEnabledListener(this);
}
示例7: fire
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
@Override
protected void fire(LogisimMenuItem item) {
if (item == LogisimMenuBar.CUT) {
handler.cut();
} else if (item == LogisimMenuBar.COPY) {
handler.copy();
} else if (item == LogisimMenuBar.DELETE) {
handler.delete();
} else if (item == LogisimMenuBar.DUPLICATE) {
handler.duplicate();
} else if (item == LogisimMenuBar.RAISE) {
handler.raise();
} else if (item == LogisimMenuBar.LOWER) {
handler.lower();
} else if (item == LogisimMenuBar.RAISE_TOP) {
handler.raiseTop();
} else if (item == LogisimMenuBar.LOWER_BOTTOM) {
handler.lowerBottom();
} else if (item == LogisimMenuBar.ADD_CONTROL) {
handler.addControlPoint();
} else if (item == LogisimMenuBar.REMOVE_CONTROL) {
handler.removeControlPoint();
}
}
示例8: actionPerformed
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
if (src == LogisimMenuBar.CUT) {
getClip().copy();
editor.delete();
} else if (src == LogisimMenuBar.COPY) {
getClip().copy();
} else if (src == LogisimMenuBar.PASTE) {
getClip().paste();
} else if (src == LogisimMenuBar.DELETE) {
editor.delete();
} else if (src == LogisimMenuBar.SELECT_ALL) {
editor.selectAll();
}
}
示例9: actionPerformed
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
Component c = tabbedPane.getSelectedComponent();
if (c instanceof JScrollPane) {
c = ((JScrollPane) c).getViewport().getView();
}
if (!(c instanceof TabInterface))
return;
TabInterface tab = (TabInterface) c;
if (src == LogisimMenuBar.CUT) {
tab.copy();
tab.delete();
} else if (src == LogisimMenuBar.COPY) {
tab.copy();
} else if (src == LogisimMenuBar.PASTE) {
tab.paste();
} else if (src == LogisimMenuBar.DELETE) {
tab.delete();
} else if (src == LogisimMenuBar.SELECT_ALL) {
tab.selectAll();
}
}
示例10: SimulationToolbarModel
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
public SimulationToolbarModel(Project project, MenuListener menu) {
this.project = project;
simEnable = new LogisimToolbarItem(menu, "simplay.png",
LogisimMenuBar.SIMULATE_ENABLE,
Strings.getter("simulateEnableStepsTip"));
simStep = new LogisimToolbarItem(menu, "simstep.png",
LogisimMenuBar.SIMULATE_STEP, Strings.getter("simulateStepTip"));
tickEnable = new LogisimToolbarItem(menu, "simtplay.png",
LogisimMenuBar.TICK_ENABLE,
Strings.getter("simulateEnableTicksTip"));
tickStep = new LogisimToolbarItem(menu, "simtstep.png",
LogisimMenuBar.TICK_STEP, Strings.getter("simulateTickTip"));
tickStepMain = new LogisimToolbarItem(menu, "clock.gif",
LogisimMenuBar.TICK_STEP_MAIN,
Strings.getter("simulateTickMainTip"));
items = UnmodifiableList.create(new ToolbarItem[] { simEnable, simStep,
tickEnable, tickStep, tickStepMain, });
menu.getMenuBar().addEnableListener(this);
stateChanged(null);
}
示例11: computeRevertEnabled
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
private void computeRevertEnabled() {
// do this separately since it can happen rather often
Project proj = frame.getProject();
LogisimFile file = proj.getLogisimFile();
Circuit cur = proj.getCurrentCircuit();
boolean isProjectCircuit = file.contains(cur);
boolean viewAppearance = frame.getEditorView().equals(
Frame.EDIT_APPEARANCE);
boolean canRevert = isProjectCircuit && viewAppearance
&& !cur.getAppearance().isDefaultAppearance();
boolean oldValue = menubar
.isEnabled(LogisimMenuBar.REVERT_APPEARANCE);
if (canRevert != oldValue) {
menubar.setEnabled(LogisimMenuBar.REVERT_APPEARANCE, canRevert);
fireEnableChanged();
}
}
示例12: ToolboxToolbarModel
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
public ToolboxToolbarModel(MenuListener menu) {
itemAdd = new LogisimToolbarItem(menu, "projadd.gif",
LogisimMenuBar.ADD_CIRCUIT,
Strings.getter("projectAddCircuitTip"));
itemUp = new LogisimToolbarItem(menu, "projup.gif",
LogisimMenuBar.MOVE_CIRCUIT_UP,
Strings.getter("projectMoveCircuitUpTip"));
itemDown = new LogisimToolbarItem(menu, "projdown.gif",
LogisimMenuBar.MOVE_CIRCUIT_DOWN,
Strings.getter("projectMoveCircuitDownTip"));
itemDelete = new LogisimToolbarItem(menu, "projdel.gif",
LogisimMenuBar.REMOVE_CIRCUIT,
Strings.getter("projectRemoveCircuitTip"));
items = UnmodifiableList.create(new ToolbarItem[] { itemAdd, itemUp,
itemDown, itemDelete, });
menu.addEnabledListener(this);
}
示例13: ExplorerToolbarModel
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
public ExplorerToolbarModel(Frame frame, MenuListener menu) {
this.frame = frame;
itemToolbox = new LogisimToolbarItem(menu, "projtool.gif",
LogisimMenuBar.VIEW_TOOLBOX,
Strings.getter("projectViewToolboxTip"));
itemSimulation = new LogisimToolbarItem(menu, "projsim.gif",
LogisimMenuBar.VIEW_SIMULATION,
Strings.getter("projectViewSimulationTip"));
itemLayout = new LogisimToolbarItem(menu, "projlayo.gif",
LogisimMenuBar.EDIT_LAYOUT,
Strings.getter("projectEditLayoutTip"));
itemAppearance = new LogisimToolbarItem(menu, "projapp.gif",
LogisimMenuBar.EDIT_APPEARANCE,
Strings.getter("projectEditAppearanceTip"));
items = UnmodifiableList.create(new ToolbarItem[] { itemToolbox,
itemSimulation, new ToolbarSeparator(4), itemLayout,
itemAppearance, });
menu.addEnabledListener(this);
}
示例14: actionPerformed
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
Component c = tabbedPane.getSelectedComponent();
if (c instanceof JScrollPane) {
c = ((JScrollPane) c).getViewport().getView();
}
if (!(c instanceof TabInterface)) return;
TabInterface tab = (TabInterface) c;
if (src == LogisimMenuBar.CUT) {
tab.copy();
tab.delete();
} else if (src == LogisimMenuBar.COPY) {
tab.copy();
} else if (src == LogisimMenuBar.PASTE) {
tab.paste();
} else if (src == LogisimMenuBar.DELETE) {
tab.delete();
} else if (src == LogisimMenuBar.SELECT_ALL) {
tab.selectAll();
}
}
示例15: SimulationToolbarModel
import com.cburch.logisim.gui.menu.LogisimMenuBar; //导入依赖的package包/类
public SimulationToolbarModel(Project project, MenuListener menu) {
this.project = project;
simEnable = new LogisimToolbarItem(menu, "simplay.png", LogisimMenuBar.SIMULATE_ENABLE,
Strings.getter("simulateEnableStepsTip"));
simStep = new LogisimToolbarItem(menu, "simstep.png", LogisimMenuBar.SIMULATE_STEP,
Strings.getter("simulateStepTip"));
tickEnable = new LogisimToolbarItem(menu, "simtplay.png", LogisimMenuBar.TICK_ENABLE,
Strings.getter("simulateEnableTicksTip"));
tickStep = new LogisimToolbarItem(menu, "simtstep.png", LogisimMenuBar.TICK_STEP,
Strings.getter("simulateTickTip"));
items = UnmodifiableList.create(new ToolbarItem[] {
simEnable,
simStep,
tickEnable,
tickStep,
});
menu.getMenuBar().addEnableListener(this);
stateChanged(null);
}