java.awt.geom

Class Arc2D.Float

Enclosing Class:
Arc2D
Implemented Interfaces:
Cloneable, Shape

public static class Arc2D.Float
extends Arc2D

This class defines an arc specified in float precision.

Nested Class Summary

Nested classes/interfaces inherited from class java.awt.geom.Arc2D

Arc2D.Double, Arc2D.Float

Field Summary

float
extent
The angular extent of the arc in degrees.
float
height
The overall height of the full ellipse of which this arc is a partial section (not considering the angular extents).
float
start
The starting angle of the arc in degrees.
float
width
The overall width of the full ellipse of which this arc is a partial section (not considering the angular extents).
float
x
The x coordinate of the upper left corner of the arc.
float
y
The y coordinate of the upper left corner of the arc.

Fields inherited from class java.awt.geom.Arc2D

CHORD, OPEN, PIE

Constructor Summary

Float()
Constructs a new OPEN arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0).
Float(float x, float y, float w, float h, float start, float extent, int type)
Constructs a new arc, initialized to the specified location, size, angular extents, and closure type.
Float(int type)
Constructs a new arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0), and the specified closure type.
Float(Rectangle2D ellipseBounds, float start, float extent, int type)
Constructs a new arc, initialized to the specified location, size, angular extents, and closure type.

Method Summary

double
getAngleExtent()
Returns the angular extent of the arc.
double
getAngleStart()
Returns the starting angle of the arc.
double
getHeight()
Returns the height of the ellipse of which this arc is a partial section.
double
getWidth()
Returns the width of the ellipse of which this arc is a partial section.
double
getX()
Returns the x coordinate of the upper left corner of the arc.
double
getY()
Returns the y coordinate of the upper left corner of the arc.
boolean
isEmpty()
Determines whether the arc is empty.
protected Rectangle2D
makeBounds(double x, double y, double w, double h)
Return the high-precision bounding box of the arc.
void
setAngleExtent(double angExt)
Sets the angular extent of this arc to the specified double value.
void
setAngleStart(double angSt)
Sets the starting angle of this arc to the specified double value.
void
setArc(double x, double y, double w, double h, double angSt, double angExt, int closure)
Sets the location, size, angular extents, and closure type of this arc to the specified double values.

Methods inherited from class java.awt.geom.Arc2D

contains, contains, contains, containsAngle, getAngleExtent, getAngleStart, getArcType, getBounds2D, getEndPoint, getPathIterator, getStartPoint, intersects, makeBounds, setAngleExtent, setAngleStart, setAngleStart, setAngles, setAngles, setArc, setArc, setArc, setArc, setArcByCenter, setArcByTangent, setArcType, setFrame

Methods inherited from class java.awt.geom.RectangularShape

clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getHeight, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, getWidth, getX, getY, intersects, isEmpty, setFrame, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

extent

public float extent
The angular extent of the arc in degrees.

height

public float height
The overall height of the full ellipse of which this arc is a partial section (not considering the angular extents).

start

public float start
The starting angle of the arc in degrees.

width

public float width
The overall width of the full ellipse of which this arc is a partial section (not considering the angular extents).

x

public float x
The x coordinate of the upper left corner of the arc.

y

public float y
The y coordinate of the upper left corner of the arc.

Constructor Details

Float

public Float()
Constructs a new OPEN arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0).
Usages and Demos :

View More Examples of Float()
   1:     private BasicStroke bs = new BasicStroke(20.0f);
   2:     private Arc2D arc = new Arc2D.Float();
   3:         ...
   4:     private Ellipse2D ellipse = new Ellipse2D.Float();
   5:         ...
   6:     private RoundRectangle2D roundRect = new RoundRectangle2D.Float();
   7:     private Rectangle2D rect = new Rectangle2D.Float();

View Full Code Here
   1:         if (sc.line == null)
   2:           sc.line = new Line2D.Float();
   3:         sc.line.setLine(x1, y1, x2, y2);
   4:         ...
   5:     if (sc.roundRect == null)
   6:       sc.roundRect = new RoundRectangle2D.Float();
   7:     sc.roundRect.setRoundRect(x, y, width, height, arcWidth, arcHeight);
   8:         ...
   9:     if (sc.roundRect == null)
  10:       sc.roundRect = new RoundRectangle2D.Float();
  11:     sc.roundRect.setRoundRect(x, y, width, height, arcWidth, arcHeight);

View Full Code Here

Float

public Float(float x,
             float y,
             float w,
             float h,
             float start,
             float extent,
             int type)
Constructs a new arc, initialized to the specified location, size, angular extents, and closure type.
Parameters:
w - The overall width of the full ellipse of which this arc is a partial section. (Specified in float precision.)
h - The overall height of the full ellipse of which this arc is a partial section. (Specified in float precision.)
start - The starting angle of the arc in degrees. (Specified in float precision.)
extent - The angular extent of the arc in degrees. (Specified in float precision.)
type - The closure type for the arc: OPEN, CHORD, or PIE.
Usages and Demos :

View More Examples of Float(float x,float y,float w,float h,float start,float extent,int type)
   1:         path.lineTo(300, 0);
   2:         path.append(new Arc2D.Float(0, 0, 300, 300, 90, -90, Arc2D.OPEN), true);
   3:         path.closePath();
   4: 
   5:         PPath ppath = new PPath(path);

View Full Code Here
   1:     {
   2:         Arc2D a = new Arc2D.Float(0, 0, 100, 100, 0, -300, Arc2D.OPEN);
   3:         float[] ff = new float[6];
   4:         int i = 0;
   5:         for (PathIterator pi = a.getPathIterator(null); !pi.isDone(); )

View Full Code Here
   1:         g.drawString("Arc2D", 10, 20);
   2:         Arc2D arc = new Arc2D.Float(10, 30, 50, 40, 0, 270, Arc2D.PIE);
   3:         g.draw(arc);
   4: 
   5:         g.translate(0, 90);

View Full Code Here
   1:             switch (i) {
   2:                 case 0 : shape = new Arc2D.Float(0.0f, 0.0f, w/5, h/4, 45, 270, Arc2D.PIE);
   3:                          break;
   4:                 case 1 : shape = new Ellipse2D.Float(0.0f, 0.0f, w/5, h/4);
   5:                          break;

View Full Code Here
   1:     {
   2:         draw(new java.awt.geom.Arc2D.Float(x, y, width, height, startAngle, arcAngle, 0));
   3:     }
   4:         ...
   5:     {
   6:         fill(new java.awt.geom.Arc2D.Float(i, j, k, l, i1, j1, 2));
   7:     }
   8: 
   9:     public void fillOval(int x, int y, int width, int height)

View Full Code Here

Float

public Float(int type)
Constructs a new arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0), and the specified closure type.
Parameters:
type - The closure type for the arc: OPEN, CHORD, or PIE.
Usages and Demos :

View More Examples of Float(int type)
   1:         for (int i = 0; i < types.length; i++) {
   2:             Arc2D arc = new Arc2D.Float(i);
   3:             arc.setFrame((i+1)*w*.2, (i+1)*h*.2, w*.17, h*.17);
   4:         ...
   5: 
   6:         Arc2D pieArc = new Arc2D.Float(Arc2D.PIE);
   7:         pieArc.setFrame(0, 0, aw, ah);
   8:         pieArc.setAngleStart(angleStart);
   9:         pieArc.setAngleExtent(angleExtent);

View Full Code Here
   1:     public void arc(double cx, double cy, double r, double ang1, double ang2){
   2:         Arc2D.Float arc = new Arc2D.Float((float) ( cx - r ), (float) ( cy
   3:                 - r ), (float) r * 2f, (float) r * 2f,- (float) ang1,- (float) ( ang2 -
   4:         ...
   5:     public void arcn(double cx, double cy, double r, double ang1, double ang2) {
   6:         Arc2D.Float arc = new Arc2D.Float((float) ( cx - r ), (float)
   7:         ( cy - r ), (float) r * 2f, (float) r * 2f,- (float) ang1, -(float) (
   8:                 ang2 - ang1 ), Arc2D.OPEN );
   9:         Point2D currentPoint = this.state.path.getCurrentPoint();

View Full Code Here

Float

public Float(Rectangle2D ellipseBounds,
             float start,
             float extent,
             int type)
Constructs a new arc, initialized to the specified location, size, angular extents, and closure type.
Parameters:
ellipseBounds - The bounding rectangle that defines the outer boundary of the full ellipse of which this arc is a partial section.
start - The starting angle of the arc in degrees. (Specified in float precision.)
extent - The angular extent of the arc in degrees. (Specified in float precision.)
type - The closure type for the arc: OPEN, CHORD, or PIE.

Method Details

getAngleExtent

public double getAngleExtent()
Returns the angular extent of the arc.
Overrides:
getAngleExtent in interface Arc2D
Returns:
A double value that represents the angular extent of the arc in degrees.

getAngleStart

public double getAngleStart()
Returns the starting angle of the arc.
Overrides:
getAngleStart in interface Arc2D
Returns:
A double value that represents the starting angle of the arc in degrees.

getHeight

public double getHeight()
Returns the height of the ellipse of which this arc is a partial section.
Overrides:
getHeight in interface RectangularShape
Returns:
A double value that represents the height of the full ellipse of which this arc is a partial section.

getWidth

public double getWidth()
Returns the width of the ellipse of which this arc is a partial section.
Overrides:
getWidth in interface RectangularShape
Returns:
A double value that represents the width of the full ellipse of which this arc is a partial section.

getX

public double getX()
Returns the x coordinate of the upper left corner of the arc.
Overrides:
getX in interface RectangularShape
Returns:
The x coordinate of arc's upper left coordinate in double precision.

getY

public double getY()
Returns the y coordinate of the upper left corner of the arc.
Overrides:
getY in interface RectangularShape
Returns:
The y coordinate of arc's upper left coordinate in double precision.

isEmpty

public boolean isEmpty()
Determines whether the arc is empty.
Overrides:
isEmpty in interface RectangularShape
Returns:
true if the arc is empty, false if it is not.

makeBounds

protected Rectangle2D makeBounds(double x,
                                 double y,
                                 double w,
                                 double h)
Return the high-precision bounding box of the arc.
Overrides:
makeBounds in interface Arc2D
Parameters:
w - The overall width of the full ellipse of which this arc is a partial section.
h - The overall height of the full ellipse of which this arc is a partial section.
Returns:
The bounding box as a Rectangle2D object.

setAngleExtent

public void setAngleExtent(double angExt)
Sets the angular extent of this arc to the specified double value.
Overrides:
setAngleExtent in interface Arc2D
Parameters:
angExt - The angular extent of the arc in degrees.

setAngleStart

public void setAngleStart(double angSt)
Sets the starting angle of this arc to the specified double value.
Overrides:
setAngleStart in interface Arc2D
Parameters:
angSt - The starting angle of the arc in degrees.

setArc

public void setArc(double x,
                   double y,
                   double w,
                   double h,
                   double angSt,
                   double angExt,
                   int closure)
Sets the location, size, angular extents, and closure type of this arc to the specified double values.
Overrides:
setArc in interface Arc2D
Parameters:
w - The overall width of the full ellipse of which this arc is a partial section.
h - The overall height of the full ellipse of which this arc is a partial section.
angSt - The starting angle of the arc in degrees.
angExt - The angular extent of the arc in degrees.
closure - The closure type for the arc: OPEN, CHORD, or PIE.