本文整理匯總了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;
}
示例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;
}