Package com.cburch.logisim.data

Examples of com.cburch.logisim.data.Direction.reverse()


  @Override
  public void paintGhost(InstancePainter painter) {
    Direction facing = painter.getAttributeValue(StdAttr.FACING);
    BitWidth select = painter.getAttributeValue(Plexers.ATTR_SELECT);
    Plexers.drawTrapezoid(painter.getGraphics(), painter.getBounds(),
        facing.reverse(), select.getWidth() == 1 ? 10 : 20);
  }

  @Override
  public void paintInstance(InstancePainter painter) {
    Graphics g = painter.getGraphics();
View Full Code Here


    GraphicsUtil.drawText(g, "0", bds.getX() + x0, bds.getY() + y0,
        halign, GraphicsUtil.V_BASELINE);
   
    // draw trapezoid, "Decd", and ports
    g.setColor(Color.BLACK);
    Plexers.drawTrapezoid(g, bds, facing.reverse(), outputs == 2 ? 10 : 20);
    GraphicsUtil.drawCenteredText(g, "Decd",
        bds.getX() + bds.getWidth() / 2,
        bds.getY() + bds.getHeight() / 2);
    painter.drawPorts();
  }
View Full Code Here

  @Override
  public void paintGhost(InstancePainter painter) {
    Direction facing = painter.getAttributeValue(StdAttr.FACING);
    BitWidth select = painter.getAttributeValue(Plexers.ATTR_SELECT);
    Plexers.drawTrapezoid(painter.getGraphics(), painter.getBounds(),
        facing.reverse(), select.getWidth() == 1 ? 10 : 20);
  }

  @Override
  public void paintInstance(InstancePainter painter) {
    Graphics g = painter.getGraphics();
View Full Code Here

    GraphicsUtil.drawText(g, "0", bds.getX() + x0, bds.getY() + y0,
        halign, GraphicsUtil.V_BASELINE);

    // draw trapezoid, "DMX" label, and ports
    g.setColor(Color.BLACK);
    Plexers.drawTrapezoid(g, bds, facing.reverse(), select.getWidth() == 1 ? 10 : 20);
    GraphicsUtil.drawCenteredText(g, "DMX",
        bds.getX() + bds.getWidth() / 2,
        bds.getY() + bds.getHeight() / 2);
    painter.drawPorts();
  }
View Full Code Here

  private void configurePorts(Instance instance) {
    Direction facing = instance.getAttributeValue(StdAttr.FACING);
    Bounds bds = getOffsetBounds(instance.getAttributeSet());
    int d = Math.max(bds.getWidth(), bds.getHeight()) - 20;
    Location loc0 = Location.create(0, 0);
    Location loc1 = loc0.translate(facing.reverse(), 20 + d);
    Location loc2;
    if (instance.getAttributeValue(ATTR_CONTROL) == LEFT_HANDED) {
      loc2 = loc0.translate(facing.reverse(), 10 + d, 10);
    } else {
      loc2 = loc0.translate(facing.reverse(), 10 + d, -10);
View Full Code Here

    int d = Math.max(bds.getWidth(), bds.getHeight()) - 20;
    Location loc0 = Location.create(0, 0);
    Location loc1 = loc0.translate(facing.reverse(), 20 + d);
    Location loc2;
    if (instance.getAttributeValue(ATTR_CONTROL) == LEFT_HANDED) {
      loc2 = loc0.translate(facing.reverse(), 10 + d, 10);
    } else {
      loc2 = loc0.translate(facing.reverse(), 10 + d, -10);
    }

    Port[] ports = new Port[3];
View Full Code Here

    Location loc1 = loc0.translate(facing.reverse(), 20 + d);
    Location loc2;
    if (instance.getAttributeValue(ATTR_CONTROL) == LEFT_HANDED) {
      loc2 = loc0.translate(facing.reverse(), 10 + d, 10);
    } else {
      loc2 = loc0.translate(facing.reverse(), 10 + d, -10);
    }

    Port[] ports = new Port[3];
    ports[0] = new Port(0, 0, Port.OUTPUT, StdAttr.WIDTH);
    ports[1] = new Port(loc1.getX(), loc1.getY(), Port.INPUT, StdAttr.WIDTH);
View Full Code Here

    private void configurePorts(Instance instance) {
        Direction facing = instance.getAttributeValue(StdAttr.FACING);
        Bounds bds = getOffsetBounds(instance.getAttributeSet());
        int d = Math.max(bds.getWidth(), bds.getHeight()) - 20;
        Location loc0 = Location.create(0, 0);
        Location loc1 = loc0.translate(facing.reverse(), 20 + d);
        Location loc2;
        if (instance.getAttributeValue(ATTR_CONTROL) == LEFT_HANDED) {
            loc2 = loc0.translate(facing.reverse(), 10 + d, 10);
        } else {
            loc2 = loc0.translate(facing.reverse(), 10 + d, -10);
View Full Code Here

        int d = Math.max(bds.getWidth(), bds.getHeight()) - 20;
        Location loc0 = Location.create(0, 0);
        Location loc1 = loc0.translate(facing.reverse(), 20 + d);
        Location loc2;
        if (instance.getAttributeValue(ATTR_CONTROL) == LEFT_HANDED) {
            loc2 = loc0.translate(facing.reverse(), 10 + d, 10);
        } else {
            loc2 = loc0.translate(facing.reverse(), 10 + d, -10);
        }

        Port[] ports = new Port[3];
View Full Code Here

        Location loc1 = loc0.translate(facing.reverse(), 20 + d);
        Location loc2;
        if (instance.getAttributeValue(ATTR_CONTROL) == LEFT_HANDED) {
            loc2 = loc0.translate(facing.reverse(), 10 + d, 10);
        } else {
            loc2 = loc0.translate(facing.reverse(), 10 + d, -10);
        }

        Port[] ports = new Port[3];
        ports[0] = new Port(0, 0, Port.OUTPUT, StdAttr.WIDTH);
        ports[1] = new Port(loc1.getX(), loc1.getY(), Port.INPUT, StdAttr.WIDTH);
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.