Package java.awt

Examples of java.awt.Graphics2D.fillRoundRect()


            Insets insets = new Insets(3, 6, 3, 6);

            // draw rectangle
            g2d.setColor(new Color(0, 0, 0, 200));
            // g2d.fill3DRect(size.width / 2 - insets.left - bounds.width / 2, size.height - insets.top - insets.bottom - bounds.height - 10, bounds.width + insets.left + insets.right, bounds.height + insets.top + insets.bottom, true);
            g2d.fillRoundRect(size.width / 2 - insets.left - bounds.width / 2, size.height - insets.top - insets.bottom - bounds.height - 10, bounds.width + insets.left + insets.right, bounds.height + insets.top + insets.bottom, 8, 8);

            // draw string
            g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
            g2d.setColor(Color.white);
            g2d.setFont(font);
View Full Code Here


    for (int i = 0; i < blockSizeX; i++) {
      for (int j = 0; j < blockSizeY; j++) {
        int x = posxDupe * blockWidth;
        int y = posyDupe * blockHeight;
        if (shapeBitPattern[i][j] == 1)
          g2.fillRoundRect(x, y, blockWidth, blockHeight, 10, 10);
        // g2.clearRect(x,y,blockWidth,blockHeight);
        posxDupe++;
      }
      posyDupe++;
      posxDupe = 1;
View Full Code Here

            g.setColor(HTMLColors.white);
            g.fillRoundRect(x, y, getWidth(), getHeight(), arc, arc);

            g2d.setPaint(gp);
            g2d.fillRoundRect(offset, offset, getWidth() - (offset * 2),
                    getHeight() - (offset * 2), arc, arc);

            x = PLAYER_DETAIL_WIDTH / 4;
            y = PLAYER_DETAIL_HEIGHT / 4;

View Full Code Here

        } else if (buttonState == STATE.MIDDLE) {
            y = middle;
        }

        g2d.setColor(Color.BLACK);
        g2d.fillRoundRect(5, y, width, width, 5, 5);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        switch (buttonState) {
View Full Code Here

        } else if (on) {
            y = min;
        }

        g2d.setColor(Color.BLACK);
        g2d.fillRoundRect(5, y, width, width, 5, 5);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        setState(!isOn());
View Full Code Here

        Color topColoring = backgroundColor.darker();
        Color bottomColoring = backgroundColor.darker();
        gb.setPaint(new GradientPaint(0, INSET, topColoring, 0, buttonHeight, bottomColoring, false));

        // Paint the first layer
        gb.fillRoundRect(INSET, INSET, buttonWidth, buttonHeight, arc, arc);
        gb.setColor(Color.darkGray);
        gb.drawRoundRect(INSET, INSET, buttonWidth, buttonHeight, arc, arc);

        // set up paint data fields for second layer
        int highlightHeight = buttonHeight - (HIGHLIGHT_INSET * 2);
 
View Full Code Here

        // Paint the second layer
        gb.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .8f));
        gb.setPaint(new GradientPaint(0, INSET + HIGHLIGHT_INSET, topColoring, 0, INSET + HIGHLIGHT_INSET + (highlightHeight / 2), backgroundColor.brighter(), false));
        gb.setClip(new RoundRectangle2D.Float(INSET + HIGHLIGHT_INSET, INSET + HIGHLIGHT_INSET, highlightWidth, highlightHeight / 2, highlightHeight / 3, highlightHeight / 3));
        gb.fillRoundRect(INSET + HIGHLIGHT_INSET, INSET + HIGHLIGHT_INSET, highlightWidth, highlightHeight, highlightArc, highlightArc);

        // Blur
        ConvolveOp blurOp = new ConvolveOp(new Kernel(3, 3, BLUR));
        BufferedImage blurredImage = blurOp.filter(buffer, null);
View Full Code Here

            Graphics2D g2 = (Graphics2D) g;
            g2.addRenderingHints(renderingHints);
            g2.translate(vWidth / 2, 0);
            g2.setColor(trackColor);
            g2.fillRoundRect(0, 0, vWidth, this.getHeight(), vWidth, vWidth);
            g2.setColor(new Color(150, 150, 150));
            g2.drawRoundRect(0, 0, vWidth, this.getHeight() - 1, vWidth, vWidth);

            if (viewValue < this.getHeight() - 0.5f * this.getWidth()) {
                g2.translate(0, viewValue);
View Full Code Here

                g2.translate(0, this.getHeight() - 0.5f * this.getWidth());
            }
            g2.setPaint(new GradientPaint(
                    0, 0, this.thumbColor,
                    this.getWidth() + 10, 0, Color.black, true));
            g2.fillRoundRect(0, 0, vWidth, (int) viewExtent, vWidth, vWidth);
            g2.setColor(new Color(250, 250, 250, 100));
            g2.drawRoundRect(0, 0, vWidth, (int) viewExtent, vWidth, vWidth);

        }
    }
View Full Code Here

        Graphics2D g2 = (Graphics2D) g;
        g2.addRenderingHints(renderingHints);
        g2.translate(0, vHeight / 2);

        g2.setColor(trackColor);
        g2.fillRoundRect(0, 0, this.getWidth(), vHeight, vHeight, vHeight);
        g2.setColor(new Color(150, 150, 150));
        g2.drawRoundRect(0, 0, this.getWidth() - 1, vHeight, vHeight, vHeight);

        if (viewValue < this.getWidth() - 0.5f * this.getHeight()) {
            g2.translate(viewValue, 0);
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.