Package java.awt

Examples of java.awt.Graphics2D.fillRoundRect()


                g2.setColor(canvas.getColor());
            } else {
                g2.setColor(highlight);
                //g2.setColor(canvas.getColor());
            }
            g2.fillRoundRect(0, 0, this.getWidth() - 2, 2 * this.getHeight(), this.getHeight(), this.getHeight());
            if (highlight == null) {
                g2.setStroke(new BasicStroke(2));
                g2.setColor(new Color(255, 255, 255, 100));
            } else {
                g2.setStroke(new BasicStroke(2));
View Full Code Here


                    gb.drawRoundRect(INSET, INSET, buttonWidth, buttonHeight, arc, arc);
                    gb.setStroke(new BasicStroke(1));
                }
                // Paint the first layer
                gb.setColor(canvas.getColor().darker());
                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
View Full Code Here

                // Paint the second layer
                gb.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .8f));

                gb.setColor(canvas.getColor());
                gb.setClip(new RoundRectangle2D.Float(INSET, INSET, highlightWidth, highlightHeight, highlightArc, highlightArc));
                gb.fillRoundRect(INSET, INSET, buttonWidth, buttonHeight, arc, arc);

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

                RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);


        g2.setColor(Color.white);
        g2.fillRoundRect(0, 0, w, h, h, h);

        if (mouseover) {
            if (pressed) {
                g2.setColor(new Color(170, 0, 0));
            } else {
View Full Code Here

            topColoring = this.buttonColor;
            bottomColoring = this.buttonColor;
        }
        // Paint the first layer
        g2.setPaint(new GradientPaint(0, 0, topColoring, 0, buttonHeight, bottomColoring, false));
        g2.fillRoundRect(INSET, INSET, buttonWidth, buttonHeight + arc, arc, arc);
        g2.setColor(Color.darkGray);
        g2.drawRoundRect(INSET, INSET, buttonWidth, buttonHeight + arc, arc, arc);

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

            topColoring = Color.gray;
            bottomColoring = Color.darkGray;
        }
        // Paint the second layer
        g2.setPaint(new GradientPaint(0, 0, topColoring, 0, buttonHeight, bottomColoring, false));
        g2.fillRoundRect(INSET + HIGHLIGHT_INSET, INSET + HIGHLIGHT_INSET + 1, highlightWidth, highlightHeight, arc, arc);
        //g2.setColor(Color.gray);
        //g2.drawRoundRect(INSET+HIGHLIGHT_INSET,INSET+HIGHLIGHT_INSET,highlightWidth,highlightHeight,arc,arc);


        // Draw the text (if any)
View Full Code Here

                topColoring = this.buttonColor;
                bottomColoring = this.buttonColor;
            }
            // Paint the first layer
            g2.setPaint(new GradientPaint(0, 0, topColoring, 0, buttonHeight, bottomColoring, false));
            g2.fillRoundRect(INSET, INSET, buttonWidth, buttonHeight, arc, arc);
            g2.setColor(Color.darkGray);
            g2.drawRoundRect(INSET, INSET, buttonWidth, buttonHeight, arc, arc);

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

                topColoring = Color.white;
                bottomColoring = Color.darkGray;
            }
            // Paint the second layer
            g2.setPaint(new GradientPaint(0, 0, topColoring, 0, buttonHeight, bottomColoring, false));
            g2.fillRoundRect(INSET + HIGHLIGHT_INSET, INSET + HIGHLIGHT_INSET + 1, highlightWidth, highlightHeight, arc, arc);

        }
        // Draw the text (if any)
        if (this.getText() != null) {
            g2.setColor(Color.white);
View Full Code Here

        int saturation = color.getRed() + color.getGreen() + color.getBlue();
        final Color contrast = saturation < 384 ? c.brighter() : c.darker();
        gc.setColor( color );
        gc.fillRoundRect( 0, 0, 14, 14, 2, 2);
        gc.setColor( contrast );
        gc.drawRoundRect( 0, 0, 14, 14, 2, 2 );
        return bi;
View Full Code Here

        if( c == null ) c = Color.BLACK;
        if( f == null ) f = Color.LIGHT_GRAY;
        gc.setColor(f);
        gc.fillRoundRect( 2,1, 13, 13, 2, 2 );
        gc.setColor(c);
        gc.drawRoundRect( 2,1, 13, 13, 2, 2 );
        return bi;
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.