Examples of Port


Examples of archmapper.main.model.architecture.Port

    }

    addProperties(component, acmeComp.getProperties());

    for (IAcmePort acmePort : acmeComp.getPorts()) {
      Port port = new Port();
      port.setParent(component);
      component.getPorts().add(port);

      port.setName(acmePort.getName());

      if (acmePort.getDeclaredTypes().size() > 0) {
        IAcmeElementTypeRef<IAcmePortType> type = acmePort
            .getDeclaredTypes().iterator().next();
        port.setStyleType(type.getReferencedName());
      }

      addProperties(port, acmePort.getProperties());
      addPortAttachments(acmePort, port, system);
View Full Code Here

Examples of com.cburch.logisim.instance.Port

    setInstancePoker(RegisterPoker.class);
    setInstanceLogger(RegisterLogger.class);
    setKeyConfigurator(new BitWidthConfigurator(StdAttr.WIDTH));
   
    Port[] ps = new Port[7];
    ps[OUT] = new Port0,   0, Port.OUTPUT, StdAttr.WIDTH);
    ps[IN= new Port(-30,   0, Port.INPUT, StdAttr.WIDTH);
    ps[CK= new Port(-2020, Port.INPUT, 1);
    ps[CLR] = new Port(-1020, Port.INPUT, 1);
    ps[LD= new Port(-30, -10, Port.INPUT, 1);
    ps[CT= new Port(-3010, Port.INPUT, 1);
    ps[CARRY] = new Port(010, Port.OUTPUT, 1);
    ps[OUT].setToolTip(Strings.getter("counterQTip"));
    ps[IN].setToolTip(Strings.getter("counterDataTip"));
    ps[CK].setToolTip(Strings.getter("counterClockTip"));
    ps[CLR].setToolTip(Strings.getter("counterResetTip"));
    ps[LD].setToolTip(Strings.getter("counterLoadTip"));
View Full Code Here

Examples of com.cburch.logisim.instance.Port

        } else {
          end0 = Location.create(x, -30);
          end1 = Location.create(x, -10);
        }
      }
      ps[0] = new Port(end0.getX(), end0.getY(), Port.OUTPUT, 1);
      ps[1] = new Port(end1.getX(), end1.getY(), Port.OUTPUT, 1);
    } else {
      int dx;
      int ddx;
      int dy;
      int ddy;
      if (facing == Direction.NORTH || facing == Direction.SOUTH) {
        dy = facing == Direction.NORTH ? -20 : 20;
        ddy = 0;
        dx = selectLoc == Plexers.SELECT_TOP_RIGHT ? -10 * outputs : 0;
        ddx = 10;
      } else {
        dx = facing == Direction.WEST ? -20 : 20;
        ddx = 0;
        dy = selectLoc == Plexers.SELECT_TOP_RIGHT ? 0 : -10 * outputs;
        ddy = 10;
      }
      for (int i = 0; i < outputs; i++) {
        ps[i] = new Port(dx, dy, Port.OUTPUT, 1);
        dx += ddx;
        dy += ddy;
      }
    }
    Location en = Location.create(0, 0).translate(facing, -10);
    ps[outputs] = new Port(0, 0, Port.INPUT, select.getWidth());
    if (enable) {
      ps[outputs + 1] = new Port(en.getX(), en.getY(), Port.INPUT, BitWidth.ONE);
    }
    for (int i = 0; i < outputs; i++) {
      ps[i].setToolTip(Strings.getter("decoderOutTip", "" + i));
    }
    ps[outputs].setToolTip(Strings.getter("decoderSelectTip"));
View Full Code Here

Examples of com.cburch.logisim.instance.Port

        "", Io.LABEL_CENTER,
        StdAttr.DEFAULT_LABEL_FONT, Color.BLACK
      });
    setFacingAttribute(StdAttr.FACING);
    setIconName("button.gif");
    setPorts(new Port[] { new Port(0, 0, Port.OUTPUT, 1) });
    setInstancePoker(Poker.class);
    setInstanceLogger(Logger.class);
  }
View Full Code Here

Examples of com.cburch.logisim.instance.Port

    setOffsetBounds(Bounds.create(-30, -20, 30, 40));
    setIconName("random.gif");
    setInstanceLogger(Logger.class);
   
    Port[] ps = new Port[4];
    ps[OUT] = new Port0,   0, Port.OUTPUT, StdAttr.WIDTH);
    ps[CK= new Port(-30, -10, Port.INPUT, 1);
    ps[NXT] = new Port(-3010, Port.INPUT, 1);
    ps[RST] = new Port(-2020, Port.INPUT, 1);
    ps[OUT].setToolTip(Strings.getter("randomQTip"));
    ps[CK].setToolTip(Strings.getter("randomClockTip"));
    ps[NXT].setToolTip(Strings.getter("randomNextTip"));
    ps[RST].setToolTip(Strings.getter("randomResetTip"));
    setPorts(ps);
View Full Code Here

Examples of com.cburch.logisim.instance.Port

      i++;
      Location loc = portLoc.getKey();
      Instance pin = portLoc.getValue();
      String type = Pin.FACTORY.isInputPin(pin) ? Port.INPUT : Port.OUTPUT;
      BitWidth width = pin.getAttributeValue(StdAttr.WIDTH);
      ports[i] = new Port(loc.getX(), loc.getY(), type, width);
      pins[i] = pin;
     
      String label = pin.getAttributeValue(StdAttr.LABEL);
      if (label != null && label.length() > 0) {
        ports[i].setToolTip(StringUtil.constantGetter(label));
View Full Code Here

Examples of com.cburch.logisim.instance.Port

  void computePorts(Instance instance) {
    GateAttributes attrs = (GateAttributes) instance.getAttributeSet();
    int inputs = attrs.inputs;

    Port[] ports = new Port[inputs + 1];
    ports[0] = new Port(0, 0, Port.OUTPUT, StdAttr.WIDTH);
    for (int i = 0; i < inputs; i++) {
      Location offs = getInputOffset(attrs, i);
      ports[i + 1] = new Port(offs.getX(), offs.getY(), Port.INPUT, StdAttr.WIDTH);
    }
    instance.setPorts(ports);
  }
View Full Code Here

Examples of com.cburch.logisim.instance.Port

    Port[] ps;
    if (parallelObj == null || parallelObj.booleanValue()) {
      Integer lenObj = instance.getAttributeValue(ATTR_LENGTH);
      int len = lenObj == null ? 8 : lenObj.intValue();
      ps = new Port[6 + 2 * len];
      ps[LD] = new Port(10, -20, Port.INPUT, 1);
      ps[LD].setToolTip(Strings.getter("shiftRegLoadTip"));
      for (int i = 0; i < len; i++) {
        ps[6 + 2 * i]     = new Port(20 + 10 * i, -20, Port.INPUT, width);
        ps[6 + 2 * i + 1] = new Port(20 + 10 * i,  20, Port.OUTPUT, width);
      }
    } else {
      ps = new Port[5];
    }
    ps[OUT] = new Port(bds.getWidth(), 0, Port.OUTPUT, width);
    ps[SH= new Port( 0, -10, Port.INPUT, 1);
    ps[IN= new Port( 0,   0, Port.INPUT, width);
    ps[CK= new Port( 010, Port.INPUT, 1);
    ps[CLR] = new Port(1020, Port.INPUT, 1);
    ps[OUT].setToolTip(Strings.getter("shiftRegOutTip"));
    ps[SH].setToolTip(Strings.getter("shiftRegShiftTip"));
    ps[IN].setToolTip(Strings.getter("shiftRegInTip"));
    ps[CK].setToolTip(Strings.getter("shiftRegClockTip"));
    ps[CLR].setToolTip(Strings.getter("shiftRegClearTip"));
View Full Code Here

Examples of com.cburch.logisim.instance.Port

    int cols = instance.getAttributeValue(ATTR_MATRIX_COLS).intValue();
    Port[] ps;
    if (input == INPUT_COLUMN) {
      ps = new Port[cols];
      for (int i = 0; i < cols; i++) {
        ps[i] = new Port(10 * i, 0, Port.INPUT, rows);
      }
    } else if (input == INPUT_ROW) {
      ps = new Port[rows];
      for (int i = 0; i < rows; i++) {
        ps[i] = new Port(0, 10 * i, Port.INPUT, cols);
      }
    } else {
      if (rows <= 1) {
        ps = new Port[] { new Port(0, 0, Port.INPUT, cols) };
      } else if (cols <= 1) {
        ps = new Port[] { new Port(0, 0, Port.INPUT, rows) };
      } else {
        ps = new Port[] {
            new Port(0, 0, Port.INPUT, cols),
            new Port(0, 10, Port.INPUT, rows)
        };
      }
    }
    instance.setPorts(ps);
  }
View Full Code Here

Examples of com.cburch.logisim.instance.Port

    setAttributes(new Attribute[] { Io.ATTR_ON_COLOR, Io.ATTR_OFF_COLOR,
          Io.ATTR_BACKGROUND },
        new Object[] { new Color(240, 0, 0), SevenSegment.DEFAULT_OFF,
          Io.DEFAULT_BACKGROUND });
    setPorts(new Port[] {
        new Port( 0, 0, Port.INPUT, 4),
        new Port(10, 0, Port.INPUT, 1)
      });
    setOffsetBounds(Bounds.create(-15, -60, 40, 60));
    setIconName("hexdig.gif");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.