Пример #1
0
 protected AbstractGate(String name, StringGetter desc, boolean isXor) {
   super(name, desc);
   this.isXor = isXor;
   setFacingAttribute(StdAttr.FACING);
   setKeyConfigurator(
       JoinedConfigurator.create(
           new IntegerConfigurator(GateAttributes.ATTR_INPUTS, 2, GateAttributes.MAX_INPUTS, 0),
           new BitWidthConfigurator(StdAttr.WIDTH)));
 }
Пример #2
0
 public BitExtender() {
   super("Bit Extender", Strings.getter("extenderComponent"));
   setIconName("extender.gif");
   setAttributes(
       new Attribute[] {ATTR_IN_WIDTH, ATTR_OUT_WIDTH, ATTR_TYPE},
       new Object[] {BitWidth.create(8), BitWidth.create(16), ATTR_TYPE.parse("sign")});
   setFacingAttribute(StdAttr.FACING);
   setKeyConfigurator(
       JoinedConfigurator.create(
           new BitWidthConfigurator(ATTR_OUT_WIDTH),
           new BitWidthConfigurator(ATTR_IN_WIDTH, 1, Value.MAX_WIDTH, 0)));
   setOffsetBounds(Bounds.create(-40, -20, 40, 40));
 }