Example usage for java.awt Graphics drawArc

List of usage examples for java.awt Graphics drawArc

Introduction

In this page you can find the example usage for java.awt Graphics drawArc.

Prototype

public abstract void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle);

Source Link

Document

Draws the outline of a circular or elliptical arc covering the specified rectangle.

Usage

From source file:org.jcurl.mr.exp.gui.MouseSketchPanel.java

protected void paintComponent(Graphics g) {
    super.paintComponent(g);
    g.drawLine(100, 110, 100, 90);/*from  w w  w  .  j  ava  2s .  co m*/
    g.drawLine(110, 100, 90, 100);
    circle(g, 100, 100, 10, 10);
    g.drawArc(100, 100, 20, 20, 0, 360);
    g.drawArc(100, 100, -20, -20, 0, 360);
}

From source file:org.jcurl.mr.exp.gui.MouseSketchPanel.java

private static void circle(Graphics g, int x, int y, int rx, int ry) {
    g.drawArc(x - rx, y - ry, 2 * rx, 2 * ry, 0, 360);
}

From source file:org.jcurl.mr.exp.gui.MouseSketchPanel.java

private static void circle(Graphics g, Point2D c, int r) {
    final int x = (int) c.getX();
    final int y = (int) c.getY();
    final int d = 2 * r;
    g.drawArc(x - r, y - r, d, d, 0, 360);
}

From source file:org.jcurl.mr.gui.MouseSketchPanel.java

private static void circle(final Graphics g, final int x, final int y, final int rx, final int ry) {
    g.drawArc(x - rx, y - ry, 2 * rx, 2 * ry, 0, 360);
}

From source file:org.jcurl.mr.gui.MouseSketchPanel.java

@Override
protected void paintComponent(final Graphics g) {
    super.paintComponent(g);
    g.drawLine(100, 110, 100, 90);//ww  w.j a v  a2s.  c o  m
    g.drawLine(110, 100, 90, 100);
    circle(g, 100, 100, 10, 10);
    g.drawArc(100, 100, 20, 20, 0, 360);
    g.drawArc(100, 100, -20, -20, 0, 360);
}