本文整理汇总了Java中com.cburch.logisim.circuit.CircuitMutation.execute方法的典型用法代码示例。如果您正苦于以下问题:Java CircuitMutation.execute方法的具体用法?Java CircuitMutation.execute怎么用?Java CircuitMutation.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.cburch.logisim.circuit.CircuitMutation
的用法示例。
在下文中一共展示了CircuitMutation.execute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doIt
import com.cburch.logisim.circuit.CircuitMutation; //导入方法依赖的package包/类
@Override
public void doIt(Project proj) {
CircuitMutation xn = new CircuitMutation(circuit);
int len = values.size();
oldValues.clear();
for (int i = 0; i < len; i++) {
Component comp = comps.get(i);
Attribute<Object> attr = attrs.get(i);
Object value = values.get(i);
if (circuit.contains(comp)) {
oldValues.add(null);
xn.set(comp, attr, value);
} else {
AttributeSet compAttrs = comp.getAttributeSet();
oldValues.add(compAttrs.getValue(attr));
compAttrs.setValue(attr, value);
}
}
if (!xn.isEmpty()) {
CircuitTransactionResult result = xn.execute();
xnReverse = result.getReverseTransaction();
}
}
示例2: doIt
import com.cburch.logisim.circuit.CircuitMutation; //导入方法依赖的package包/类
@Override
public void doIt(Project proj) {
Clipboard clip = Clipboard.get();
Circuit circuit = proj.getCurrentCircuit();
CircuitMutation xn = new CircuitMutation(circuit);
Collection<Component> comps = clip.getComponents();
Collection<Component> toAdd = computeAdditions(comps);
if (toAdd.size() > 0) {
sel.pasteHelper(xn, toAdd);
CircuitTransactionResult result = xn.execute();
xnReverse = result.getReverseTransaction();
after = SelectionSave.create(sel);
} else {
xnReverse = null;
}
}
示例3: doIt
import com.cburch.logisim.circuit.CircuitMutation; //导入方法依赖的package包/类
@Override
public void doIt(Project proj) {
CircuitMutation xn = new CircuitMutation(circuit);
int len = values.size();
oldValues.clear();
for (int i = 0; i < len; i++) {
Component comp = comps.get(i);
Attribute<Object> attr = attrs.get(i);
Object value = values.get(i);
if (circuit.contains(comp)) {
oldValues.add(null);
xn.set(comp, attr, value);
} else {
AttributeSet compAttrs = comp.getAttributeSet();
oldValues.add(compAttrs.getValue(attr));
compAttrs.setValue(attr, value);
}
}
if (!xn.isEmpty()) {
CircuitTransactionResult result = xn.execute();
xnReverse = result.getReverseTransaction();
}
}
示例4: doIt
import com.cburch.logisim.circuit.CircuitMutation; //导入方法依赖的package包/类
@Override
public void doIt(Project proj) {
Circuit circuit = proj.getCurrentCircuit();
CircuitMutation xn = new CircuitMutation(circuit);
sel.dropAll(xn);
CircuitTransactionResult result = xn.execute();
xnReverse = result.getReverseTransaction();
}