Package java.awt

Examples of java.awt.Graphics2D.drawArc()


            g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
            g.setFont(font.deriveFont(Font.BOLD, getIconWidth()*3/4));
            g.setColor(Color.green.darker());
            final int SW = Math.max(getIconWidth()/10, 4);
            g.setStroke(new BasicStroke(SW));
            g.drawArc(SW/2, SW/2, getIconWidth()-SW-1, getIconHeight()-SW-1, 0, 360);
            Rectangle2D bounds =
                font.getStringBounds("i", g.getFontRenderContext());
            g.drawString("i", Math.round((getIconWidth() - bounds.getWidth())/2 - getIconWidth()/12),
                         SW/2 + Math.round((getIconHeight()-bounds.getHeight())/2 - bounds.getY() + getIconHeight()/8));
            g.dispose();
View Full Code Here


        g.fillArc(circ_x, circ_y, circ_w, circ_w, curr_angle, 360 - curr_angle);
        drawLegendLine(g, 5, height - 5 - 15 * i, fillRest.getPieceName()+" ("+fillRest.getFractionPercent()+" %)", fillRest.getColor());

        //draw border around the circle
        g.setColor(Color.decode("0x"+COL_BORDER));
        g.drawArc(circ_x, circ_y, circ_w, circ_w, 0, 360);

        peerloadPictureDate = System.currentTimeMillis();
    }

    private static void drawLegendLine(final Graphics2D g, final int x, final int y, final String caption, final Color item_color) {
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.