Package java.awt

Examples of java.awt.Graphics2D.drawRoundRect()


            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);
    }

    /**
     * @param view - view value to tranform
     *
 
View Full Code Here

        Graphics2D g2 = (Graphics2D) g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        Shape arrow = this.getShape(this.dir);
        if (focus) {
            g2.setColor(Color.gray);
            g2.drawRoundRect(0, 0, w - 1, h - 1, 2 * m, 2 * m);
        }
        if (pressed) {
            //g2.setPaint(new GradientPaint(0, 0, fade, 0, this.getHeight()/2,arrowColor, true));
            g2.setColor(highlight);
            g2.fill(arrow);
View Full Code Here

        } else {
            //paint highlightlayer
            if (this.focus) {
                gb.setColor(Color.yellow);
                gb.setStroke(new BasicStroke(3));
                gb.drawRoundRect(INSET, INSET, buttonWidth, buttonHeight, arc, arc);
                gb.setStroke(new BasicStroke(1));
            }
            // Paint the first layer
            gb.setColor(buttonColor.darker());
            gb.fillRoundRect(INSET, INSET, buttonWidth, buttonHeight, arc, arc);
View Full Code Here

            }
            // Paint the first layer
            gb.setColor(buttonColor.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

            int highlightHeight = buttonHeight * 2 / 3;
            int highlightWidth = buttonWidth;
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.getWidth(), this.getWidth());

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

                g2.setStroke(new BasicStroke(2));
                //g2.setColor(new Color(canvas.getColor().getRed(), canvas.getColor().getGreen(), canvas.getColor().getBlue(), 100));
                //g2.setColor(new Color(240,240,40, 240));
                g2.setColor(new Color(0, 0, 0, 100));
            }
            g2.drawRoundRect(0, 0, this.getWidth() - 2, 2 * this.getHeight(), this.getHeight(), this.getHeight());

            //draw text
            String text = canvas.getName();
            if (text != null) {
                Font font = g2.getFont().deriveFont((float) (((float) this.getHeight()) * .4));
 
View Full Code Here

            } else {
                //paint highlightlayer
                if (this.focus) {
                    gb.setColor(Color.yellow);
                    gb.setStroke(new BasicStroke(3));
                    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);
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.