/* * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javafx.scene.layout; import java.util.Arrays; import java.util.Collections; import java.util.List; import javafx.geometry.Insets; import javafx.scene.Node; import javafx.scene.paint.Paint; import com.sun.javafx.UnmodifiableArrayList; import com.sun.javafx.css.StyleableProperty; import com.sun.javafx.css.SubStyleableProperty; import com.sun.javafx.css.converters.InsetsConverter; import com.sun.javafx.css.converters.URLConverter; import com.sun.javafx.scene.layout.region.BorderImageWidthConverter; import com.sun.javafx.scene.layout.region.LayeredBorderPaintConverter; import com.sun.javafx.scene.layout.region.LayeredBorderStyleConverter; import com.sun.javafx.scene.layout.region.Margins; import com.sun.javafx.scene.layout.region.RepeatStruct; import com.sun.javafx.scene.layout.region.RepeatStructConverter; import com.sun.javafx.scene.layout.region.SliceSequenceConverter; /** * The Border of a {@link 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 * {@link ../doc-files/cssref.html JavaFX CSS Reference} for a complete description * of the CSS rules for styling the border of a Region. *
* Every Border is comprised of {@link #getStrokes() strokes} and / or * {@link #getImages() 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 {@link #getInsets() insets} * and {@link #getOutsets() outsets} of the Border. * * The Border's {@link #getOutsets() 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 {@link BorderStroke}s and {@link BorderImage}s specified on this Border. * Outsets are strictly non-negative. * * {@link #getInsets()} 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 {@link Background} and Border * and the {@link javafx.scene.layout.Region#getPadding() Region's padding} to determine the * Region {@link javafx.scene.layout.Region#getInsets() 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 {@code layoutBounds}, {@code boundsInLocal}, and {@code 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. * * @since JavaFX 8 */ public final class Border { static final StyleableProperty
* This List is unmodifiable and immutable. It will never be null.
* It will never contain any null elements.
*/
final List