public abstract class Arc2D extends RectangularShape
Arc2D
是所有对象的框架矩形,定义二维圆弧型存储抽象父类的起始角度,角度范围(弧长),和一个封闭式(
OPEN
,
CHORD
,或
PIE
)。
The arc is a partial section of a full ellipse which inscribes the framing rectangle of its parent RectangularShape
。 The angles are specified relative to the non-square framing rectangle such that 45 degrees always falls on the line from the center of the ellipse to the upper right corner of the framing rectangle. As a result, if the framing rectangle is noticeably longer along one axis than the other, the angles to the start and end of the arc segment will be skewed farther along the longer axis of the frame.
坐标的实际存储表示形式留给子类。
Modifier and Type | Class and Description |
---|---|
static class |
Arc2D.Double
这个类定义了一个弧
double 指定精度。
|
static class |
Arc2D.Float
这个类定义了一个弧
float 指定精度。
|
Modifier and Type | Field and Description |
---|---|
static int |
CHORD
通过从弧段的开始到弧段的端的直线段绘制一个圆弧封闭的封闭形式。
|
static int |
OPEN
用于一个连接弧段两端的无路径段的开弧的闭合类型。
|
static int |
PIE
闭型为一个圆弧闭合的直线段,从圆弧段的开始到全椭圆的中心,并从这一点到弧段的结束。
|
Modifier | Constructor and Description |
---|---|
protected |
Arc2D()
这是一个抽象类不能被直接实例化。
|
protected |
Arc2D(int type)
这是一个抽象类不能被直接实例化。
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double x, double y)
确定指定的点是否在圆弧的边界内。
|
boolean |
contains(double x, double y, double w, double h)
确定电弧的内部是否完全包含指定的矩形。
|
boolean |
contains(Rectangle2D r)
确定电弧的内部是否完全包含指定的矩形。
|
boolean |
containsAngle(double angle)
确定指定的角度是否在圆弧的角范围内。
|
boolean |
equals(Object obj)
决定是否
Object 等于这
Arc2D 。
|
abstract double |
getAngleExtent()
返回圆弧的角范围。
|
abstract double |
getAngleStart()
返回电弧的起始角。
|
int |
getArcType()
|
Rectangle2D |
getBounds2D()
返回圆弧的高精度框架矩形。
|
Point2D |
getEndPoint()
返回圆弧的结束点。
|
PathIterator |
getPathIterator(AffineTransform at)
返回一个定义圆弧的边界的迭代对象。
|
Point2D |
getStartPoint()
返回电弧的起点。
|
int |
hashCode()
返回此
Arc2D hashCode。
|
boolean |
intersects(double x, double y, double w, double h)
确定是否在弧内与指定的矩形的内部。
|
protected abstract Rectangle2D |
makeBounds(double x, double y, double w, double h)
构建了一个
Rectangle2D 适当的精度保持计算为该弧的框架矩形参数。
|
abstract void |
setAngleExtent(double angExt)
将此圆弧的角度范围设置为指定的双值。
|
void |
setAngles(double x1, double y1, double x2, double y2)
设置两个坐标系的起始角度和角度范围。
|
void |
setAngles(Point2D p1, Point2D p2)
设置该圆弧的起始角度和角度范围,采用两个点。
|
abstract void |
setAngleStart(double angSt)
将此圆弧的起始角度设置为指定的双值。
|
void |
setAngleStart(Point2D p)
将此圆弧的起始角度设置为指定点相对于此电弧的中心的角度。
|
void |
setArc(Arc2D a)
设置此圆弧与指定的圆弧相同。
|
abstract void |
setArc(double x, double y, double w, double h, double angSt, double angExt, int closure)
设置此圆弧的位置、大小、角度范围和关闭类型到指定的双值。
|
void |
setArc(Point2D loc, Dimension2D size, double angSt, double angExt, int closure)
将此圆弧的位置、大小、角度范围和关闭类型设置为指定的值。
|
void |
setArc(Rectangle2D rect, double angSt, double angExt, int closure)
将此圆弧的位置、大小、角度范围和关闭类型设置为指定的值。
|
void |
setArcByCenter(double x, double y, double radius, double angSt, double angExt, int closure)
将此圆弧的位置、范围、角度范围和关闭类型设置为指定的值。
|
void |
setArcByTangent(Point2D p1, Point2D p2, Point2D p3, double radius)
将此圆弧的位置、范围和角度范围设置为指定的值。
|
void |
setArcType(int type)
设置为指定的值该弧的封闭型:
OPEN ,
CHORD ,或
PIE 。
|
void |
setFrame(double x, double y, double w, double h)
设置指定的矩形值位置的
Shape 框架矩形尺寸。
|
clone, contains, getBounds, getCenterX, getCenterY, getFrame, getHeight, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, getWidth, getX, getY, intersects, isEmpty, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
public static final int OPEN
public static final int CHORD
public static final int PIE
protected Arc2D()
此构造函数创建一个OPEN
默认封闭类型的对象。它只提供使子类的序列化。
Arc2D.Float
,
Arc2D.Double
protected Arc2D(int type)
type
-该弧的封闭型:
OPEN
,
CHORD
,或
PIE
。
Arc2D.Float
,
Arc2D.Double
public abstract double getAngleStart()
setAngleStart(double)
public abstract double getAngleExtent()
setAngleExtent(double)
public int getArcType()
setArcType(int)
public Point2D getStartPoint()
Point2D
对象,圆弧的起点坐标。
public Point2D getEndPoint()
Point2D
表示x,圆弧的终点坐标。
public abstract void setArc(double x, double y, double w, double h, double angSt, double angExt, int closure)
public void setArc(Point2D loc, Dimension2D size, double angSt, double angExt, int closure)
public void setArc(Rectangle2D rect, double angSt, double angExt, int closure)
public void setArc(Arc2D a)
a
-
Arc2D
使用设置弧的值。
public void setArcByCenter(double x, double y, double radius, double angSt, double angExt, int closure)
public void setArcByTangent(Point2D p1, Point2D p2, Point2D p3, double radius)
p1
-第一点,弧。弧的起始角度是通过指定点的切线(P1,P2)。
p2
-第二点定义弧。弧的起始角度是通过指定点的切线(P1,P2)。电弧的结束角度是指定点的切线(P2,P3)。
p3
-第三点定义弧。电弧的结束角度是指定点的切线(P2,P3)。
radius
-圆弧半径。
public abstract void setAngleStart(double angSt)
angSt
-度的弧的起始角度。
getAngleStart()
public abstract void setAngleExtent(double angExt)
angExt
-度的弧角范围。
getAngleExtent()
public void setAngleStart(Point2D p)
p
-定义起始角的
Point2D
。
getAngleStart()
public void setAngles(double x1, double y1, double x2, double y2)
x1
-圆弧的起点坐标。
y1
-圆弧的起点坐标。
x2
-圆弧的终点坐标。
y2
-圆弧的终点坐标。
public void setAngles(Point2D p1, Point2D p2)
p1
-定义圆弧起点的
Point2D
。
p2
-定义圆弧的终点
Point2D
。
public void setArcType(int type)
OPEN
,
CHORD
,或
PIE
。
type
-表示该弧的封闭型的整数常数:
OPEN
,
CHORD
,或
PIE
。
IllegalArgumentException
-如果
type
不是0,1,或2。+
getArcType()
public void setFrame(double x, double y, double w, double h)
setFrame
方法重写,继承类
RectangularShape
x
-指定的矩形的左上角的x坐标
y
-指定的矩形的左上角的Y坐标
w
-指定矩形的宽度
h
-指定矩形的高度
RectangularShape.getFrame()
public Rectangle2D getBounds2D()
Arc2D
是之间的起始和结束角度和包含的扇形,如果这
Arc2D
有
PIE
闭合式。
这种方法不同于getBounds
,getBounds
方法仅返回封闭的椭圆这Arc2D
边界不考虑开始和结束这Arc2D
角度。
Rectangle2D
表示圆弧的矩形框架。
Shape.getBounds()
protected abstract Rectangle2D makeBounds(double x, double y, double w, double h)
Rectangle2D
适当的精度保持计算为该弧的框架矩形参数。
x
-帧的矩形左上角的x坐标。
y
-帧的矩形的左上角的Y坐标。
w
-框架矩形的宽度。
h
-框架矩形的高度。
Rectangle2D
是这个弧形框架矩形。
public boolean containsAngle(double angle)
angle
的角度测试。
true
如果圆弧的包含角,
false
如果电弧不包含角。
public boolean contains(double x, double y)
x
的x坐标的点测试。
y
-要测试的点的Y坐标。
true
如果点是弧的范围内,
false
如果点是弧的范围之外。
public boolean intersects(double x, double y, double w, double h)
x
-矩形的左上角的x坐标。
y
-矩形的左上角坐标。
w
-矩形的宽度。
h
-矩形的高度。
true
如果弧相交的矩形,
false
如果弧不相交的矩形。
Area
public boolean contains(double x, double y, double w, double h)
x
-矩形的左上角的x坐标。
y
-矩形的左上角坐标。
w
-矩形的宽度。
h
-矩形的高度。
true
如果弧包含矩形,
false
如果电弧不包含矩形。
Area
,
Shape.intersects(double, double, double, double)
public boolean contains(Rectangle2D r)
contains
接口
Shape
contains
方法重写,继承类
RectangularShape
r
-
Rectangle2D
测试。
true
如果弧包含矩形,
false
如果电弧不包含矩形。
Shape.contains(double, double, double, double)
public PathIterator getPathIterator(AffineTransform at)
Arc2D
保证电弧的几何修改不影响任何迭代几何已经在过程。
at
可选
AffineTransform
被应用到坐标作为他们在迭代返回,或null如果需要转化的坐标。
PathIterator
这个弧的边界。
public int hashCode()
Arc2D
hashCode。
hashCode
方法重写,继承类
Object
Arc2D
hashCode。
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean equals(Object obj)
Object
等于这
Arc2D
。如果是
Arc2D
实例,如果其位置、大小指定的
Object
等于这
Arc2D
,电弧的程度和类型这
Arc2D
相同。
equals
方法重写,继承类
Object
obj
-
Object
要与此
Arc2D
相比。
true
如果
obj
是
Arc2D
实例具有相同的价值观;
false
否则。
Object.hashCode()
,
HashMap
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.