Package java.awt

Examples of java.awt.Graphics.drawRect()


    BufferedImage image = new BufferedImage( 10, 10, BufferedImage.TYPE_3BYTE_BGR );
    Graphics g = image.getGraphics();
    g.setColor( color );
    g.fillRect( 1, 1, 8, 8 );
    g.setColor( Color.DARK_GRAY );
    g.drawRect( 0, 0, 10, 10 );
    return new ImageIcon( image );
  }

  public Dimension getPreferredScrollableViewportSize()
  {
View Full Code Here


    BufferedImage image = new BufferedImage( 10, 10, BufferedImage.TYPE_3BYTE_BGR );
    Graphics g = image.getGraphics();
    g.setColor( color );
    g.fillRect( 1, 1, 8, 8 );
    g.setColor( Color.DARK_GRAY );
    g.drawRect( 0, 0, 10, 10 );
    return new ImageIcon( image );
  }

  public Dimension getPreferredScrollableViewportSize()
  {
View Full Code Here

          int x = b.getX();
          int y = b.getY();
          int w = b.getWidth();
          int h = b.getHeight();
          if (Pin.FACTORY.isInputPin(port)) {
            gCopy.drawRect(x, y, w, h);
          } else {
            if (b.getWidth() > 25) {
              gCopy.drawRoundRect(x, y, w, h, 4, 4);
            } else {
              gCopy.drawOval(x, y, w, h);
View Full Code Here

        int x, int y, AttributeSet attrs) {
    Graphics g = context.getGraphics();
    Bounds bds = getOffsetBounds(attrs);
    g.setColor(color);
    GraphicsUtil.switchToWidth(g, 2);
    g.drawRect(x + bds.getX(), y + bds.getY(),
      bds.getWidth(), bds.getHeight());
  }

  public void paintIcon(ComponentDrawContext context,
      int x, int y, AttributeSet attrs) {
View Full Code Here

    Graphics g = context.getGraphics();
    if (toolIcon != null) {
      toolIcon.paintIcon(context.getDestination(), g, x + 2, y + 2);
    } else {
      g.setColor(Color.black);
      g.drawRect(x + 5, y + 2, 11, 17);
      Value[] v = { Value.TRUE, Value.FALSE };
      for (int i = 0; i < 3; i++) {
        g.setColor(v[i % 2].getColor());
        g.fillOval(x + 5 - 1, y + 5 + 5 * i - 1, 3, 3);
        g.setColor(v[(i + 1) % 2].getColor());
View Full Code Here

    String label = painter.getAttributeValue(StdAttr.LABEL);
    if (label == null || label.equals("")) y += bds.getHeight() / 2;
    else y += 3 * bds.getHeight() / 4;
    Graphics g = painter.getGraphics();
    g.setColor(Color.RED);
    g.drawRect(x, y - 6, 10, 13);
  }
 
  @Override
  public void mousePressed(InstanceState state, MouseEvent e) {
    loc = computeStage(state, e);
View Full Code Here

    g.setColor(Color.black);
    if (output) {
      g.drawOval(4, 4, 13, 13);
    } else {
      g.drawRect(4, 4, 13, 13);
    }
    g.setColor(Value.TRUE.getColor());
    g.fillOval(7, 788);
    g.fillOval(pinx, piny, 3, 3);
  }
View Full Code Here

      } else {
        g.drawRoundRect(x + bds.getX() + 1, y + bds.getY() + 1,
          bds.getWidth() - 1, bds.getHeight() - 1, 6, 6);
      }
    } else {
      g.drawRect(x + bds.getX() + 1, y + bds.getY() + 1,
        bds.getWidth() - 1, bds.getHeight() - 1);
    }
  }

  @Override
View Full Code Here

      } else {
        g.drawRoundRect(x + 1, y + 1,
          bds.getWidth() - 1, bds.getHeight() - 1, 6, 6);
      }
    } else {
      g.drawRect(x + 1, y + 1,
        bds.getWidth() - 1, bds.getHeight() - 1);
    }
 
    painter.drawLabel();
 
View Full Code Here

  public void paintIcon(InstancePainter painter) {
    Graphics g = painter.getGraphics();
    if (toolIcon != null) {
      toolIcon.paintIcon(painter.getDestination(), g, 2, 2);
    } else {
      g.drawRect(4, 4, 13, 13);
      g.setColor(Value.FALSE.getColor());
      g.drawPolyline(new int[] { 6, 6, 10, 10, 14, 14 },
          new int[] { 10, 6, 6, 14, 14, 10 }, 6);
    }
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.