Java Graphics Draw paintOval(int x, int y, Color c, int size, Graphics g)

Here you can find the source of paintOval(int x, int y, Color c, int size, Graphics g)

Description

paint Oval

License

Open Source License

Declaration

public static void paintOval(int x, int y, Color c, int size, Graphics g) 

Method Source Code


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

import java.awt.*;

public class Main {
    public static void paintOval(int x, int y, Color c, int size, Graphics g) {
        g.setColor(c);/*from   ww  w  . j  ava2 s  . c o  m*/
        Point pos = getMapPos(x, y);
        g.fillOval(pos.x - (size / 2), pos.y - (size / 2), size, size);
    }

    public static Point getMapPos(int x, int y) {
        return new Point(-y, x);
    }
}

Related

  1. paintCross(Graphics g, Color color, int centerX, int centerY, int size, int width)
  2. paintFilthyPanel(Graphics g, int width, int height)
  3. paintFocus(Graphics g, int x, int y, int width, int height, int r1, int r2, float grosor, Color color)
  4. paintKnurl3(java.awt.Graphics g2, float x, float y, float width, float height)
  5. paintLine(Graphics2D g2, Point2D.Double from, Point2D.Double to)
  6. paintPoint(java.awt.Graphics g2, int x, int y)
  7. paintRectCompartment(Graphics g, Dimension size, int x, int y, Color fillColor, Color strokeColor)
  8. paintRectShadow(Graphics g, int x, int y, int width, int height)
  9. paintShape(Shape shape, Graphics2D g2d, Color colorStroke, Stroke stroke, Color colorFill, double downsample)