modules/graphics/src/main/java/javafx/scene/layout/Region.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization


   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.scene.layout;
  27 
  28 import com.sun.javafx.util.Utils;
  29 import javafx.beans.InvalidationListener;
  30 import javafx.beans.property.BooleanProperty;
  31 import javafx.beans.property.DoubleProperty;
  32 import javafx.beans.property.ObjectProperty;
  33 import javafx.beans.property.ReadOnlyDoubleProperty;
  34 import javafx.beans.property.ReadOnlyDoubleWrapper;
  35 import javafx.beans.property.ReadOnlyObjectProperty;
  36 import javafx.beans.property.ReadOnlyObjectPropertyBase;
  37 import javafx.beans.value.ChangeListener;
  38 import javafx.collections.ObservableList;
  39 import javafx.css.CssMetaData;
  40 import javafx.css.Styleable;
  41 import javafx.css.StyleableBooleanProperty;
  42 import javafx.css.StyleableDoubleProperty;
  43 import javafx.css.StyleableObjectProperty;
  44 import javafx.css.StyleableProperty;
  45 import javafx.geometry.BoundingBox;
  46 import javafx.geometry.Bounds;
  47 import javafx.geometry.HPos;
  48 import javafx.geometry.Insets;
  49 import javafx.geometry.Orientation;
  50 import javafx.geometry.VPos;
  51 import javafx.scene.Node;
  52 import javafx.scene.Parent;
  53 import javafx.scene.image.Image;
  54 import javafx.scene.shape.Shape;
  55 import javafx.scene.shape.StrokeLineCap;
  56 import javafx.scene.shape.StrokeLineJoin;
  57 import javafx.scene.shape.StrokeType;
  58 import javafx.util.Callback;
  59 import java.util.ArrayList;
  60 import java.util.Collections;
  61 import java.util.Arrays;
  62 import java.util.List;
  63 import java.util.function.Function;
  64 import com.sun.javafx.util.Logging;
  65 import com.sun.javafx.util.TempState;
  66 import com.sun.javafx.binding.ExpressionHelper;
  67 import com.sun.javafx.css.converters.BooleanConverter;
  68 import com.sun.javafx.css.converters.InsetsConverter;
  69 import com.sun.javafx.css.converters.ShapeConverter;
  70 import com.sun.javafx.css.converters.SizeConverter;
  71 import com.sun.javafx.geom.BaseBounds;
  72 import com.sun.javafx.geom.PickRay;
  73 import com.sun.javafx.geom.RectBounds;
  74 import com.sun.javafx.geom.Vec2d;
  75 import com.sun.javafx.geom.transform.BaseTransform;
  76 import com.sun.javafx.scene.DirtyBits;
  77 import com.sun.javafx.scene.input.PickResultChooser;
  78 import com.sun.javafx.sg.prism.NGNode;
  79 import com.sun.javafx.sg.prism.NGRegion;
  80 import com.sun.javafx.tk.Toolkit;
  81 import sun.util.logging.PlatformLogger;
  82 import sun.util.logging.PlatformLogger.Level;
  83 
  84 /**
  85  * Region is the base class for all JavaFX Node-based UI Controls, and all layout containers.
  86  * It is a resizable Parent node which can be styled from CSS. It can have multiple backgrounds
  87  * and borders. It is designed to support as much of the CSS3 specification for backgrounds
  88  * and borders as is relevant to JavaFX.
  89  * The full specification is available at <a href="http://www.w3.org/TR/2012/CR-css3-background-20120724/">the W3C</a>.
  90  * <p/>




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.scene.layout;
  27 

  28 import javafx.beans.InvalidationListener;
  29 import javafx.beans.property.BooleanProperty;
  30 import javafx.beans.property.DoubleProperty;
  31 import javafx.beans.property.ObjectProperty;
  32 import javafx.beans.property.ReadOnlyDoubleProperty;
  33 import javafx.beans.property.ReadOnlyDoubleWrapper;
  34 import javafx.beans.property.ReadOnlyObjectProperty;
  35 import javafx.beans.property.ReadOnlyObjectPropertyBase;
  36 import javafx.beans.value.ChangeListener;
  37 import javafx.collections.ObservableList;
  38 import javafx.css.CssMetaData;
  39 import javafx.css.Styleable;
  40 import javafx.css.StyleableBooleanProperty;
  41 import javafx.css.StyleableDoubleProperty;
  42 import javafx.css.StyleableObjectProperty;
  43 import javafx.css.StyleableProperty;
  44 import javafx.geometry.BoundingBox;
  45 import javafx.geometry.Bounds;
  46 import javafx.geometry.HPos;
  47 import javafx.geometry.Insets;
  48 import javafx.geometry.Orientation;
  49 import javafx.geometry.VPos;
  50 import javafx.scene.Node;
  51 import javafx.scene.Parent;
  52 import javafx.scene.image.Image;
  53 import javafx.scene.shape.Shape;
  54 import javafx.scene.shape.StrokeLineCap;
  55 import javafx.scene.shape.StrokeLineJoin;
  56 import javafx.scene.shape.StrokeType;
  57 import javafx.util.Callback;
  58 import java.util.ArrayList;
  59 import java.util.Collections;
  60 import java.util.Arrays;
  61 import java.util.List;
  62 import java.util.function.Function;
  63 import com.sun.javafx.util.Logging;
  64 import com.sun.javafx.util.TempState;
  65 import com.sun.javafx.binding.ExpressionHelper;
  66 import javafx.css.converter.BooleanConverter;
  67 import javafx.css.converter.InsetsConverter;
  68 import javafx.css.converter.ShapeConverter;
  69 import javafx.css.converter.SizeConverter;
  70 import com.sun.javafx.geom.BaseBounds;
  71 import com.sun.javafx.geom.PickRay;
  72 import com.sun.javafx.geom.RectBounds;
  73 import com.sun.javafx.geom.Vec2d;
  74 import com.sun.javafx.geom.transform.BaseTransform;
  75 import com.sun.javafx.scene.DirtyBits;
  76 import com.sun.javafx.scene.input.PickResultChooser;
  77 import com.sun.javafx.sg.prism.NGNode;
  78 import com.sun.javafx.sg.prism.NGRegion;
  79 import com.sun.javafx.tk.Toolkit;
  80 import sun.util.logging.PlatformLogger;
  81 import sun.util.logging.PlatformLogger.Level;
  82 
  83 /**
  84  * Region is the base class for all JavaFX Node-based UI Controls, and all layout containers.
  85  * It is a resizable Parent node which can be styled from CSS. It can have multiple backgrounds
  86  * and borders. It is designed to support as much of the CSS3 specification for backgrounds
  87  * and borders as is relevant to JavaFX.
  88  * The full specification is available at <a href="http://www.w3.org/TR/2012/CR-css3-background-20120724/">the W3C</a>.
  89  * <p/>