Package java.awt

Examples of java.awt.Graphics2D.drawRoundRect()


       
        g2.setColor(newAlpha(color, 40));       
        g2.drawRoundRect(x, y + 2, width - 1, height - 4, radius, radius);

        g2.setColor(newAlpha(color, 90));       
        g2.drawRoundRect(x + 1, y + 1, width - 3, height - 2, radius, radius);

        g2.setColor(newAlpha(color, 255));       
        g2.drawRoundRect(x, y, width - 1, height - 1, radius, radius);

        g2.dispose();           
View Full Code Here


        g2.setColor(newAlpha(color, 90));       
        g2.drawRoundRect(x + 1, y + 1, width - 3, height - 2, radius, radius);

        g2.setColor(newAlpha(color, 255));       
        g2.drawRoundRect(x, y, width - 1, height - 1, radius, radius);

        g2.dispose();           
    }
   
     public static Color newBrightness(Color base, float dB) {
View Full Code Here

        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);
        int highlightWidth = buttonWidth - (HIGHLIGHT_INSET * 2);
        int highlightArc = highlightHeight;
View Full Code Here

            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);
            } else {
                g2.translate(0, this.getHeight() - 0.5f * this.getWidth());
 
View Full Code Here

            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

        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);
        } else {
            g2.translate(this.getWidth() - 0.5f * this.getHeight(), 0);
View Full Code Here

        g2.setPaint(new GradientPaint(
                0, 0, this.thumbColor,
                0, this.getHeight() + 10, Color.black, true));
        g2.fillRoundRect(0, 0, (int) viewExtent, vHeight, vHeight, vHeight);
        g2.setColor(new Color(250, 250, 250, 100));
        g2.drawRoundRect(0, 0, (int) viewExtent, vHeight, vHeight, vHeight);
    }

    /**
     * returns true iff the thumb contains the specified point
     * @return true if the thumb contains the specified point
View Full Code Here

        }
        // 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;
        int highlightWidth = buttonWidth - (HIGHLIGHT_INSET * 2) + 1;
        if (this.pressed || this.selected) {
View Full Code Here

    public void paint(Graphics g) {
        super.paint(g);
        Graphics2D g2 = (Graphics2D) g;
        g2.addRenderingHints(renderingHints);
        g2.setColor(Color.gray);
        g2.drawRoundRect(0, 0, this.getWidth() - 1, this.getHeight() - 1, this.getHeight(), this.getHeight());

        double viewValue = modelToView(modelrange.getValue());
        double viewExtent = modelToView(modelrange.getExtent());
        if (viewValue < this.getWidth() - 0.5f * this.getHeight()) {
            g2.translate(viewValue, 0);
View Full Code Here

                    g2.drawString(c, x + (int) ((dx) * offsetSize), y + (int) ((dy) * offsetSize));
                }
                g2.setColor(col);
                g2.drawString(c, x, y);
            }
            g2.drawRoundRect(3, 3, w - 6, w - 6 + charSet.length * (FONT_SIZE + 3), 3, 3);
        }

        @Override
        public void paintComponent(Graphics g) {
            int w = this.getWidth();
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.