Examples of FillRect()


Examples of java.awt.Graphics.fillRect()

      int[] xp = new int[] { x, x + w - DEPTH, x + w, x + w, x + DEPTH, x };
      int[] yp = new int[] { y, y, y + DEPTH, y + h, y + h, y + h - DEPTH };
      g.setColor(color.darker());
      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);
    }
View Full Code Here

Examples of java.awt.Graphics.fillRect()

      BufferedImage img = new BufferedImage(width, height,
          BufferedImage.TYPE_INT_RGB);
      Graphics base = img.getGraphics();
      Graphics g = base.create();
      g.setColor(Color.white);
      g.fillRect(0, 0, width, height);
      g.setColor(Color.black);
      if (g instanceof Graphics2D) {
        ((Graphics2D) g).scale(scale, scale);
        ((Graphics2D) g).translate(-bds.getX(), -bds.getY());
      } else {
View Full Code Here

Examples of java.awt.Graphics.fillRect()

  }

  @Override
  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

Examples of java.awt.Graphics.fillRect()

          if (val == Value.TRUE) c = onColor;
          else if (val == Value.FALSE) c = offColor;
          else c = Value.ERROR_COLOR;
          g.setColor(c);
         
          if (drawSquare) g.fillRect(x, y, 10, 10);
          else g.fillOval(x + 1, y + 1, 8, 8);
        } else {
          g.setColor(Color.GRAY);
          g.fillOval(x + 1, y + 1, 8, 8);
        }
View Full Code Here

Examples of java.awt.Graphics.fillRect()

    Color onColor = painter.getAttributeValue(Io.ATTR_ON_COLOR);
    Color offColor = painter.getAttributeValue(Io.ATTR_OFF_COLOR);
    Color bgColor = painter.getAttributeValue(Io.ATTR_BACKGROUND);
    if (painter.shouldDrawColor() && bgColor.getAlpha() != 0) {
      g.setColor(bgColor);
      g.fillRect(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight());
      g.setColor(Color.BLACK);
    }
    painter.drawBounds();
    g.setColor(Color.DARK_GRAY);
    for (int i = 0; i <= 7; i++) {
View Full Code Here

Examples of java.awt.Graphics.fillRect()

      if (painter.getShowState()) {
        g.setColor(((summ >> i) & 1) == desired ? onColor : offColor);
      }
      if (i < 7) {
        Bounds seg = SEGMENTS[i];
        g.fillRect(x + seg.getX(), y + seg.getY(), seg.getWidth(), seg.getHeight());
      } else {
        g.fillOval(x + 28, y + 48, 5, 5); // draw decimal point
      }
    }
    painter.drawPorts();
View Full Code Here

Examples of java.awt.Graphics.fillRect()

      Location loc = painter.getLocation();
      int x = loc.getX();
      int y = loc.getY();
      Graphics g = painter.getGraphics();
      g.setColor(Color.WHITE);
      g.fillRect(x - 20, y, 10, 10);
      GraphicsUtil.switchToWidth(g, 3);
      g.setColor(Color.BLACK);
      int dx = state.xPos;
      int dy = state.yPos;
      int x0 = x - 15 + (dx > 5 ? 1 : dx < -5 ? -1 : 0);
View Full Code Here

Examples of java.awt.Graphics.fillRect()

    int x = loc.getX() - 15;
    int y = loc.getY();
    Object shift = painter.getAttributeValue(ATTR_SHIFT);
    g.setColor(Color.BLACK);
    if (shift == SHIFT_LOGICAL_RIGHT) {
      g.fillRect(x, y - 1, 8, 3);
      drawArrow(g, x + 10, y, -4);
    } else if (shift == SHIFT_ARITHMETIC_RIGHT) {
      g.fillRect(x, y - 1, 2, 3);
      g.fillRect(x + 3, y - 1, 5, 3);
      drawArrow(g, x + 10, y, -4);
View Full Code Here

Examples of java.awt.Graphics.fillRect()

    g.setColor(Color.BLACK);
    if (shift == SHIFT_LOGICAL_RIGHT) {
      g.fillRect(x, y - 1, 8, 3);
      drawArrow(g, x + 10, y, -4);
    } else if (shift == SHIFT_ARITHMETIC_RIGHT) {
      g.fillRect(x, y - 1, 2, 3);
      g.fillRect(x + 3, y - 1, 5, 3);
      drawArrow(g, x + 10, y, -4);
    } else if (shift == SHIFT_ROLL_RIGHT) {
      g.fillRect(x, y - 1, 5, 3);
      g.fillRect(x + 8, y - 7, 2, 8);
View Full Code Here

Examples of java.awt.Graphics.fillRect()

    if (shift == SHIFT_LOGICAL_RIGHT) {
      g.fillRect(x, y - 1, 8, 3);
      drawArrow(g, x + 10, y, -4);
    } else if (shift == SHIFT_ARITHMETIC_RIGHT) {
      g.fillRect(x, y - 1, 2, 3);
      g.fillRect(x + 3, y - 1, 5, 3);
      drawArrow(g, x + 10, y, -4);
    } else if (shift == SHIFT_ROLL_RIGHT) {
      g.fillRect(x, y - 1, 5, 3);
      g.fillRect(x + 8, y - 7, 2, 8);
      g.fillRect(x, y - 7, 2, 8);
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.