當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。