Java Draw Centered drawCenterCircle(Graphics2D g, Point p, int radius)

Here you can find the source of drawCenterCircle(Graphics2D g, Point p, int radius)

Description

Draws a circle arround the given midpoint and radius

License

Open Source License

Parameter

Parameter Description
g Graphics object
p Midpoint of the circle
radius radius of the circle

Declaration

public static void drawCenterCircle(Graphics2D g, Point p, int radius) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Graphics2D;

import java.awt.Point;

public class Main {
    /**/*  www  .  ja va2  s . c om*/
     * Draws a circle arround the given midpoint and radius
     * 
     * @param g
     *            Graphics object
     * @param p
     *            Midpoint of the circle
     * @param radius
     *            radius of the circle
     */
    public static void drawCenterCircle(Graphics2D g, Point p, int radius) {
        g.drawOval(p.x - radius, p.y - radius, 2 * radius, 2 * radius);
    }
}

Related

  1. drawCenteredCircle(Graphics2D g, int x, int y, int r)
  2. drawCenterString(Graphics g, Point p, String text)
  3. drawCentred(Graphics2D g2, String message, Rectangle2D box)
  4. drawCentredText(Graphics g, String str, int x, int y, int width, int height)