java.awt.geom

Class Arc2D.Double

Enclosing Class:
Arc2D
Implemented Interfaces:
Cloneable, Shape

public static class Arc2D.Double
extends Arc2D

This class defines an arc specified in double precision.

Nested Class Summary

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

Arc2D.Double, Arc2D.Float

Field Summary

double
extent
The angular extent of the arc in degrees.
double
height
The overall height of the full ellipse (not considering the angular extents).
double
start
The starting angle of the arc in degrees.
double
width
The overall width of the full ellipse (not considering the angular extents).
double
x
The x coordinate of the upper left corner of the arc.
double
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

Double()
Constructs a new OPEN arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0).
Double(double x, double y, double w, double h, double start, double extent, int type)
Constructs a new arc, initialized to the specified location, size, angular extents, and closure type.
Double(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.
Double(Rectangle2D ellipseBounds, double start, double 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)
Returns 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 double extent
The angular extent of the arc in degrees.

height

public double height
The overall height of the full ellipse (not considering the angular extents).

start

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

width

public double width
The overall width of the full ellipse (not considering the angular extents).

x

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

y

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

Constructor Details

Double

public Double()
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 Double()
   1:          case ARC :
   2:              Arc2D a=new Arc2D.Double();
   3:              a.setAngleStart(param1);
   4:              a.setAngleExtent(param2);
   5:              a.setFrame(_ox+_x,_oy+_y-_h,_w,_h);

View Full Code Here
   1:         if (arc == null) {
   2:             arc = new Arc2D.Double();
   3:         }
   4:         return arc;
   5:     }

View Full Code Here
   1:     
   2:     private final Ellipse2D.Double dot = new Ellipse2D.Double();
   3:     
   4:         ...
   5:     private final Point2D.Double localhost = new Point2D.Double();
   6:     
   7:         ...
   8:         
   9:         private final Arc2D.Double arc = new Arc2D.Double();
  10:         

View Full Code Here
   1: 
   2:     final Arc2D arc = new Arc2D.Double();
   3:     arc.setArcType(Arc2D.PIE);
   4:     arc.setFrame(rec.x, rec.y, rec.width, rec.height);
   5:     arc.setAngles(start.x, start.y, end.x, end.y);

View Full Code Here
   1: 
   2:     final Arc2D arc = new Arc2D.Double();
   3:     arc.setArcType(Arc2D.CHORD);
   4:     arc.setFrame(rec.x, rec.y, rec.width, rec.height);
   5:     arc.setAngles(start.x, start.y, end.x, end.y);

View Full Code Here

Double

public Double(double x,
              double y,
              double w,
              double h,
              double start,
              double 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 double precision.)
h - The overall height of the full ellipse of which this arc is a partial section. (Specified in double precision.)
start - The starting angle of the arc in degrees. (Specified in double precision.)
extent - The angular extent of the arc in degrees. (Specified in double precision.)
type - The closure type for the arc: OPEN, CHORD, or PIE.
Usages and Demos :

View More Examples of Double(double x,double y,double w,double h,double start,double extent,int type)
   1:   {
   2:             new Arc2D.Double( 100, 100, 60, 60, 30, 120, Arc2D.PIE );
   3: 
   4:     ((Graphics2D) g).draw( arc );
   5:   }

View Full Code Here
   1:   {
   2:       new Arc2D.Double( 100, 100, 60, 60,    30,    120, Arc2D.PIE );
   3:   
   4:     ((Graphics2D)g).draw( arc );
   5:   }

View Full Code Here
   1:     public void setUp() {
   2:         arc = new ZArc(new Arc2D.Double(1, 2, 3, 4, 5, 5, Arc2D.OPEN));
   3:     }
   4: 
   5:     public void testDuplicate() {

View Full Code Here
   1:         
   2:         s1 = new Arc2D.Double(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, Arc2D.PIE);
   3:         assertFalse(ShapeUtilities.equal(s1, s2));
   4:         ...
   5:         s2 = new Arc2D.Double(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, Arc2D.PIE);
   6:         assertTrue(ShapeUtilities.equal(s1, s2));
   7:         assertFalse(s1.equals(s2));
   8:         

View Full Code Here
   1:     ang2 = (int) (360 * yData[ii]/sum +0.6);
   2:     g.fill(new Arc2D.Double(20,20,sizeP,sizeP,ang1,ang2,Arc2D.PIE) );
   3:     ang1 = ang1 + ang2;
   4: 
   5:     if (showText == true)

View Full Code Here

Double

public Double(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 Double(int type)
   1: 
   2:         Arc2D shape = new Arc2D.Double(Arc2D.PIE);
   3:         double radius = plotArea.getHeight();
   4:         double halfX = plotArea.getWidth() / 2;
   5:         double diameter = 2 * radius;

View Full Code Here
   1:             double radius = 4;
   2:             g.fill(new Ellipse2D.Double(p.getX() - radius, p.getY() - radius,
   3:                     radius * 2, radius * 2));
   4:         ...
   5:             int radius = 6;
   6:             g.draw(new Arc2D.Double(p.getX() - radius, p.getY() - radius,
   7:                     radius * 2, radius * 2, 45 + Angle.toDegrees(angle), 90,
   8:         ...
   9:                     Arc2D.OPEN));
  10:             g.draw(new Arc2D.Double(p.getX() - radius, p.getY() - radius,
  11:                     radius * 2, radius * 2, 225 + Angle.toDegrees(angle), 90,

View Full Code Here
   1:     public Shape toAwt() {
   2:         return new Arc2D.Double(center.getX() - radii.getWidth(), center.getY()
   3:                 - radii.getHeight(), 2 * radii.getWidth(), 2 * radii
   4:                 .getHeight(), angleFrom * 180 / Math.PI,
   5:                 extent * 180 / Math.PI, Arc2D.OPEN);

View Full Code Here
   1:             case LINE:
   2:                 ((ZPathLayoutManager)layoutManager).setShape(new Line2D.Double(bounds.getWidth()/10.0+bounds.getX(),bounds.getHeight()/10.0+bounds.getY(),bounds.getX()+bounds.getWidth()-bounds.getWidth()/10.0,bounds.getY()+bounds.getHeight()-bounds.getHeight()/10.0));
   3:                 ((ZPathLayoutManager)layoutManager).setClosed(false);
   4:         ...
   5:             case ELLIPSE:
   6:                 ((ZPathLayoutManager)layoutManager).setShape(new Ellipse2D.Double(bounds.getWidth()/10.0+bounds.getX(),bounds.getHeight()/10.0+bounds.getY(),(8.0/10.0)*bounds.getWidth(),(8.0/10.0)*bounds.getHeight()));
   7:                 ((ZPathLayoutManager)layoutManager).setClosed(true);
   8:         ...
   9:             case RECT:
  10:                 ((ZPathLayoutManager)layoutManager).setShape(new Rectangle2D.Double(bounds.getWidth()/10.0+bounds.getX(),bounds.getHeight()/10.0+bounds.getY(),(8.0/10.0)*bounds.getWidth(),(8.0/10.0)*bounds.getHeight()));
  11:                 ((ZPathLayoutManager)layoutManager).setClosed(true);

View Full Code Here
   1:       {
   2:         Point2D pos = transform.transform (new Point2D.Double(uclip.getX (), 
   3:                                                               uclip.getY ()), 
   4:         ...
   5:                                            (Point2D)null);        
   6:         Point2D extent = transform.deltaTransform (new Point2D.Double(uclip.getWidth (), 
   7:                                                                       uclip.getHeight ()), 
   8:         ...
   9:                                                    (Point2D)null);
  10:         return new Rectangle2D.Double(pos.getX (), pos.getY (),
  11:                                        extent.getX (), extent.getY ());          

View Full Code Here

Double

public Double(Rectangle2D ellipseBounds,
              double start,
              double 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 double precision.)
extent - The angular extent of the arc in degrees. (Specified in double precision.)
type - The closure type for the arc: OPEN, CHORD, or PIE.
Usages and Demos :

View More Examples of Double(Rectangle2D ellipseBounds,double start,double extent,int type)
   1:       double endA = Math.toDegrees(context.getAngle(loc.getMax()));
   2:       Arc2D midArc = new Arc2D.Double(mid, startA, endA - startA, Arc2D.OPEN);
   3: 
   4:       g2.setPaint(outline);
   5:       g2.draw(midArc);

View Full Code Here
   1:                 );
   2:             notch = new Arc2D.Double(notchFrame, 90d, 180d, Arc2D.OPEN);
   3:         }
   4:         ...
   5:                 );
   6:             notch = new Arc2D.Double(notchFrame, 0d, 180d, Arc2D.OPEN);        
   7:         }
   8:         g2.setColor(Color.white);
   9:         g2.fill(notch);

View Full Code Here
   1:             );            
   2:             Arc2D.Double arc = new Arc2D.Double(arcBounds, angle1, angle, Arc2D.OPEN);
   3: 
   4:         ...
   5:         y2 = y2 + (endPercent * deltaY);
   6:         return new Line2D.Double(x1, y1, x2, y2);
   7:     }
   8:     
   9:     private void writeObject(ObjectOutputStream stream) throws IOException {

View Full Code Here
   1:             Point2D  centre = new Point2D.Double(X + W / 2, Y + H / 2);
   2:             Rectangle2D radarArea = new Rectangle2D.Double(X, Y, W, H);
   3: 
   4:         ...
   5:     {
   6:         Arc2D arc1 = new Arc2D.Double(plotArea, startAngle, 0, Arc2D.OPEN);
   7:         Point2D point1 = arc1.getEndPoint();
   8: 
   9:         double deltaX = -(point1.getX() - plotArea.getCenterX()) 

View Full Code Here

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 not.

makeBounds

protected Rectangle2D makeBounds(double x,
                                 double y,
                                 double w,
                                 double h)
Returns 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.