Class BorderStroke
java.lang.Object
com.imyeyu.fx.utils.BorderStroke
快速构建边框。
示例
build() 作为导出作用,最后执行
示例
new BorderStroke("red").build(); // 红色边框,默认样式(1 像素宽度直线,无圆角无内边距)
new BorderStroke("red").width(0, 1, 0, 1).build() // 红色直线左右边框
new BorderStroke("red").top().build() // 红色直线上边框
new BorderStroke("red").radius(.5, true).build() // 红色完全圆角边框
top(), right(), bottom(), left() 不可重复使用,因为这是针对性边框宽度设置,重复使用只有最后一个有效- Since:
- 2021-02-14 10:42
- Author:
- 夜雨
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final javafx.scene.layout.BorderStrokeStyle断续边框static final javafx.scene.layout.BorderStrokeStyle点状边框static final javafx.scene.layout.Border空的边框static final javafx.scene.layout.BorderStrokeStyle无边框样式static final javafx.scene.layout.BorderStrokeStyle连续边框 -
Constructor Summary
ConstructorsConstructorDescriptionBorderStroke(String color) 边框构造BorderStroke(String top, String right, String bottom, String left) 边框构造BorderStroke(javafx.scene.paint.Paint color) 边框构造BorderStroke(javafx.scene.paint.Paint top, javafx.scene.paint.Paint right, javafx.scene.paint.Paint bottom, javafx.scene.paint.Paint left) 边框构造 -
Method Summary
Modifier and TypeMethodDescriptionbottom()1 像素下边框bottom(double size) 下边框javafx.scene.layout.Borderbuild()构造边框dashed()虚线样式dotted()点阵样式exBottom()除了下边框,其他设置为 1 像素边框exBottom(double size) 除了下边框,其他设置边框exLeft()除了左边框,其他设置为 1 像素边框exLeft(double size) 除了左边框,其他设置边框exRight()除了右边框,其他设置为 1 像素边框exRight(double size) 除了右边框,其他设置边框exTop()除了上边框,其他设置为 1 像素边框exTop(double size) 除了上边框,其他设置边框left()1 像素左边框left(double size) 左边框padding(double all) 设置内边距padding(double topBottom, double leftRight) 设置内边距padding(double top, double right, double bottom, double left) 设置内边距radius(double all) 设置圆角radius(double all, boolean asPercent) 设置圆角radius(double topLeft, double topRight, double bottomRight, double bottomLeft, boolean asPercent) 设置圆角right()1 像素右边框right(double size) 右边框style(javafx.scene.layout.BorderStrokeStyle all) 设置样式style(javafx.scene.layout.BorderStrokeStyle top, javafx.scene.layout.BorderStrokeStyle right, javafx.scene.layout.BorderStrokeStyle bottom, javafx.scene.layout.BorderStrokeStyle left) 设置样式static javafx.scene.layout.Bordertest()快速构造测试边框static javafx.scene.layout.Border快速构造测试边框top()1 像素上边框top(double size) 上边框width(double all) 设置宽度width(double topBottom, double leftRight) 设置宽度width(double top, double right, double bottom, double left) 设置宽度
-
Field Details
-
EMPTY
public static final javafx.scene.layout.Border EMPTY空的边框 -
NONE
public static final javafx.scene.layout.BorderStrokeStyle NONE无边框样式 -
SOLID
public static final javafx.scene.layout.BorderStrokeStyle SOLID连续边框 -
DASHED
public static final javafx.scene.layout.BorderStrokeStyle DASHED断续边框 -
DOTTED
public static final javafx.scene.layout.BorderStrokeStyle DOTTED点状边框
-
-
Constructor Details
-
BorderStroke
-
BorderStroke
-
BorderStroke
public BorderStroke(javafx.scene.paint.Paint color) 边框构造- Parameters:
color- 边框颜色
-
BorderStroke
public BorderStroke(javafx.scene.paint.Paint top, javafx.scene.paint.Paint right, javafx.scene.paint.Paint bottom, javafx.scene.paint.Paint left) 边框构造- Parameters:
top- 上边框颜色right- 右边框颜色bottom- 下边框颜色left- 左边框颜色
-
-
Method Details
-
top
-
right
-
bottom
-
left
-
top
-
right
-
bottom
-
left
-
exTop
-
exRight
-
exBottom
-
exLeft
-
exTop
-
exRight
-
exBottom
-
exLeft
-
width
-
width
设置宽度- Parameters:
topBottom- 上下leftRight- 左右- Returns:
- 构造器
-
width
设置宽度- Parameters:
top- 上right- 右bottom- 下left- 左- Returns:
- 构造器
-
radius
-
radius
设置圆角- Parameters:
all- 所有大小asPercent- 是否为百分比值(默认否)- Returns:
- 构造器
-
radius
public BorderStroke radius(double topLeft, double topRight, double bottomRight, double bottomLeft, boolean asPercent) 设置圆角- Parameters:
topLeft- 左上角大小topRight- 右上角大小bottomRight- 右下角大小bottomLeft- 左下角大小asPercent- 是否为百分比值- Returns:
- 构造器
-
dashed
-
dotted
-
style
设置样式- Parameters:
all- 所有边框样式- Returns:
- 构造器
-
style
public BorderStroke style(javafx.scene.layout.BorderStrokeStyle top, javafx.scene.layout.BorderStrokeStyle right, javafx.scene.layout.BorderStrokeStyle bottom, javafx.scene.layout.BorderStrokeStyle left) 设置样式- Parameters:
top- 上right- 右bottom- 下left- 左- Returns:
- 构造器
-
padding
-
padding
设置内边距- Parameters:
topBottom- 上下leftRight- 左右- Returns:
- 边框构造器
-
padding
设置内边距- Parameters:
top- 上right- 右bottom- 下left- 左- Returns:
- 边框构造器
-
build
public javafx.scene.layout.Border build()构造边框- Returns:
- 边框
-
test
快速构造测试边框- Parameters:
color- 颜色- Returns:
- 边框
-
test
public static javafx.scene.layout.Border test()快速构造测试边框- Returns:
- 边框
-