DocumentUtils
Inheritance: java.lang.Object
public class DocumentUtils
此类提供了超出正式 XPS 操作 API 的实用工具。
方法
createCircle(Point2D center, float radius)
public XpsPathGeometry createCircle(Point2D center, float radius)
创建表示圆形的路径几何体。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| center | java.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:
| 参数 | 类型 | 描述 |
|---|---|---|
| center | java.awt.geom.Point2D | 圆心。 |
| 半径 | float | 圆的半径。 |
| startAngle | float | 起始射线的角度(度)。 |
| endAngle | float | 结束射线的角度(度)。 |
Returns: XpsPathGeometry - The XPS path geometry.
createEllipse(Point2D center, float radiusX, float radiusY)
public XpsPathGeometry createEllipse(Point2D center, float radiusX, float radiusY)
创建表示椭圆的路径几何体。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| center | java.awt.geom.Point2D | 椭圆的中心点。 |
| radiusX | float | 椭圆的水平半径。 |
| radiusY | float | 椭圆的垂直半径。 |
Returns: XpsPathGeometry - The XPS path geometry.
createImage(String fileName, Rectangle2D imageBox)
public XpsPath createImage(String fileName, Rectangle2D imageBox)
创建一个填充图像的矩形路径。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| fileName | java.lang.String | 图像文件的名称。 |
| imageBox | java.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:
| 参数 | 类型 | 描述 |
|---|---|---|
| fileName | java.lang.String | 图像文件的名称。 |
| imageBox | java.awt.geom.Rectangle2D | 用于填充图像的图像框。 |
| mode | ImageMode | 图像适配模式。 |
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:
| 参数 | 类型 | 描述 |
|---|---|---|
| center | java.awt.geom.Point2D | 圆心。 |
| 半径 | float | 圆的半径。 |
| startAngle | float | 起始射线的角度(度)。 |
| endAngle | float | 结束射线的角度(度)。 |
Returns: XpsPathGeometry - The XPS path geometry.
createRectangle(Rectangle2D rectangle)
public XpsPathGeometry createRectangle(Rectangle2D rectangle)
创建表示矩形的路径几何体。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| rectangle | java.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:
| 参数 | 类型 | 描述 |
|---|---|---|
| n | int | 顶点数量。 |
| center | java.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:
| 参数 | 类型 | 描述 |
|---|---|---|
| n | int | 顶点数量。 |
| center | java.awt.geom.Point2D | 圆心。 |
| 半径 | float | 圆的半径。 |
Returns: XpsPathGeometry - The XPS path geometry.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| arg0 | java.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:
| 参数 | 类型 | 描述 |
|---|---|---|
| arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| arg0 | long | |
| arg1 | int |