Example usage for java.awt.geom Arc2D setArc

List of usage examples for java.awt.geom Arc2D setArc

Introduction

In this page you can find the example usage for java.awt.geom Arc2D setArc.

Prototype

public void setArc(Point2D loc, Dimension2D size, double angSt, double angExt, int closure) 

Source Link

Document

Sets the location, size, angular extents, and closure type of this arc to the specified values.

Usage

From source file:Main.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    int w = getSize().width;
    int h = getSize().height;

    Arc2D arc = new Arc2D.Double(0.0, 0.5, w, h, 0.0, 60.0, Arc2D.CHORD);

    g2.draw(arc);/*  ww w . j a v  a  2  s.c  om*/

    arc.setArc(new Point(2, 3), new Dimension(w, h), 80.0f, 110.0f, Arc2D.PIE);
    g2.fill(arc);

    arc = new Arc2D.Float(0.0f, 0.0f, w, h, 210.0f, 130.0f, Arc2D.OPEN);

    g2.draw(arc);
}