当前位置: 首页>>代码示例>>Java>>正文


Java LogisimMenuBar类代码示例

本文整理汇总了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();
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:24,代码来源:Analyzer.java

示例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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:18,代码来源:SimulationToolbarModel.java

示例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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:27,代码来源:LayoutEditHandler.java

示例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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:22,代码来源:ProjectToolbarModel.java

示例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();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:17,代码来源:MenuListener.java

示例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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:18,代码来源:ExplorerToolbarModel.java

示例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();
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:25,代码来源:AppearanceEditPopup.java

示例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();
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:17,代码来源:HexFrame.java

示例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();
	}
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:23,代码来源:Analyzer.java

示例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);
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:24,代码来源:SimulationToolbarModel.java

示例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();
	}
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:18,代码来源:MenuListener.java

示例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);
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:20,代码来源:ToolboxToolbarModel.java

示例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);
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:23,代码来源:ExplorerToolbarModel.java

示例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();
	}
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:22,代码来源:Analyzer.java

示例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);
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:23,代码来源:SimulationToolbarModel.java


注:本文中的com.cburch.logisim.gui.menu.LogisimMenuBar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。