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

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


  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.binding.ExpressionHelper;
  29 import java.util.ArrayList;
  30 import java.util.Collections;
  31 import java.util.List;
  32 import javafx.beans.property.DoubleProperty;
  33 import javafx.beans.property.IntegerProperty;
  34 import javafx.beans.property.ObjectProperty;
  35 import javafx.beans.property.ReadOnlyDoubleProperty;
  36 import javafx.beans.property.ReadOnlyDoubleWrapper;
  37 import javafx.css.CssMetaData;
  38 import javafx.css.StyleableDoubleProperty;
  39 import javafx.css.StyleableIntegerProperty;
  40 import javafx.css.StyleableObjectProperty;
  41 import javafx.css.StyleableProperty;
  42 import javafx.geometry.HPos;
  43 import javafx.geometry.Insets;
  44 import javafx.geometry.Orientation;
  45 import javafx.geometry.Pos;
  46 import javafx.geometry.VPos;
  47 import javafx.scene.Node;
  48 import com.sun.javafx.css.converters.EnumConverter;
  49 import com.sun.javafx.css.converters.SizeConverter;
  50 import java.util.function.Function;
  51 import javafx.beans.InvalidationListener;
  52 import javafx.beans.value.ChangeListener;
  53 import javafx.css.Styleable;
  54 
  55 import static javafx.geometry.Orientation.*;
  56 import javafx.util.Callback;
  57 
  58 
  59 /**
  60  * TilePane lays out its children in a grid of uniformly sized "tiles".
  61  * <p>
  62  * A horizontal tilepane (the default) will tile nodes in rows, wrapping at the
  63  * tilepane's width.  A vertical tilepane will tile nodes in columns,
  64  * wrapping at the tilepane's height.
  65  * <p>
  66  * The size of each "tile" defaults to the size needed to encompass the largest
  67  * preferred width and height of the tilepane's children and the tilepane
  68  * will recompute the size of the tiles as needed to accommodate the largest preferred
  69  * size of its children as it changes.   The application may also control the size
  70  * of the tiles directly by setting prefTileWidth/prefTileHeight




  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.binding.ExpressionHelper;
  29 import java.util.ArrayList;
  30 import java.util.Collections;
  31 import java.util.List;
  32 import javafx.beans.property.DoubleProperty;
  33 import javafx.beans.property.IntegerProperty;
  34 import javafx.beans.property.ObjectProperty;
  35 import javafx.beans.property.ReadOnlyDoubleProperty;

  36 import javafx.css.CssMetaData;
  37 import javafx.css.StyleableDoubleProperty;
  38 import javafx.css.StyleableIntegerProperty;
  39 import javafx.css.StyleableObjectProperty;
  40 import javafx.css.StyleableProperty;
  41 import javafx.geometry.HPos;
  42 import javafx.geometry.Insets;
  43 import javafx.geometry.Orientation;
  44 import javafx.geometry.Pos;
  45 import javafx.geometry.VPos;
  46 import javafx.scene.Node;
  47 import javafx.css.converter.EnumConverter;
  48 import javafx.css.converter.SizeConverter;

  49 import javafx.beans.InvalidationListener;
  50 import javafx.beans.value.ChangeListener;
  51 import javafx.css.Styleable;
  52 
  53 import static javafx.geometry.Orientation.*;
  54 import javafx.util.Callback;
  55 
  56 
  57 /**
  58  * TilePane lays out its children in a grid of uniformly sized "tiles".
  59  * <p>
  60  * A horizontal tilepane (the default) will tile nodes in rows, wrapping at the
  61  * tilepane's width.  A vertical tilepane will tile nodes in columns,
  62  * wrapping at the tilepane's height.
  63  * <p>
  64  * The size of each "tile" defaults to the size needed to encompass the largest
  65  * preferred width and height of the tilepane's children and the tilepane
  66  * will recompute the size of the tiles as needed to accommodate the largest preferred
  67  * size of its children as it changes.   The application may also control the size
  68  * of the tiles directly by setting prefTileWidth/prefTileHeight