Package java.awt

Examples of java.awt.Graphics2D.drawRoundRect()


        g2 = (Graphics2D)img2.getGraphics();
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setClip(0,28,IMG_SIZE,1);
        g2.setColor(getLighter(c.getBackground(),0.90f));
        g2.drawRoundRect(2,1,25,25,RADIUS,RADIUS);
        g2.dispose();
        // draw final image
        if (width != IMG_SIZE || height != IMG_SIZE){
            ImageScalingHelper.paint(g,0,0,width,height,img2, INSETS, INSETS,
                    ImageScalingHelper.PaintType.PAINT9_STRETCH,
View Full Code Here


        g2d.setPaint(paint);
        g2d.fillRoundRect(x, y, width-1, height-1, 10, 10);
       
        g2d.setColor(Color.LIGHT_GRAY);
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.drawRoundRect(x, y, width-1, height-1, 10, 10);
        g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f));
        g2d.drawRoundRect(x+1, y+1, width-1, height-1, 10, 10);
   }

    @Override
View Full Code Here

       
        g2d.setColor(Color.LIGHT_GRAY);
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.drawRoundRect(x, y, width-1, height-1, 10, 10);
        g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f));
        g2d.drawRoundRect(x+1, y+1, width-1, height-1, 10, 10);
   }

    @Override
    public Insets getBorderInsets(Component c){
        return insets;
View Full Code Here

        //////////////////////////////////////////////////////////////////
        // draw border
        g2.setStroke(new BasicStroke(1.5f));
        g2.setColor(Color.BLACK);
        g2.drawRoundRect(x, y, w, h, arc, arc);
        // ////////////////////////////////////////////////////////////////

        g2.dispose();
    }
View Full Code Here

            BasicStroke bStroke = new BasicStroke(stroke_width);
            graphics.setColor(ColorMapper.getColorByName(stroke));
            graphics.setStroke(bStroke);

            if ((arcwidth != 0) || (archeight != 0)) {
                graphics.drawRoundRect(0, 0, width, height, arcwidth, archeight);
            } else {
                graphics.drawRect(0, 0, width, height);
            }
        }
View Full Code Here

        Shape clip = g2d.getClip();
        g2d.clip(r2d);
        g2d.fillRect(0, 0, w, h);
        g2d.setClip(clip);
        g2d.setPaint(p1);
        g2d.drawRoundRect(0, 0, w - 1, h - 1, outerRoundRectSize,
                outerRoundRectSize);
        g2d.setPaint(p2);
        g2d.drawRoundRect(1, 1, w - 3, h - 3, innerRoundRectSize,
                innerRoundRectSize);
        g2d.dispose();
View Full Code Here

        g2d.setClip(clip);
        g2d.setPaint(p1);
        g2d.drawRoundRect(0, 0, w - 1, h - 1, outerRoundRectSize,
                outerRoundRectSize);
        g2d.setPaint(p2);
        g2d.drawRoundRect(1, 1, w - 3, h - 3, innerRoundRectSize,
                innerRoundRectSize);
        g2d.dispose();

        super.paintComponent(g);
    }
View Full Code Here

        // paint borders
        g2d.setStroke(new BasicStroke(4));
        g2d.setColor(new Color(196, 196, 196, 128));
        for (MapItem item : items) {
            Rectangle r = item.area;
            g2d.drawRoundRect(r.x, r.y, r.width, r.height, DRAWING_ARC_SIZE, DRAWING_ARC_SIZE);
        }

        // paint active overlay and border
        if (active != null) {
            // draw image
View Full Code Here

            // draw border
            g2d.setStroke(new BasicStroke(4));
            g2d.setColor(new Color(255, 255, 255, 164));
            Rectangle r = active.area;
            g2d.drawRoundRect(r.x, r.y, r.width, r.height, DRAWING_ARC_SIZE, DRAWING_ARC_SIZE);

            // draw tooltiptext
            Dimension size = getSize();
            Font font = UIManager.getFont("Label.font");
            // font = font.deriveFont(Font.BOLD, 16);
View Full Code Here

        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
       
        Color color = newBrightness(c.getBackground(), -.3f);
       
        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));       
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.