public class BorderStroke extends Object
top
is used, while the
other attributes are ignored.Modifier and Type | Field and Description |
---|---|
static BorderWidths |
DEFAULT_WIDTHS
The default Insets to be used with a BorderStroke that does not
otherwise define any.
|
static BorderWidths |
MEDIUM
The default insets when "medium" is specified
|
static BorderWidths |
THICK
The default insets when "thick" is specified
|
static BorderWidths |
THIN
The default insets when "thin" is specified.
|
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Paint |
getBottomStroke()
Defines the fill of bottom side of this border.
|
BorderStrokeStyle |
getBottomStyle()
Defines the style of bottom side of this border.
|
Insets |
getInsets()
Defines the insets of each side of the BorderStroke.
|
Paint |
getLeftStroke()
Defines the fill of left side of this border.
|
BorderStrokeStyle |
getLeftStyle()
Defines the style of left side of this border.
|
CornerRadii |
getRadii()
Defines the radii for each corner of this BorderStroke.
|
Paint |
getRightStroke()
Defines the fill of right side of this border.
|
BorderStrokeStyle |
getRightStyle()
Defines the style of right side of this border.
|
Paint |
getTopStroke()
Defines the fill of top side of this border.
|
BorderStrokeStyle |
getTopStyle()
Defines the style of top side of this border.
|
BorderWidths |
getWidths()
Defines the thickness of each side of the BorderStroke.
|
int |
hashCode() |
boolean |
isStrokeUniform()
An uniform stroke has all (top, bottom, left, right) strokes of
same color, width and style
|
public static final BorderWidths THIN
public static final BorderWidths MEDIUM
public static final BorderWidths THICK
public static final BorderWidths DEFAULT_WIDTHS
public BorderStroke(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths)
stroke
- The stroke to use for all sides. If null, we default to Color.BLACK.style
- The style to use for all sides. If null, we default to BorderStrokeStyle.NONEradii
- The radii to use. If null, we default to CornerRadii.EMPTYwidths
- The widths to use. If null, we default to DEFAULT_WIDTHSpublic BorderStroke(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths, Insets insets)
stroke
- The stroke to use for all sides. If null, we default to Color.BLACK.style
- The style to use for all sides. If null, we default to BorderStrokeStyle.NONEradii
- The radii to use. If null, we default to CornerRadii.EMPTYwidths
- The widths to use. If null, we default to DEFAULT_WIDTHSinsets
- The insets indicating where to draw the border relative to the region edges.public BorderStroke(Paint topStroke, Paint rightStroke, Paint bottomStroke, Paint leftStroke, BorderStrokeStyle topStyle, BorderStrokeStyle rightStyle, BorderStrokeStyle bottomStyle, BorderStrokeStyle leftStyle, CornerRadii radii, BorderWidths widths, Insets insets)
topStroke
- The fill to use on the top. If null, defaults to BLACK.rightStroke
- The fill to use on the right. If null, defaults to the same value as topStrokebottomStroke
- The fill to use on the bottom. If null, defaults to the same value as bottomStrokeleftStroke
- The fill to use on the left. If null, defaults to the same value as rightStroketopStyle
- The style to use on the top. If null, defaults to BorderStrokeStyle.NONErightStyle
- The style to use on the right. If null, defaults to the same value as topStylebottomStyle
- The style to use on the bottom. If null, defaults to the same value as topStyleleftStyle
- The style to use on the left. If null, defaults to the same value as rightStyleradii
- The radii. If null, we default to square corners by using CornerRadii.EMPTYwidths
- The thickness of each side. If null, we default to DEFAULT_WIDTHS.insets
- The insets indicating where to draw the border relative to the region edges.public final Paint getTopStroke()
public final Paint getRightStroke()
null
then the
topFill is used.public final Paint getBottomStroke()
null
then the
topFill is used.public final Paint getLeftStroke()
null
then the
rightFill is used.public final BorderStrokeStyle getTopStyle()
public final BorderStrokeStyle getRightStyle()
null
then
topStyle is used;public final BorderStrokeStyle getBottomStyle()
null
then
topStyle is used; Use BorderStyle.NONE to set the border to
have no border style.public final BorderStrokeStyle getLeftStyle()
null
then
rightStyle is used. Use BorderStyle.NONE to set the border to
have no border style.public final BorderWidths getWidths()
public final Insets getInsets()
public final CornerRadii getRadii()
public final boolean isStrokeUniform()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.