Examples of drawRoundRect()


Examples of java.awt.Graphics.drawRoundRect()

        g.setColor(Color.GRAY);
        if (value.getWidth() <= 1) {
            g.drawOval(x + 1, y + 1,
                bds.getWidth() - 2, bds.getHeight() - 2);
        } else {
            g.drawRoundRect(x + 1, y + 1,
                bds.getWidth() - 2, bds.getHeight() - 2, 6, 6);
        }

        g.setColor(Color.BLACK);
        painter.drawLabel();
View Full Code Here

Examples of java.awt.Graphics.drawRoundRect()

    @Override
    public void paintGhost(InstancePainter painter) {
        Graphics g = painter.getGraphics();
        GraphicsUtil.switchToWidth(g, 2);
        g.drawRoundRect(-30, -10, 30, 30, 8, 8);
    }

    @Override
    public void paintInstance(InstancePainter painter) {
        Location loc = painter.getLocation();
View Full Code Here

Examples of java.awt.Graphics2D.drawRoundRect()

  private void paintBorder(Graphics g, Dimension size) {
    Graphics2D g2d = createGraphics(g);
    try {
      g2d.setStroke(new BasicStroke(2f));
      g2d.setColor(BORDER_COLOR);
      g2d.drawRoundRect(0, 0, size.width-1, size.height-1, 9, 9);
    } finally {
      g2d.dispose();
    }
  }
View Full Code Here

Examples of java.awt.Graphics2D.drawRoundRect()

    public void paintBorder(final Component c, final Graphics g, final int x, final int y,
        final int width, final int height) {
      final Graphics2D g2 = (Graphics2D) g;
      g2.setColor(Color.darkGray);
      final int arc = 10;
      g2.drawRoundRect(x, y, width - 1, height - 1, arc, arc);
    }
  }
}
View Full Code Here

Examples of java.awt.Graphics2D.drawRoundRect()

            // Draw 'held' text rectangle and outline
            //g2d.setColor(Color.green);
            g2d.setColor(new Color(0, 120, 0));
            g2d.fillRoundRect(heldRectX, heldRectY, heldRectWidth, heldRectHeight, heldRectRadius, heldRectRadius);
            g2d.setColor(Color.white);
            g2d.drawRoundRect(heldRectX, heldRectY, heldRectWidth, heldRectHeight, heldRectRadius, heldRectRadius);

            // Draw 'held' text
            g2d.setFont(heldFont);
            g2d.setColor(Color.white);
            g2d.drawString(heldText, heldTextX, heldTextY);
View Full Code Here

Examples of java.awt.Graphics2D.drawRoundRect()

            BasicStroke b_stroke = new BasicStroke(stroke_width);
            graphics.setColor(ColorMapper.getColorByName(stroke));
            graphics.setStroke(b_stroke);

            if ((arcwidth != 0) || (archeight != 0)) {
                graphics.drawRoundRect(0, 0, width, height, arcwidth, archeight);
            } else {
                graphics.drawRect(0, 0, width, height);
            }
        }
View Full Code Here

Examples of java.awt.Graphics2D.drawRoundRect()

    g2.setColor(GENERAL_BACKGROUND_COLOR);
    g2.fillRoundRect(5, 5, getWidth() - 10, getHeight() - 10, 5, 5);
    g2.setColor(Color.BLACK);
    g2.setStroke(new BasicStroke(2));
    g2.drawRoundRect(5, 5, getWidth() - 10, getHeight() - 10, 5, 5);

    super.paint(g2);
  }

  private class LabelResult extends JLabel {
View Full Code Here

Examples of java.awt.Graphics2D.drawRoundRect()

      g2.setFont(g2.getFont().deriveFont(Font.BOLD));
      g2.setColor(TOTAL_BACKGROUND_COLOR);
      g2.fillRoundRect(5, 5, getWidth() - 10, getHeight() - 10, 5, 5);
      g2.setColor(Color.BLACK);
      g2.setStroke(new BasicStroke(2));
      g2.drawRoundRect(5, 5, getWidth() - 10, getHeight() - 10, 5, 5);

      g.setColor(TEXT_COLOR);

      FontMetrics metrics = g.getFontMetrics();
      int textWidth = metrics.stringWidth(txt);
View Full Code Here

Examples of java.awt.Graphics2D.drawRoundRect()

      // Draw border
      if ((xMin < xMax) && (yMin < yMax)) {
        g2.setColor(textBackground);
        g2.fillRoundRect((int) xMin, (int) yMin, (int) (xMax - xMin), (int) (yMax - yMin), 10, 10);
        g2.setColor(textBorder);
        g2.drawRoundRect((int) xMin, (int) yMin, (int) (xMax - xMin), (int) (yMax - yMin), 10, 10);
      }

      // Draw text
      g2.setColor(getForeground());
      if (layoutApplication != null) {
View Full Code Here

Examples of java.awt.Graphics2D.drawRoundRect()

                RenderingHints.VALUE_ANTIALIAS_ON);
       
        Color color = Utilities.deriveColorHSB(c.getBackground(), 0, 0, -.3f);
//        Color color = Color.RED;
        g2.setColor(ColorUtil.setAlpha(color, 40));       
        g2.drawRoundRect(x, y + 2, width - 1, height - 3, cornerRadius, cornerRadius);
        g2.setColor(ColorUtil.setAlpha(color, 90));       
        g2.drawRoundRect(x, y + 1, width - 1, height - 2, cornerRadius, cornerRadius);
        g2.setColor(ColorUtil.setAlpha(color, 255));       
        g2.drawRoundRect(x, y, width - 1, height - 1, cornerRadius, cornerRadius);
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.