Class BorderStroke
java.lang.Object
javafx.scene.layout.BorderStroke
- All Implemented Interfaces:
- Interpolatable<BorderStroke>
Defines the stroke to use on a 
Border for styling a Region.
 The stroke is a vector-based rendering that outlines the border area.
 It can be inset (or outset) from the Region's edge, and the values
 of the stroke are taken into account when computing the Region's
 insets (for defining the content area). The stroke visuals are not used when
 any BorderImages are in use.
 
 When applied to a Region with a defined shape, the border width
 and stroking information for the top is used, while the other
 attributes are ignored.
- Since:
- JavaFX 8.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final BorderWidthsThe default Insets to be used with a BorderStroke that does not otherwise define any.static final BorderWidthsThe default insets when "medium" is specifiedstatic final BorderWidthsThe default insets when "thick" is specifiedstatic final BorderWidthsThe default insets when "thin" is specified.
- 
Constructor SummaryConstructorsConstructorDescriptionBorderStroke(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths) Creates a newBorderStroke.BorderStroke(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths, Insets insets) Creates a newBorderStroke.BorderStroke(Paint topStroke, Paint rightStroke, Paint bottomStroke, Paint leftStroke, BorderStrokeStyle topStyle, BorderStrokeStyle rightStyle, BorderStrokeStyle bottomStyle, BorderStrokeStyle leftStyle, CornerRadii radii, BorderWidths widths, Insets insets) Creates a newBorderStroke, specifying all construction parameters.
- 
Method SummaryModifier and TypeMethodDescriptionfinal PaintDefines the fill of bottom side of this border.final BorderStrokeStyleDefines the style of bottom side of this border.final InsetsDefines the insets of each side of theBorderStroke.final PaintDefines the fill of left side of this border.final BorderStrokeStyleDefines the style of left side of this border.final CornerRadiigetRadii()Defines the radii for each corner of thisBorderStroke.final PaintDefines the fill of right side of this border.final BorderStrokeStyleDefines the style of right side of this border.final PaintDefines the fill of top side of this border.final BorderStrokeStyleDefines the style of top side of this border.final BorderWidthsDefines the thickness of each side of theBorderStroke.interpolate(BorderStroke endValue, double t) Returns an intermediate value between the value of thisInterpolatableand the specifiedendValueusing the linear interpolation factort.final booleanChecks if the stroke of this region is uniform.
- 
Field Details- 
THINThe default insets when "thin" is specified.
- 
MEDIUMThe default insets when "medium" is specified
- 
THICKThe default insets when "thick" is specified
- 
DEFAULT_WIDTHSThe default Insets to be used with a BorderStroke that does not otherwise define any.
 
- 
- 
Constructor Details- 
BorderStrokeCreates a newBorderStroke.- Parameters:
- stroke- The stroke to use for all sides. If- null, defaults to- Color.BLACK.
- style- The style to use for all sides. If- null, defaults to- BorderStrokeStyle.NONE.
- radii- The radii to use. If- null, defaults to- CornerRadii.EMPTY.
- widths- The widths to use. If- null, defaults to- DEFAULT_WIDTHS.
 
- 
BorderStrokepublic BorderStroke(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths, Insets insets) Creates a newBorderStroke.- Parameters:
- stroke- The stroke to use for all sides. If- null, defaults to- Color.BLACK.
- style- The style to use for all sides. If- null, defaults to- BorderStrokeStyle.NONE.
- radii- The radii to use. If- null, defaults to- CornerRadii.EMPTY.
- widths- The widths to use. If- null, defaults to- DEFAULT_WIDTHS.
- insets- The insets indicating where to draw the border relative to the region edges. If- null, defaults to- Insets.EMPTY.
 
- 
BorderStrokepublic BorderStroke(Paint topStroke, Paint rightStroke, Paint bottomStroke, Paint leftStroke, BorderStrokeStyle topStyle, BorderStrokeStyle rightStyle, BorderStrokeStyle bottomStyle, BorderStrokeStyle leftStyle, CornerRadii radii, BorderWidths widths, Insets insets) Creates a newBorderStroke, specifying all construction parameters.- Parameters:
- topStroke- The fill to use on the top. If- null, defaults to- Color.BLACK.
- rightStroke- The fill to use on the right. If- null, defaults to the same value as- topStroke.
- bottomStroke- The fill to use on the bottom. If- null, defaults to the same value as- topStroke.
- leftStroke- The fill to use on the left. If- null, defaults to the same value as- rightStroke.
- topStyle- The style to use on the top. If- null, defaults to- BorderStrokeStyle.NONE.
- rightStyle- The style to use on the right. If- null, defaults to the same value as- topStyle.
- bottomStyle- The style to use on the bottom. If- null, defaults to the same value as- topStyle.
- leftStyle- The style to use on the left. If- null, defaults to the same value as- rightStyle.
- radii- The radii. If- null, defaults to square corners by using- CornerRadii.EMPTY.
- widths- The thickness of each side. If- null, defaults to- DEFAULT_WIDTHS.
- insets- The insets indicating where to draw the border relative to the region edges. If- null, defaults to- Insets.EMPTY.
 
 
- 
- 
Method Details- 
getTopStroke
- 
getRightStroke
- 
getBottomStroke
- 
getLeftStroke
- 
getTopStyleDefines the style of top side of this border.- Default value:
- BorderStrokeStyle.NONE
- Interpolation Type:
- discrete
- Returns:
- the style of top side of this border
 
- 
getRightStyleDefines the style of right side of this border. Ifnull, thentopStyleis used;- Default value:
- null(same as- topStyle)
- Interpolation Type:
- discrete
- Returns:
- the style of right side of this border
 
- 
getBottomStyleDefines the style of bottom side of this border. Ifnull, thentopStyleis used; UseBorderStyle.NONEto set the border to have no border style.- Default value:
- null(same as- topStyle)
- Interpolation Type:
- discrete
- Returns:
- the style of bottom side of this border
 
- 
getLeftStyleDefines the style of left side of this border. Ifnull, thenrightStyleis used. UseBorderStyle.NONEto set the border to have no border style.- Default value:
- null(same as- rightStyle)
- Interpolation Type:
- discrete
- Returns:
- the style of left side of this border
 
- 
getWidthsDefines the thickness of each side of theBorderStroke. This will never benull, and defaults toDEFAULT_WIDTHS.- Interpolation Type:
- default
- Returns:
- the thickness of each side of the BorderStroke
 
- 
getInsets
- 
getRadiiDefines the radii for each corner of thisBorderStroke. This will never benull, and defaults toCornerRadii.EMPTY.- Interpolation Type:
- default
- Returns:
- the radii for each corner of this BorderStroke
 
- 
isStrokeUniformpublic final boolean isStrokeUniform()Checks if the stroke of this region is uniform. A uniform stroke has all its side strokes (top, bottom, left, right) of same color, width and style.- Returns:
- trueif border stroke is uniform
 
- 
interpolateReturns an intermediate value between the value of thisInterpolatableand the specifiedendValueusing the linear interpolation factort. The interpolation factor can be any finite value.The returned value might not be a new instance; the implementation might also return one of the two existing instances if the intermediate value would be equal to one of the existing values. However, this is an optimization and applications should not assume any particular identity of the returned value. - Specified by:
- interpolatein interface- Interpolatable<BorderStroke>
- Parameters:
- endValue- the target value
- t- the interpolation factor
- Returns:
- the intermediate value
- Throws:
- NullPointerException- if- endValueis- null
- Since:
- 24
 
 
-