Region. A Border is an immutable object which
encapsulates the entire set of data required to render the border
of a Region. Because this class is immutable, you can freely reuse the same
Border on many different Regions. Please refer to
JavaFX CSS Reference Guide for a
complete description of the CSS rules for styling the border of a Region.
Every Border is comprised of strokes and / or
images. Neither list will ever be null, but either or
both may be empty. When rendering, if no images are specified or no
image succeeds in loading, then all strokes will be rendered in order.
If any image is specified and succeeds in loading, then no strokes will
be drawn, although they will still contribute to the insets
and outsets of the Border.
The Border's outsets define any extension of the drawing area of a Region
which is necessary to account for all border drawing and positioning. These outsets are defined
by both the BorderStrokes and BorderImages specified on this Border.
outsets are strictly non-negative.
insets are used to define the inner-most edge of all of the borders. It also is
always strictly non-negative. The Region uses the insets of the Background and Border,
and the Region's padding to determine the
Region insets, which define the content area
for any children of the Region. The outsets of a Border together with the outsets of
a Background, and the width and height of the Region define the geometric bounds of the
Region (which in turn contribute to the layoutBounds, boundsInLocal, and
boundsInParent).
A Border is most often used in cases where you want to skin the Region with an image,
often used in conjunction with 9-patch scaling techniques. In such cases, you may
also specify a stroked border which is only used when the image fails to load for some
reason.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final CssMetaData | |
| pack-priv static final CssMetaData | |
| pack-priv static final CssMetaData | |
| pack-priv static final CssMetaData | |
| pack-priv static final CssMetaData | |
| pack-priv static final CssMetaData | |
| pack-priv static final CssMetaData | |
| pack-priv static final CssMetaData | |
| pack-priv static final CssMetaData | |
| pack-priv static final CssMetaData | |
| public static final Border | EMPTY
An empty Border, useful to use instead of null. |
| private final int | hash
The cached hash code computation for the Border. |
| private final List | |
| private final Insets | |
| private final Insets | |
| private final List | |
| private static final List |
| Access | Constructor and Description |
|---|---|
| public | Border(BorderStroke...
The strokes. This may be null, and may contain nulls. Any
contained nulls are filtered out and not included in the
final List of strokes. A null array becomes an empty List.
If both strokes and images are specified, and if any one
of the images specified succeeds in loading, then no
strokes are shown. In this way, strokes can be defined as
a fallback in the case that an image failed to load. strokes)Creates a new Border by supplying an array of BorderStrokes. |
| public | Border(BorderImage...
The images. This may be null, and may contain nulls. Any
contained nulls are filtered out and not included in the
final List of images. A null array becomes an empty List. images)Creates a new Border by supplying an array of BorderImages. |
| public | Border(List<BorderStroke>
The strokes. This may be null, and may contain nulls. Any
contained nulls are filtered out and not included in the
final List of strokes. A null array becomes an empty List.
If both strokes and images are specified, and if any one
of the images specified succeeds in loading, then no
strokes are shown. In this way, strokes can be defined as
a fallback in the case that an image failed to load. strokes, List<BorderImage> The images. This may be null, and may contain nulls. Any
contained nulls are filtered out and not included in the
final List of images. A null array becomes an empty List. images)Creates a new Border by supplying a List of BorderStrokes and BorderImages. |
| public | Border(BorderStroke[]
The strokes. This may be null, and may contain nulls. Any
contained nulls are filtered out and not included in the
final List of strokes. A null array becomes an empty List.
If both strokes and images are specified, and if any one
of the images specified succeeds in loading, then no
strokes are shown. In this way, strokes can be defined as
a fallback in the case that an image failed to load. strokes, BorderImage[] The images. This may be null, and may contain nulls. Any
contained nulls are filtered out and not included in the
final List of images. A null array becomes an empty List. images)Creates a new Border by supplying an array of BorderStrokes and BorderImages. |
| private | Border(List<BorderStroke>
the strokes, not strokes, List<BorderImage> nullthe images, not images, int ignored)nullCreates a new Border with the specified strokes and images. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object o)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public static List | Returns: theCssMetaDataGets the |
| public final List | Returns: the list of BorderImages which together define the images to use instead of stroke for this BorderThe list of BorderImages which together define the images to use instead of stroke for this Border. |
| public final Insets | Returns: the insets define the distance from the edge of the Region to the inner-most edge of the borderThe insets define the distance from the edge of the Region to the inner-most edge of the border, if that distance is non-negative. |
| public final Insets | Returns: the outsets of the border define the outer-most edge of the border to be drawnThe outsets of the border define the outer-most edge of the border to be drawn. |
| public final List | Returns: the list of BorderStrokes which together define the stroked portion of this BorderThe list of BorderStrokes which together define the stroked portion of this Border. |
| public int | |
| public Border | interpolate(Border endValue, double t)
Implements javafx. Returns an intermediate value between the value of this |
| public final boolean | |
| public static Border |
| BORDER_COLOR | back to summary |
|---|---|
| pack-priv static final CssMetaData<Node, Paint[]> BORDER_COLOR | |
| BORDER_IMAGE_INSETS | back to summary |
|---|---|
| pack-priv static final CssMetaData<Node, Insets[]> BORDER_IMAGE_INSETS | |
| BORDER_IMAGE_REPEAT | back to summary |
|---|---|
| pack-priv static final CssMetaData<Node, RepeatStruct[]> BORDER_IMAGE_REPEAT | |
| BORDER_IMAGE_SLICE | back to summary |
|---|---|
| pack-priv static final CssMetaData<Node, BorderImageSlices[]> BORDER_IMAGE_SLICE | |
| BORDER_IMAGE_SOURCE | back to summary |
|---|---|
| pack-priv static final CssMetaData<Node, String[]> BORDER_IMAGE_SOURCE | |
| BORDER_IMAGE_WIDTH | back to summary |
|---|---|
| pack-priv static final CssMetaData<Node, BorderWidths[]> BORDER_IMAGE_WIDTH | |
| BORDER_INSETS | back to summary |
|---|---|
| pack-priv static final CssMetaData<Node, Insets[]> BORDER_INSETS | |
| BORDER_RADIUS | back to summary |
|---|---|
| pack-priv static final CssMetaData<Node, CornerRadii[]> BORDER_RADIUS | |
| BORDER_STYLE | back to summary |
|---|---|
| pack-priv static final CssMetaData<Node, BorderStrokeStyle[][]> BORDER_STYLE | |
| BORDER_WIDTH | back to summary |
|---|---|
| pack-priv static final CssMetaData<Node, Margins[]> BORDER_WIDTH | |
| EMPTY | back to summary |
|---|---|
| public static final Border EMPTY An empty Border, useful to use instead of null. | |
| hash | back to summary |
|---|---|
| private final int hash The cached hash code computation for the Border. One very big reason for making Border immutable was to make it possible to cache and reuse the same Border instance for multiple Regions. To enable efficient caching, we cache the hash. | |
| images | back to summary |
|---|---|
| private final List<BorderImage> images | |
| insets | back to summary |
|---|---|
| private final Insets insets | |
| outsets | back to summary |
|---|---|
| private final Insets outsets | |
| strokes | back to summary |
|---|---|
| private final List<BorderStroke> strokes | |
| STYLEABLES | back to summary |
|---|---|
| private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES | |
| Border | back to summary |
|---|---|
| public Border(BorderStroke... strokes) Creates a new Border by supplying an array of BorderStrokes.
This array may be null, or may contain null values. Any null values
will be ignored and will not contribute to the
| |
| Border | back to summary |
|---|---|
| public Border(BorderImage... images) Creates a new Border by supplying an array of BorderImages.
This array may be null, or may contain null values. Any null values
will be ignored and will not contribute to the
| |
| Border | back to summary |
|---|---|
| public Border(List<BorderStroke> strokes, List<BorderImage> images) Creates a new Border by supplying a List of BorderStrokes and BorderImages.
These Lists may be null, or may contain null values. Any null values
will be ignored and will not contribute to the
| |
| Border | back to summary |
|---|---|
| public Border(BorderStroke[] strokes, BorderImage[] images) Creates a new Border by supplying an array of BorderStrokes and BorderImages.
These arrays may be null, or may contain null values. Any null values
will be ignored and will not contribute to the
| |
| Border | back to summary |
|---|---|
| private Border(List<BorderStroke> strokes, List<BorderImage> images, int ignored) Creates a new Border with the specified strokes and images. This constructor requires that both lists do not contain null values, and that the lists are immutable. The purpose of this constructor is to prevent an unnecessary array creation when the caller already knows that the specified lists satisfy the non-null precondition and preserve the immutability invariant.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getClassCssMetaData | back to summary |
|---|---|
| public static List Gets the
| |
| getImages | back to summary |
|---|---|
| public final List The list of BorderImages which together define the images to use
instead of stroke for this Border. If this list is specified and
at least one image within it succeeds in loading, then any specified
This List is unmodifiable and immutable. It will never be null. It will never contain any null elements.
| |
| getInsets | back to summary |
|---|---|
| public final Insets getInsets() The insets define the distance from the edge of the Region to the inner-most edge of the border, if that distance is non-negative. The values in these insets are strictly non-negative.
| |
| getOutsets | back to summary |
|---|---|
| public final Insets getOutsets() The outsets of the border define the outer-most edge of the border to be drawn. The values in these outsets are strictly non-negative.
| |
| getStrokes | back to summary |
|---|---|
| public final List The list of BorderStrokes which together define the stroked portion of this Border. This List is unmodifiable and immutable. It will never be null. It will never contain any null elements.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| interpolate | back to summary |
|---|---|
| public Border interpolate(Border endValue, double t) Implements javafx. Doc from javafx. Returns an intermediate value between the value of this 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.
| |
| isEmpty | back to summary |
|---|---|
| public final boolean isEmpty() Gets whether the Border is empty. It is empty if there are no strokes or images.
| |
| stroke | back to summary |
|---|---|
| public static Border stroke(Paint stroke) A convenience factory method for creating a solid Implementation Specification This call is equivalent to | |