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


Java Project.getCircuitState方法代码示例

本文整理汇总了Java中com.cburch.logisim.proj.Project.getCircuitState方法的典型用法代码示例。如果您正苦于以下问题:Java Project.getCircuitState方法的具体用法?Java Project.getCircuitState怎么用?Java Project.getCircuitState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.cburch.logisim.proj.Project的用法示例。


在下文中一共展示了Project.getCircuitState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureMenu

import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
@Override
public void configureMenu(JPopupMenu menu, Project proj) {
	this.proj = proj;
	this.frame = proj.getFrame();
	this.circState = proj.getCircuitState();

	Object attrs = instance.getAttributeSet();
	if (attrs instanceof RomAttributes) {
		((RomAttributes) attrs).setProject(proj);
	}

	boolean enabled = circState != null;
	edit = createItem(enabled, Strings.get("ramEditMenuItem"));
	clear = createItem(enabled, Strings.get("ramClearMenuItem"));
	load = createItem(enabled, Strings.get("ramLoadMenuItem"));
	save = createItem(enabled, Strings.get("ramSaveMenuItem"));

	menu.addSeparator();
	menu.add(edit);
	menu.add(clear);
	menu.add(load);
	menu.add(save);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:24,代码来源:MemMenu.java

示例2: configureMenu

import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
@Override
public void configureMenu(JPopupMenu menu, Project proj) {
	this.circState = proj.getCircuitState();
	boolean enabled = circState != null;

	this.edit = createItem(enabled, Strings.get("ramEditMenuItem"));
	menu.addSeparator();
	menu.add(this.edit);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:10,代码来源:PlaRom.java

示例3: configureMenu

import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
@Override
public void configureMenu(JPopupMenu menu, Project proj) {
	this.circState = proj.getCircuitState();
	boolean enabled = circState != null;

	this.edit = createItem(enabled, Strings.get("ramEditMenuItem"));
	this.reset = createItem(enabled, Strings.get("ramClearMenuItem"));
	menu.addSeparator();
	menu.add(this.edit);
	menu.add(this.reset);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:12,代码来源:ProgrammableGenerator.java

示例4: drawWithUserState

import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
private void drawWithUserState(Graphics base, Graphics g, Project proj) {
	Circuit circ = proj.getCurrentCircuit();
	Selection sel = proj.getSelection();
	Set<Component> hidden;
	Tool dragTool = canvas.getDragTool();
	if (dragTool == null) {
		hidden = NO_COMPONENTS;
	} else {
		hidden = dragTool.getHiddenComponents(canvas);
		if (hidden == null)
			hidden = NO_COMPONENTS;
	}

	// draw halo around component whose attributes we are viewing
	boolean showHalo = AppPreferences.ATTRIBUTE_HALO.getBoolean();
	if (showHalo && haloedComponent != null && haloedCircuit == circ && !hidden.contains(haloedComponent)) {
		GraphicsUtil.switchToWidth(g, 3);
		g.setColor(Canvas.HALO_COLOR);
		Bounds bds = haloedComponent.getBounds(g).expand(5);
		int w = bds.getWidth();
		int h = bds.getHeight();
		double a = Canvas.SQRT_2 * w;
		double b = Canvas.SQRT_2 * h;
		g.drawOval((int) Math.round(bds.getX() + w / 2.0 - a / 2.0),
				(int) Math.round(bds.getY() + h / 2.0 - b / 2.0), (int) Math.round(a), (int) Math.round(b));
		GraphicsUtil.switchToWidth(g, 1);
		g.setColor(Color.BLACK);
	}

	// draw circuit and selection
	CircuitState circState = proj.getCircuitState();
	boolean printerView = AppPreferences.PRINTER_VIEW.getBoolean();
	ComponentDrawContext context = new ComponentDrawContext(canvas, circ, circState, base, g, printerView);
	context.setHighlightedWires(highlightedWires);
	circ.draw(context, hidden);
	sel.draw(context, hidden);

	// draw tool
	Tool tool = dragTool != null ? dragTool : proj.getTool();
	if (tool != null && !canvas.isPopupMenuUp()) {
		Graphics gCopy = g.create();
		context.setGraphics(gCopy);
		tool.draw(canvas, context);
		gCopy.dispose();
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:47,代码来源:CanvasPainter.java


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