Example usage for java.awt.geom Arc2D.Float setAngleExtent

List of usage examples for java.awt.geom Arc2D.Float setAngleExtent

Introduction

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

Prototype

public abstract void setAngleExtent(double angExt);

Source Link

Document

Sets the angular extent of this arc to the specified double value.

Usage

From source file:MyCanvas.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    // Draw the pie chart
    Arc2D.Float arc = new Arc2D.Float(Arc2D.PIE);
    arc.setFrame(140, 200, 67, 46);//from   ww w . j av a 2  s  .  c  o  m
    arc.setAngleStart(45);
    arc.setAngleExtent(270);
    g2.setColor(Color.gray);
    g2.draw(arc);
    g2.setColor(Color.red);
    g2.fill(arc);
    g2.setColor(Color.black);
    g2.drawString("Arc2D.PIE", 140, 190);
}

From source file:MyCanvas.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    //Draw the open arc 
    Arc2D.Float arc = new Arc2D.Float(Arc2D.OPEN);
    arc.setFrame(140, 100, 67, 46);/*from  w  w w. jav a  2  s.co  m*/
    arc.setAngleStart(45);
    arc.setAngleExtent(270);
    g2.setColor(Color.gray);
    g2.draw(arc);
    g2.setColor(Color.green);
    g2.fill(arc);
    g2.setColor(Color.black);
    g2.drawString("Arc2D.OPEN", 140, 90);
}

From source file:MyCanvas.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    //Draw the chord

    Arc2D.Float arc1 = new Arc2D.Float(Arc2D.CHORD);
    arc1.setFrame(140, 30, 67, 46);/*from w w  w  .  j a va2  s .c  om*/
    arc1.setAngleStart(45);
    arc1.setAngleExtent(270);
    g2.setColor(Color.blue);
    g2.draw(arc1);
    g2.setColor(Color.gray);
    g2.fill(arc1);
    g2.setColor(Color.black);
    g2.drawString("Arc2D.CHORD", 140, 20);
}

From source file:MyCanvas.java

public void draw(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    // Draw the pie chart
    Arc2D.Float arc = new Arc2D.Float(Arc2D.PIE);
    arc.setFrame(140, 200, 67, 46);//www  .j a  v a2s. c o  m
    arc.setAngleStart(45);
    arc.setAngleExtent(270);
    g2.setColor(Color.gray);
    g2.draw(arc);
    g2.setColor(Color.red);
    g2.fill(arc);
    g2.setColor(Color.black);
    g2.drawString("Arc2D.PIE", 140, 190);
}