Class BorderStroke
- javafx.scene.layout.BorderStroke
public class BorderStroke extends Object
top is used, while the other attributes are ignored.Since:
JavaFX 8.0
-
Field Summary
Fields Modifier and Type Field and Description static BorderWidthsDEFAULT_WIDTHSThe default Insets to be used with a BorderStroke that does not otherwise define any.static BorderWidthsMEDIUMThe default insets when "medium" is specifiedstatic BorderWidthsTHICKThe default insets when "thick" is specifiedstatic BorderWidthsTHINThe default insets when "thin" is specified.
-
Constructor Summary
Constructors Constructor and Description BorderStroke(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths)Creates a new BorderStroke.BorderStroke(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths, Insets insets)Creates a new BorderStroke.BorderStroke(Paint topStroke, Paint rightStroke, Paint bottomStroke, Paint leftStroke, BorderStrokeStyle topStyle, BorderStrokeStyle rightStyle, BorderStrokeStyle bottomStyle, BorderStrokeStyle leftStyle, CornerRadii radii, BorderWidths widths, Insets insets)Create a new BorderStroke, specifying all construction parameters.
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description booleanequals(Object o)PaintgetBottomStroke()Defines the fill of bottom side of this border.BorderStrokeStylegetBottomStyle()Defines the style of bottom side of this border.InsetsgetInsets()Defines the insets of each side of the BorderStroke.PaintgetLeftStroke()Defines the fill of left side of this border.BorderStrokeStylegetLeftStyle()Defines the style of left side of this border.CornerRadiigetRadii()Defines the radii for each corner of this BorderStroke.PaintgetRightStroke()Defines the fill of right side of this border.BorderStrokeStylegetRightStyle()Defines the style of right side of this border.PaintgetTopStroke()Defines the fill of top side of this border.BorderStrokeStylegetTopStyle()Defines the style of top side of this border.BorderWidthsgetWidths()Defines the thickness of each side of the BorderStroke.inthashCode()booleanisStrokeUniform()An uniform stroke has all (top, bottom, left, right) strokes of same color, width and style
-
Field Detail
-
THIN
public static final BorderWidths THIN
The default insets when "thin" is specified.
-
MEDIUM
public static final BorderWidths MEDIUM
The default insets when "medium" is specified
-
THICK
public static final BorderWidths THICK
The default insets when "thick" is specified
-
DEFAULT_WIDTHS
public static final BorderWidths DEFAULT_WIDTHS
The default Insets to be used with a BorderStroke that does not otherwise define any.
-
-
Constructor Detail
-
BorderStroke
public BorderStroke(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths)Creates a new BorderStroke.Parameters:
stroke- The stroke to use for all sides. If null, we default to Color.BLACK.
-
BorderStroke
public BorderStroke(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths, Insets insets)Creates a new BorderStroke.Parameters:
stroke- The stroke to use for all sides. If null, we default to Color.BLACK.
-
BorderStroke
public BorderStroke(Paint topStroke, Paint rightStroke, Paint bottomStroke, Paint leftStroke, BorderStrokeStyle topStyle, BorderStrokeStyle rightStyle, BorderStrokeStyle bottomStyle, BorderStrokeStyle leftStyle, CornerRadii radii, BorderWidths widths, Insets insets)Create a new BorderStroke, specifying all construction parameters.Parameters:
topStroke- The fill to use on the top. If null, defaults to BLACK.
-
-
Method Detail
-
getTopStroke
public final Paint getTopStroke()
Defines the fill of top side of this border.Default value:
black
-
getRightStroke
public final Paint getRightStroke()
Defines the fill of right side of this border. Ifnullthen the topFill is used.Default value:
null = same as topFill
-
getBottomStroke
public final Paint getBottomStroke()
Defines the fill of bottom side of this border. Ifnullthen the topFill is used.Default value:
null = same as topFill
-
getLeftStroke
public final Paint getLeftStroke()
Defines the fill of left side of this border. Ifnullthen the rightFill is used.Default value:
null = same sa rightFill
-
getTopStyle
public final BorderStrokeStyle getTopStyle()
Defines the style of top side of this border.Default value:
none
-
getRightStyle
public final BorderStrokeStyle getRightStyle()
Defines the style of right side of this border. Ifnullthen topStyle is used;Default value:
null = same as topStyle
-
getBottomStyle
public final BorderStrokeStyle getBottomStyle()
Defines the style of bottom side of this border. Ifnullthen topStyle is used; Use BorderStyle.NONE to set the border to have no border style.Default value:
null = same as topStyle
-
getLeftStyle
public final BorderStrokeStyle getLeftStyle()
Defines the style of left side of this border. Ifnullthen rightStyle is used. Use BorderStyle.NONE to set the border to have no border style.Default value:
null = same as rightStyle
-
getWidths
public final BorderWidths getWidths()
Defines the thickness of each side of the BorderStroke. This will never be null, and defaults to DEFAULT_WIDTHS.
-
getInsets
public final Insets getInsets()
Defines the insets of each side of the BorderStroke. This will never be null, and defaults to EMPTY.
-
getRadii
public final CornerRadii getRadii()
Defines the radii for each corner of this BorderStroke. This will never be null, and defaults to CornerRadii.EMPTY.
-
isStrokeUniform
public final boolean isStrokeUniform()
An uniform stroke has all (top, bottom, left, right) strokes of same color, width and styleReturns:
true if border stroke is uniform as defined above
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.