public final class BorderWidths extends Object
topAsPercentage
, rightAsPercentage
, bottomAsPercentage
,
leftAsPercentage
. The only allowable negative value for top, right,
bottom, and left is AUTO
.
Because the BorderWidths is immutable, it can safely be used in any
cache, and can safely be reused among multiple Regions.Modifier and Type | Field and Description |
---|---|
static double |
AUTO
When used by a BorderStroke, the value of AUTO is interpreted as the
value of
BorderStroke.MEDIUM for the corresponding side. |
static BorderWidths |
DEFAULT
The default BorderWidths that is used by a BorderImage when null is specified.
|
static BorderWidths |
EMPTY
An empty set of widths, such that all values are 0 and are literal values.
|
static BorderWidths |
FULL
A set of widths representing 100% on each side.
|
Constructor and Description |
---|
BorderWidths(double width)
Creates a new BorderWidths using the given width for all four borders,
and treating this width as a literal value, and not a percentage.
|
BorderWidths(double top,
double right,
double bottom,
double left)
Creates a new BorderWidths with the specified widths for top, right,
bottom, and left.
|
BorderWidths(double top,
double right,
double bottom,
double left,
boolean topAsPercentage,
boolean rightAsPercentage,
boolean bottomAsPercentage,
boolean leftAsPercentage)
Creates a new BorderWidths.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
double |
getBottom()
The non-negative value (with the exception of
AUTO ) indicating the border
thickness on the bottom of the border. |
double |
getLeft()
The non-negative value (with the exception of
AUTO ) indicating the border
thickness on the left of the border. |
double |
getRight()
The non-negative value (with the exception of
AUTO ) indicating the border
thickness on the right of the border. |
double |
getTop()
A non-negative value (with the exception of
AUTO ) indicating the border
thickness on the top of the border. |
int |
hashCode() |
boolean |
isBottomAsPercentage()
Specifies whether the
bottom property should be interpreted as a percentage (true )
of the region height or not (false ). |
boolean |
isLeftAsPercentage()
Specifies whether the
left property should be interpreted as a percentage (true )
of the region width or not (false ). |
boolean |
isRightAsPercentage()
Specifies whether the
right property should be interpreted as a percentage (true )
of the region width or not (false ). |
boolean |
isTopAsPercentage()
Specifies whether the
top property should be interpreted as a percentage (true )
of the region height or not (false ). |
public static final double AUTO
BorderStroke.MEDIUM
for the corresponding side. When
used with a BorderImage, the value of AUTO means to read the corresponding
value from the BorderStroke(s), and not to specify it manually.public static final BorderWidths DEFAULT
public static final BorderWidths EMPTY
public static final BorderWidths FULL
public BorderWidths(double width)
width
- The border width. This cannot be negative.public BorderWidths(double top, double right, double bottom, double left)
top
- The thickness of the border on the top. Must be non-negative.right
- The thickness of the border on the right. Must be non-negative.bottom
- The thickness of the border on the bottom. Must be non-negative.left
- The thickness of the border on the left. Must be non-negative.public BorderWidths(double top, double right, double bottom, double left, boolean topAsPercentage, boolean rightAsPercentage, boolean bottomAsPercentage, boolean leftAsPercentage)
top
, right
, bottom
,
or left
can be non-negative.top
- The thickness of the border on the top. Must be non-negative.right
- The thickness of the border on the right. Must be non-negative.bottom
- The thickness of the border on the bottom. Must be non-negative.left
- The thickness of the border on the left. Must be non-negative.topAsPercentage
- Whether the top should be treated as a percentage.rightAsPercentage
- Whether the right should be treated as a percentage.bottomAsPercentage
- Whether the bottom should be treated as a percentage.leftAsPercentage
- Whether the left should be treated as a percentage.public final double getTop()
AUTO
) indicating the border
thickness on the top of the border. This value can be a literal value, or can be
treated as a percentage, based on the value of the
topAsPercentage
property.public final double getRight()
AUTO
) indicating the border
thickness on the right of the border. This value can be a literal value, or can be
treated as a percentage, based on the value of the
rightAsPercentage
property.public final double getBottom()
AUTO
) indicating the border
thickness on the bottom of the border. This value can be a literal value, or can be
treated as a percentage, based on the value of the
bottomAsPercentage
property.public final double getLeft()
AUTO
) indicating the border
thickness on the left of the border. This value can be an literal value, or can be
treated as a percentage, based on the value of the
leftAsPercentage
property.public final boolean isTopAsPercentage()
top
property should be interpreted as a percentage (true
)
of the region height or not (false
).public final boolean isRightAsPercentage()
right
property should be interpreted as a percentage (true
)
of the region width or not (false
).public final boolean isBottomAsPercentage()
bottom
property should be interpreted as a percentage (true
)
of the region height or not (false
).public final boolean isLeftAsPercentage()
left
property should be interpreted as a percentage (true
)
of the region width or not (false
).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.