Package java.awt

Examples of java.awt.Graphics.drawLine()


    if (outputs == 2) { // draw select wire
      if (painter.getShowState()) {
        g.setColor(painter.getPort(outputs).getColor());
      }
      Location pt = painter.getInstance().getPortLocation(outputs);
      g.drawLine(pt.getX(), pt.getY(), pt.getX() + 2 * dx, pt.getY() + 2 * dy);
    }
    if (enable) {
      Location en = painter.getInstance().getPortLocation(outputs + 1);
      int len = outputs == 2 ? 6 : 4;
      if (painter.getShowState()) {
View Full Code Here


      Location en = painter.getInstance().getPortLocation(outputs + 1);
      int len = outputs == 2 ? 6 : 4;
      if (painter.getShowState()) {
        g.setColor(painter.getPort(outputs + 1).getColor());
      }
      g.drawLine(en.getX(), en.getY(), en.getX() + len * dx, en.getY() + len * dy);
    }
    GraphicsUtil.switchToWidth(g, 1);
   
    // draw a circle indicating where the select input is located
    Multiplexer.drawSelectCircle(g, bds, painter.getInstance().getPortLocation(outputs));
View Full Code Here

        Location p = painter.getLocation();
        int px = p.getX();
        int py = p.getY();
        GraphicsUtil.switchToWidth(g, Wire.WIDTH);
        g.setColor(Value.TRUE_COLOR);
        if (facing == Direction.NORTH) g.drawLine(px, py, px, py + 10);
        else                          g.drawLine(px, py, px + 10, py);
        GraphicsUtil.switchToWidth(g, 1);
      }
     
      g.setColor(color);
View Full Code Here

        int px = p.getX();
        int py = p.getY();
        GraphicsUtil.switchToWidth(g, Wire.WIDTH);
        g.setColor(Value.TRUE_COLOR);
        if (facing == Direction.NORTH) g.drawLine(px, py, px, py + 10);
        else                          g.drawLine(px, py, px + 10, py);
        GraphicsUtil.switchToWidth(g, 1);
      }
     
      g.setColor(color);
      g.fillRect(x, y, w - DEPTH, h - DEPTH);
View Full Code Here

      g.fillPolygon(xp, yp, xp.length);
      g.setColor(color);
      g.fillRect(x, y, w - DEPTH, h - DEPTH);
      g.setColor(Color.BLACK);
      g.drawRect(x, y, w - DEPTH, h - DEPTH);
      g.drawLine(x + w - DEPTH, y + h - DEPTH, x + w, y + h);
      g.drawPolygon(xp, yp, xp.length);
    }
   
    g.translate(depress, depress);
    g.setColor(painter.getAttributeValue(Io.ATTR_LABEL_COLOR));
View Full Code Here

    int len = attrs.getValue(Wire.len_attr).intValue();

    g.setColor(color);
    GraphicsUtil.switchToWidth(g, 3);
    if (dir == Wire.VALUE_HORZ) {
      g.drawLine(x, y, x + len, y);
    } else {
      g.drawLine(x, y, x, y + len);
    }
  }
}
View Full Code Here

    g.setColor(color);
    GraphicsUtil.switchToWidth(g, 3);
    if (dir == Wire.VALUE_HORZ) {
      g.drawLine(x, y, x + len, y);
    } else {
      g.drawLine(x, y, x, y + len);
    }
  }
}
View Full Code Here

  public void paintIcon(ComponentDrawContext c, int x, int y) {
    Graphics g = c.getGraphics();
    g.fillRect(x + 2, y + 1, 9, 2);
    g.drawRect(x + 2, y + 3, 15, 12);
    g.setColor(Color.lightGray);
    g.drawLine(x + 4, y + 2, x + 8, y + 2);
    for (int y_offs = y + 6; y_offs < y + 15; y_offs += 3) {
      g.drawLine(x + 4, y_offs, x + 14, y_offs);
    }
  }
}
View Full Code Here

    g.fillRect(x + 2, y + 1, 9, 2);
    g.drawRect(x + 2, y + 3, 15, 12);
    g.setColor(Color.lightGray);
    g.drawLine(x + 4, y + 2, x + 8, y + 2);
    for (int y_offs = y + 6; y_offs < y + 15; y_offs += 3) {
      g.drawLine(x + 4, y_offs, x + 14, y_offs);
    }
  }
}
View Full Code Here

    if (outputs == 2) { // draw select wire
      Location sel = painter.getInstance().getPortLocation(outputs);
      if (painter.getShowState()) {
        g.setColor(painter.getPort(outputs).getColor());
      }
      g.drawLine(sel.getX(), sel.getY(), sel.getX() + 2 * dx, sel.getY() + 2 * dy);
    }
    if (enable) {
      Location en = painter.getInstance().getPortLocation(outputs + 1);
      if (painter.getShowState()) {
        g.setColor(painter.getPort(outputs + 1).getColor());
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.