DocumentUtils

Inheritance: java.lang.Object

public class DocumentUtils

此类提供了超出正式 XPS 操作 API 的实用工具。

方法

方法描述
createCircle(Point2D center, float radius)创建表示圆形的路径几何体。
createCircularSegment(Point2D center, float radius, float startAngle, float endAngle)创建表示两个角度之间圆形段的路径几何体。
createEllipse(Point2D center, float radiusX, float radiusY)创建表示椭圆的路径几何体。
createImage(String fileName, Rectangle2D imageBox)创建一个填充图像的矩形路径。
createImage(String fileName, Rectangle2D imageBox, ImageMode mode)创建一个填充图像的矩形路径。
createPieSlice(Point2D center, float radius, float startAngle, float endAngle)创建表示两条径向射线之间圆形切片的路径几何体。
createRectangle(Rectangle2D rectangle)创建表示矩形的路径几何体。
createRegularCircumscribedNGon(int n, Point2D center, float radius)创建表示外接于圆的正 n 边形的路径几何体。
createRegularInscribedNGon(int n, Point2D center, float radius)创建表示内接于圆的正 n 边形的路径几何体。
equals(Object arg0)
getClass()
hashCode()
notify()
notifyAll()
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

createCircle(Point2D center, float radius)

public XpsPathGeometry createCircle(Point2D center, float radius)

创建表示圆形的路径几何体。

Parameters:

参数类型描述
centerjava.awt.geom.Point2D圆的中心点。
半径float圆的半径。

Returns: XpsPathGeometry - The XPS path geometry.

createCircularSegment(Point2D center, float radius, float startAngle, float endAngle)

public XpsPathGeometry createCircularSegment(Point2D center, float radius, float startAngle, float endAngle)

创建表示两个角度之间圆形段的路径几何体。

Parameters:

参数类型描述
centerjava.awt.geom.Point2D圆心。
半径float圆的半径。
startAnglefloat起始射线的角度(度)。
endAnglefloat结束射线的角度(度)。

Returns: XpsPathGeometry - The XPS path geometry.

createEllipse(Point2D center, float radiusX, float radiusY)

public XpsPathGeometry createEllipse(Point2D center, float radiusX, float radiusY)

创建表示椭圆的路径几何体。

Parameters:

参数类型描述
centerjava.awt.geom.Point2D椭圆的中心点。
radiusXfloat椭圆的水平半径。
radiusYfloat椭圆的垂直半径。

Returns: XpsPathGeometry - The XPS path geometry.

createImage(String fileName, Rectangle2D imageBox)

public XpsPath createImage(String fileName, Rectangle2D imageBox)

创建一个填充图像的矩形路径。

Parameters:

参数类型描述
fileNamejava.lang.String图像文件的名称。
imageBoxjava.awt.geom.Rectangle2D用于填充图像的图像框。

Returns: XpsPath - The XPS path.

createImage(String fileName, Rectangle2D imageBox, ImageMode mode)

public XpsPath createImage(String fileName, Rectangle2D imageBox, ImageMode mode)

创建一个填充图像的矩形路径。

Parameters:

参数类型描述
fileNamejava.lang.String图像文件的名称。
imageBoxjava.awt.geom.Rectangle2D用于填充图像的图像框。
modeImageMode图像适配模式。

Returns: XpsPath - The XPS path.

createPieSlice(Point2D center, float radius, float startAngle, float endAngle)

public XpsPathGeometry createPieSlice(Point2D center, float radius, float startAngle, float endAngle)

创建表示两条径向射线之间圆形切片的路径几何体。

Parameters:

参数类型描述
centerjava.awt.geom.Point2D圆心。
半径float圆的半径。
startAnglefloat起始射线的角度(度)。
endAnglefloat结束射线的角度(度)。

Returns: XpsPathGeometry - The XPS path geometry.

createRectangle(Rectangle2D rectangle)

public XpsPathGeometry createRectangle(Rectangle2D rectangle)

创建表示矩形的路径几何体。

Parameters:

参数类型描述
rectanglejava.awt.geom.Rectangle2D矩形。

Returns: XpsPathGeometry - The XPS path geometry.

createRegularCircumscribedNGon(int n, Point2D center, float radius)

public XpsPathGeometry createRegularCircumscribedNGon(int n, Point2D center, float radius)

创建表示外接于圆的正 n 边形的路径几何体。

Parameters:

参数类型描述
nint顶点数量。
centerjava.awt.geom.Point2D圆心。
半径float圆的半径。

Returns: XpsPathGeometry - The XPS path geometry.

createRegularInscribedNGon(int n, Point2D center, float radius)

public XpsPathGeometry createRegularInscribedNGon(int n, Point2D center, float radius)

创建表示内接于圆的正 n 边形的路径几何体。

Parameters:

参数类型描述
nint顶点数量。
centerjava.awt.geom.Point2D圆心。
半径float圆的半径。

Returns: XpsPathGeometry - The XPS path geometry.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

参数类型描述
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

参数类型描述
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

参数类型描述
arg0long
arg1int