Package java.awt

Examples of java.awt.Graphics2D.fillRoundRect()


            // You could draw on top of the image here...
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
            g2.setColor(Color.red);
            g2.setComposite(AlphaComposite.SrcOver.derive(0.3f));
            g2.fillRoundRect(100, 100, 100, 80, 32, 32);
            g2.setComposite(AlphaComposite.SrcOver);
            g2.setColor(Color.white);
            g2.setFont(font);
            g2.drawString("vlcj direct media player", 130, 150);
        }
View Full Code Here


 
  private void paintButton(Graphics g, Dimension size, Color startColor, Color endColor) {
    Graphics2D g2d = createGraphics(g);
    try {
      g2d.setPaint(new GradientPaint(0, 0, startColor, 0, size.height, endColor));
      g2d.fillRoundRect(0, 0, size.width-1, size.height-1, 9, 9);
    } finally {
      g2d.dispose();
    }
  }
View Full Code Here

            // Darken card with alpha blended overlay
            Composite composite = g2d.getComposite();
            AlphaComposite alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, cardAlpha);
            g2d.setComposite(alphaComposite);
            g2d.setColor(new Color(0, 155, 0));
            g2d.fillRoundRect(0, 0, getWidth(), getHeight(), cardRectRadius, cardRectRadius);
            g2d.setComposite(composite);

            // Draw 'held' text rectangle and outline
            //g2d.setColor(Color.green);
            g2d.setColor(new Color(0, 120, 0));
View Full Code Here

            g2d.setComposite(composite);

            // 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);
View Full Code Here

        }

        if (!fill.equals("transparent")) {
            graphics.setColor(ColorMapper.getColorByName(fill));
            if ((arcwidth != 0) || (archeight != 0)) {
                graphics.fillRoundRect(stroke_width, stroke_width,
                    width - (stroke_width * 2), height - (stroke_width * 2),
                    arcwidth, archeight);
            } else {
                graphics.fillRect(stroke_width, stroke_width,
                    width - (stroke_width * 2), height - (stroke_width * 2));
 
View Full Code Here

    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
        RenderingHints.VALUE_ANTIALIAS_ON);

    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);
View Full Code Here

      g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
          RenderingHints.VALUE_ANTIALIAS_ON);

      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);
View Full Code Here

            g2d.setColor(fSelected
                    ? getSelectedBadgeColor()
                    : getUnselectedBadgeColor(WindowUtils.isParentWindowFocused(this)));

            // draw the badge.
            g2d.fillRoundRect(0, 0, getWidth(), getHeight(), getHeight(), getHeight());

            // set the color to use for the text - note this color is always
            // the same, though it won't always show because of the composite
            // set below.
            g2d.setColor(fTextColor);
View Full Code Here

            q1 = getTransform().transform(p1);
            q2 = getTransform().transform(p2);
        }
       
        g2.setColor(getColor());
        g2.fillRoundRect((int)q1.getX(), (int)q1.getY(), (int)(q2.getX() - q1.getX()), (int)(q2.getY() - q1.getY()), 10, 10);
        g2.setColor(oldColor);
       
    }

    public String getXML() {
View Full Code Here

      }

      // 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
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.