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()获取定义 custom cap 填充的对象。
setFillPath(GraphicsPath value)设置定义自定义帽填充的对象。
getStrokePath()获取定义自定义帽轮廓的对象。
setStrokePath(GraphicsPath value)设置定义自定义帽轮廓的对象。
getStrokeJoin()获取 LineJoin 枚举,它决定组成此 CustomLineCap 对象的线段如何连接。
setStrokeJoin(int value)设置 LineJoin 枚举,它决定组成此 CustomLineCap 对象的线段如何连接。
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:

参数类型描述
fillPathGraphicsPathGraphicsPath 对象,定义自定义帽的填充。
strokePathGraphicsPathGraphicsPath 对象,定义自定义帽的轮廓。

CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, int baseCap)

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

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

Parameters:

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

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

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

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

Parameters:

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

getFillPath()

public GraphicsPath getFillPath()

获取定义 custom cap 填充的对象。

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()

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

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

setStrokeJoin(int value)

public void setStrokeJoin(int value)

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

Parameters:

参数类型描述
valueintLineJoin 枚举,此 CustomLineCap 对象用于连接线段。

getBaseCap()

public int getBaseCap()

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

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

setBaseCap(int value)

public void setBaseCap(int value)

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

Parameters:

参数类型描述
valueintLineCap 枚举,此 CustomLineCap 所基于的。

getBaseInset()

public float getBaseInset()

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

Returns: float - 圆帽起始点与线段结束点之间的距离。

setBaseInset(float value)

public void setBaseInset(float value)

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

Parameters:

参数类型描述
valuefloat圆帽起始点与线段结束点之间的距离。

getWidthScale()

public float getWidthScale()

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

Returns: float - 缩放圆帽的量。

setWidthScale(float value)

public void setWidthScale(float value)

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

Parameters:

参数类型描述
valuefloat缩放圆帽的量。

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 - 哈希码。