CustomLineCap

Inheritance: java.lang.Object

public class CustomLineCap

封装自定义用户定义的线帽。

构造函数

构造函数描述
CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath)使用指定的轮廓和填充初始化 CustomLineCap 类的新实例。
CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, int baseCap)从指定的现有 LineCap 枚举并使用指定的轮廓和填充,初始化 CustomLineCap 类的新实例。
CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, int baseCap, float baseInset)从指定的现有 LineCap 枚举并使用指定的轮廓、填充和内嵌,初始化 CustomLineCap 类的新实例。

方法

方法描述
getFillPath()获取定义自定义帽填充的对象。
setFillPath(GraphicsPath value)设置定义自定义帽填充的对象。
getStrokePath()获取定义自定义帽轮廓的对象。
setStrokePath(GraphicsPath value)设置定义自定义帽轮廓的对象。
getStrokeJoin()获取决定组成此 CustomLineCap 对象的线段如何连接的 LineJoin 枚举。
setStrokeJoin(int value)设置决定组成此 CustomLineCap 对象的线段如何连接的 LineJoin 枚举。
getBaseCap()获取此 CustomLineCap 所基于的 LineCap 枚举。
setBaseCap(int value)设置此 CustomLineCap 所基于的 LineCap 枚举。
getBaseInset()获取帽子与线之间的距离。
setBaseInset(float value)设置帽子与线之间的距离。
getWidthScale()获取相对于 System.Drawing.Pen 对象宽度,对此 CustomLineCap 类对象的缩放量。
setWidthScale(float value)设置相对于 System.Drawing.Pen 对象宽度,对此 CustomLineCap 类对象的缩放量。
setStrokeCaps(int startCap, int endCap)设置用于开始和结束构成此自定义帽的线段的帽子。
getStrokeCaps(int[] startCap, int[] endCap)获取用于开始和结束构成此自定义帽的线段的帽子。
equals(Object o)检查对象是否相等。
hashCode()获取当前对象的哈希码。

CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath)

public CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath)

使用指定的轮廓和填充初始化 CustomLineCap 类的新实例。

Parameters:

参数类型描述
fillPathGraphicsPath定义自定义帽填充的 GraphicsPath 对象。
strokePathGraphicsPath定义自定义帽轮廓的 GraphicsPath 对象。

CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, int baseCap)

public CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, int baseCap)

从指定的现有 LineCap 枚举并使用指定的轮廓和填充,初始化 CustomLineCap 类的新实例。

Parameters:

参数类型描述
fillPathGraphicsPath定义自定义帽填充的 GraphicsPath 对象。
strokePathGraphicsPath定义自定义帽轮廓的 GraphicsPath 对象。
baseCapint用于创建自定义帽的线帽。

CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, int baseCap, float baseInset)

public CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, int baseCap, float baseInset)

从指定的现有 LineCap 枚举并使用指定的轮廓、填充和内嵌,初始化 CustomLineCap 类的新实例。

Parameters:

参数类型描述
fillPathGraphicsPath定义自定义帽填充的 GraphicsPath 对象。
strokePathGraphicsPath定义自定义帽轮廓的 GraphicsPath 对象。
baseCapint用于创建自定义帽的线帽。
baseInsetfloat帽子与线之间的距离。

getFillPath()

public GraphicsPath getFillPath()

获取定义自定义帽填充的对象。

Returns: GraphicsPath - The object that defines the fill for the custom cap.

setFillPath(GraphicsPath value)

public void setFillPath(GraphicsPath value)

设置定义自定义帽填充的对象。

Parameters:

参数类型描述
valueGraphicsPath定义自定义帽子填充的对象。

getStrokePath()

public GraphicsPath getStrokePath()

获取定义自定义帽轮廓的对象。

Returns: GraphicsPath - The object that defines the outline of the custom cap.

setStrokePath(GraphicsPath value)

public void setStrokePath(GraphicsPath value)

设置定义自定义帽轮廓的对象。

Parameters:

参数类型描述
valueGraphicsPath定义自定义帽子轮廓的对象。

getStrokeJoin()

public int getStrokeJoin()

获取决定组成此 CustomLineCap 对象的线段如何连接的 LineJoin 枚举。

Returns: int - 此 CustomLineCap 对象用于连接线条的 LineJoin 枚举。

setStrokeJoin(int value)

public void setStrokeJoin(int value)

设置决定组成此 CustomLineCap 对象的线段如何连接的 LineJoin 枚举。

Parameters:

参数类型描述
intCustomLineCap 对象用于连接线条的 LineJoin 枚举。

getBaseCap()

public int getBaseCap()

获取此 CustomLineCap 所基于的 LineCap 枚举。

Returns: int - 此 CustomLineCap 基于的 LineCap 枚举。

setBaseCap(int value)

public void setBaseCap(int value)

设置此 CustomLineCap 所基于的 LineCap 枚举。

Parameters:

参数类型描述
intCustomLineCap 基于的 LineCap 枚举。

getBaseInset()

public float getBaseInset()

获取帽子与线之间的距离。

Returns: float - 帽子起点与线段终点之间的距离。

setBaseInset(float value)

public void setBaseInset(float value)

设置帽子与线之间的距离。

Parameters:

参数类型描述
float帽子起点与线段终点之间的距离。

getWidthScale()

public float getWidthScale()

获取相对于 System.Drawing.Pen 对象宽度,对此 CustomLineCap 类对象的缩放量。

Returns: float - 缩放帽子的量。

setWidthScale(float value)

public void setWidthScale(float value)

设置相对于 System.Drawing.Pen 对象宽度,对此 CustomLineCap 类对象的缩放量。

Parameters:

参数类型描述
float缩放帽子的量。

setStrokeCaps(int startCap, int endCap)

public void setStrokeCaps(int startCap, int endCap)

设置用于开始和结束构成此自定义帽的线段的帽子。

Parameters:

参数类型描述
startCapint此帽子中线段起始处使用的 LineCap 枚举。
endCapint此帽子中线段结束处使用的 LineCap 枚举。

getStrokeCaps(int[] startCap, int[] endCap)

public void getStrokeCaps(int[] startCap, int[] endCap)

获取用于开始和结束构成此自定义帽的线段的帽子。

Parameters:

参数类型描述
startCapint[]此帽子中线段起始处使用的 LineCap 枚举。
endCapint[]此帽子中线段结束处使用的 LineCap 枚举。

equals(Object o)

public boolean equals(Object o)

检查对象是否相等。

Parameters:

参数类型描述
ojava.lang.Object其他对象。

Returns: boolean - 相等比较结果。

hashCode()

public int hashCode()

获取当前对象的哈希码。

Returns: int - 哈希码。