本文整理汇总了Java中com.cburch.logisim.std.wiring.PullResistor类的典型用法代码示例。如果您正苦于以下问题:Java PullResistor类的具体用法?Java PullResistor怎么用?Java PullResistor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PullResistor类属于com.cburch.logisim.std.wiring包,在下文中一共展示了PullResistor类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: add
import com.cburch.logisim.std.wiring.PullResistor; //导入依赖的package包/类
boolean add(Component comp) {
boolean added = true;
if (comp instanceof Wire) {
added = addWire((Wire) comp);
} else if (comp instanceof Splitter) {
splitters.add((Splitter) comp);
} else {
Object factory = comp.getFactory();
if (factory instanceof Tunnel) {
tunnels.add(comp);
comp.getAttributeSet().addAttributeListener(tunnelListener);
} else if (factory instanceof PullResistor) {
pulls.add(comp);
comp.getAttributeSet().addAttributeListener(tunnelListener);
}
}
if (added) {
points.add(comp);
voidBundleMap();
}
return added;
}
示例2: remove
import com.cburch.logisim.std.wiring.PullResistor; //导入依赖的package包/类
void remove(Component comp) {
if (comp instanceof Wire) {
removeWire((Wire) comp);
} else if (comp instanceof Splitter) {
splitters.remove(comp);
} else {
Object factory = comp.getFactory();
if (factory instanceof Tunnel) {
tunnels.remove(comp);
comp.getAttributeSet().removeAttributeListener(tunnelListener);
} else if (factory instanceof PullResistor) {
pulls.remove(comp);
comp.getAttributeSet().removeAttributeListener(tunnelListener);
}
}
points.remove(comp);
voidBundleMap();
}
示例3: attributeValueChanged
import com.cburch.logisim.std.wiring.PullResistor; //导入依赖的package包/类
@Override
public void attributeValueChanged(AttributeEvent e) {
Attribute<?> attr = e.getAttribute();
if (attr == StdAttr.LABEL || attr == PullResistor.ATTR_PULL_TYPE) {
voidBundleMap();
}
}
示例4: connectPullResistors
import com.cburch.logisim.std.wiring.PullResistor; //导入依赖的package包/类
private void connectPullResistors(BundleMap ret) {
for (Component comp : pulls) {
Location loc = comp.getEnd(0).getLocation();
WireBundle b = ret.getBundleAt(loc);
if (b == null) {
b = ret.createBundleAt(loc);
b.points.add(loc);
ret.setBundleAt(loc, b);
}
Instance instance = Instance.getInstanceFor(comp);
b.addPullValue(PullResistor.getPullValue(instance));
}
}
示例5: attributeValueChanged
import com.cburch.logisim.std.wiring.PullResistor; //导入依赖的package包/类
public void attributeValueChanged(AttributeEvent e) {
Attribute<?> attr = e.getAttribute();
if (attr == StdAttr.LABEL || attr == PullResistor.ATTR_PULL_TYPE) {
voidBundleMap();
}
}