當前位置: 首頁>>代碼示例>>Java>>正文


Java SplitterFactory類代碼示例

本文整理匯總了Java中com.cburch.logisim.circuit.SplitterFactory的典型用法代碼示例。如果您正苦於以下問題:Java SplitterFactory類的具體用法?Java SplitterFactory怎麽用?Java SplitterFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SplitterFactory類屬於com.cburch.logisim.circuit包,在下文中一共展示了SplitterFactory類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addSplitters

import com.cburch.logisim.circuit.SplitterFactory; //導入依賴的package包/類
private void addSplitters() {
	SplitterFactory factory = SplitterFactory.instance;
	AttributeSet leftAttrs = factory.createAttributeSet();
	leftAttrs.setValue(SplitterAttributes.ATTR_FANOUT, bitWidth);
	leftAttrs.setValue(SplitterAttributes.ATTR_WIDTH,
			BitWidth.create(bitWidth));

	AttributeSet rightAttrs = (AttributeSet) leftAttrs.clone();
	rightAttrs.setValue(StdAttr.FACING, Direction.WEST);

	Component leftSplitter = factory.createComponent(
			Location.create(left, top), leftAttrs);
	Component rightSplitter = factory.createComponent(
			Location.create(right, top - 10 * (this.bitWidth + 1)),
			rightAttrs); // nos aseguramos que queden a la misma altura

	mutation.add(leftSplitter);
	mutation.add(rightSplitter);

	this.leftSplitter = (Splitter) leftSplitter;
	this.rightSplitter = (Splitter) rightSplitter;

}
 
開發者ID:franciscaconcha,項目名稱:ProyectoLogisim,代碼行數:24,代碼來源:MainSubcircuit.java

示例2: getSplitters

import com.cburch.logisim.circuit.SplitterFactory; //導入依賴的package包/類
public Set<Splitter> getSplitters() {
	/* This may be cause bugs due to dual splitter on same location situations */
	Set<Splitter> SplitterList = new HashSet<Splitter>();
	for (Component comp : MyCircuit.getNonWires()) {
		if (comp.getFactory() instanceof SplitterFactory) {
			SplitterList.add((Splitter) comp);
		}
	}
	return SplitterList;
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:11,代碼來源:Netlist.java


注:本文中的com.cburch.logisim.circuit.SplitterFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。