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


Java AppearancePort类代码示例

本文整理汇总了Java中com.cburch.logisim.circuit.appear.AppearancePort的典型用法代码示例。如果您正苦于以下问题:Java AppearancePort类的具体用法?Java AppearancePort怎么用?Java AppearancePort使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AppearancePort类属于com.cburch.logisim.circuit.appear包,在下文中一共展示了AppearancePort类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldShowPopup

import com.cburch.logisim.circuit.appear.AppearancePort; //导入依赖的package包/类
private Set<AppearancePort> shouldShowPopup(Collection<CanvasObject> add) {
	boolean found = false;
	for (CanvasObject o : add) {
		if (o instanceof AppearancePort) {
			found = true;
			break;
		}
	}
	if (found) {
		Set<AppearancePort> ports = getSelectedPorts();
		if (!ports.isEmpty() && isPortUnselected(ports)) {
			return ports;
		}
	}
	return null;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:17,代码来源:LayoutPopupManager.java

示例2: showPopup

import com.cburch.logisim.circuit.appear.AppearancePort; //导入依赖的package包/类
private void showPopup(Set<AppearancePort> portObjects) {
	dragStart = null;
	CircuitState circuitState = canvas.getCircuitState();
	if (circuitState == null)
		return;
	ArrayList<Instance> ports = new ArrayList<Instance>(portObjects.size());
	for (AppearancePort portObject : portObjects) {
		ports.add(portObject.getPin());
	}

	hideCurrentPopup();
	LayoutThumbnail layout = new LayoutThumbnail();
	layout.setCircuit(circuitState, ports);
	JViewport owner = canvasPane.getViewport();
	Point ownerLoc = owner.getLocationOnScreen();
	Dimension ownerDim = owner.getSize();
	Dimension layoutDim = layout.getPreferredSize();
	int x = ownerLoc.x + Math.max(0, ownerDim.width - layoutDim.width - 5);
	int y = ownerLoc.y + Math.max(0, ownerDim.height - layoutDim.height - 5);
	PopupFactory factory = PopupFactory.getSharedInstance();
	Popup popup = factory.getPopup(canvasPane.getViewport(), layout, x, y);
	popup.show();
	curPopup = popup;
	curPopupTime = System.currentTimeMillis();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:26,代码来源:LayoutPopupManager.java

示例3: showPopup

import com.cburch.logisim.circuit.appear.AppearancePort; //导入依赖的package包/类
private void showPopup(Set<AppearancePort> portObjects) {
	dragStart = null;
	CircuitState circuitState = canvas.getCircuitState();
	if (circuitState == null)
		return;
	ArrayList<Instance> ports = new ArrayList<Instance>(portObjects.size());
	for (AppearancePort portObject : portObjects) {
		ports.add(portObject.getPin());
	}

	hideCurrentPopup();
	LayoutThumbnail layout = new LayoutThumbnail();
	layout.setCircuit(circuitState, ports);
	JViewport owner = canvasPane.getViewport();
	Point ownerLoc = owner.getLocationOnScreen();
	Dimension ownerDim = owner.getSize();
	Dimension layoutDim = layout.getPreferredSize();
	int x = ownerLoc.x + Math.max(0, ownerDim.width - layoutDim.width - 5);
	int y = ownerLoc.y
			+ Math.max(0, ownerDim.height - layoutDim.height - 5);
	PopupFactory factory = PopupFactory.getSharedInstance();
	Popup popup = factory.getPopup(canvasPane.getViewport(), layout, x, y);
	popup.show();
	curPopup = popup;
	curPopupTime = System.currentTimeMillis();
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:27,代码来源:LayoutPopupManager.java

示例4: showPopup

import com.cburch.logisim.circuit.appear.AppearancePort; //导入依赖的package包/类
private void showPopup(Set<AppearancePort> portObjects) {
	dragStart = null;
	CircuitState circuitState = canvas.getCircuitState();
	if (circuitState == null) return;
	ArrayList<Instance> ports = new ArrayList<Instance>(portObjects.size());
	for (AppearancePort portObject : portObjects) {
		ports.add(portObject.getPin());
	}
	
	hideCurrentPopup();
	LayoutThumbnail layout = new LayoutThumbnail();
	layout.setCircuit(circuitState, ports);
	JViewport owner = canvasPane.getViewport();
	Point ownerLoc = owner.getLocationOnScreen();
	Dimension ownerDim = owner.getSize();
	Dimension layoutDim = layout.getPreferredSize();
	int x = ownerLoc.x + Math.max(0, ownerDim.width - layoutDim.width - 5);
	int y = ownerLoc.y + Math.max(0, ownerDim.height - layoutDim.height - 5);
	PopupFactory factory = PopupFactory.getSharedInstance();
	Popup popup = factory.getPopup(canvasPane.getViewport(), layout, x, y);
	popup.show();
	curPopup = popup;
	curPopupTime = System.currentTimeMillis();
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:25,代码来源:LayoutPopupManager.java

示例5: getSelectedPorts

import com.cburch.logisim.circuit.appear.AppearancePort; //导入依赖的package包/类
private Set<AppearancePort> getSelectedPorts() {
	HashSet<AppearancePort> ports = new HashSet<AppearancePort>();
	for (CanvasObject o : canvas.getSelection().getSelected()) {
		if (o instanceof AppearancePort) {
			ports.add((AppearancePort) o);
		}
	}
	return ports;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:10,代码来源:LayoutPopupManager.java

示例6: isPortUnselected

import com.cburch.logisim.circuit.appear.AppearancePort; //导入依赖的package包/类
private boolean isPortUnselected(Set<AppearancePort> selected) {
	for (CanvasObject o : canvas.getModel().getObjectsFromBottom()) {
		if (o instanceof AppearancePort) {
			if (!selected.contains(o)) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:11,代码来源:LayoutPopupManager.java

示例7: selectionChanged

import com.cburch.logisim.circuit.appear.AppearancePort; //导入依赖的package包/类
@Override
public void selectionChanged(SelectionEvent e) {
	int act = e.getAction();
	if (act == SelectionEvent.ACTION_ADDED) {
		Set<AppearancePort> ports = shouldShowPopup(e.getAffected());
		if (ports == null) {
			hideCurrentPopup();
		} else {
			showPopup(ports);
		}
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:13,代码来源:LayoutPopupManager.java

示例8: selectionChanged

import com.cburch.logisim.circuit.appear.AppearancePort; //导入依赖的package包/类
public void selectionChanged(SelectionEvent e) {
	int act = e.getAction();
	if (act == SelectionEvent.ACTION_ADDED) {
		Set<AppearancePort> ports = shouldShowPopup(e.getAffected());
		if (ports == null) {
			hideCurrentPopup();
		} else {
			showPopup(ports);
		}
	}
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:12,代码来源:LayoutPopupManager.java


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