Example usage for java.awt.geom Arc2D setArcByTangent

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

Introduction

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

Prototype

public void setArcByTangent(Point2D p1, Point2D p2, Point2D p3, double radius) 

Source Link

Document

Sets the position, bounds, and angular extents of this arc to the specified value.

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);//from w w w  .  j av a  2s . c  o  m

    arc.setArcByTangent(new Point(2, 3), new Point(3, 4), new Point(3, 4), Arc2D.PIE);
    g2.fill(arc);

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

    g2.draw(arc);
}

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);
    arc.setArcType(Arc2D.PIE);//w  ww  .ja  va  2s  . c o m
    g2.draw(arc);

    arc.setArcByTangent(new Point(2, 3), new Point(3, 4), new Point(3, 4), Arc2D.PIE);
    g2.fill(arc);

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

    g2.draw(arc);
}