Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > afb4c294e8f553dc8d6909c852dc1564 > files > 1370

java-1.8.0-openjfx-1.8.0.76-1.b04.1.1.mga5.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_77) on Wed Apr 06 14:52:12 UTC 2016 -->
<title>javafx.scene.layout (JavaFX 8)</title>
<meta name="date" content="2016-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="javafx.scene.layout (JavaFX 8)";
        }
    }
    catch(err) {
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">JavaFX&nbsp;8</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javafx/scene/input/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../javafx/scene/media/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javafx/scene/layout/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<a name="skip.navbar.top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;javafx.scene.layout</h1>
<div class="docSummary">
<div class="block">
Provides classes to support user interface layout.</div>
</div>
<p>See:&nbsp;<a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/AnchorPane.html" title="class in javafx.scene.layout">AnchorPane</a></td>
<td class="colLast">
<div class="block">AnchorPane allows the edges of child nodes to be anchored to an offset from
 the anchor pane's edges.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/Background.html" title="class in javafx.scene.layout">Background</a></td>
<td class="colLast">
<div class="block">The Background of a <a href="../../../javafx/scene/layout/Region.html" title="class in javafx.scene.layout"><code>Region</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BackgroundFill.html" title="class in javafx.scene.layout">BackgroundFill</a></td>
<td class="colLast">
<div class="block">The fill and associated properties that direct how to fill the background of a
 <a href="../../../javafx/scene/layout/Region.html" title="class in javafx.scene.layout"><code>Region</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BackgroundImage.html" title="class in javafx.scene.layout">BackgroundImage</a></td>
<td class="colLast">
<div class="block">Defines properties describing how to render an image as the background to
 some <a href="../../../javafx/scene/layout/Region.html" title="class in javafx.scene.layout"><code>Region</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BackgroundPosition.html" title="class in javafx.scene.layout">BackgroundPosition</a></td>
<td class="colLast">
<div class="block">Represents the position of a <a href="../../../javafx/scene/layout/BackgroundImage.html" title="class in javafx.scene.layout"><code>BackgroundImage</code></a> within the
 <a href="../../../javafx/scene/layout/Region.html" title="class in javafx.scene.layout"><code>Region</code></a>'s drawing area.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BackgroundSize.html" title="class in javafx.scene.layout">BackgroundSize</a></td>
<td class="colLast">
<div class="block">Defines the size of the area that a BackgroundImage should fill relative
 to the Region it is styling.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/Border.html" title="class in javafx.scene.layout">Border</a></td>
<td class="colLast">
<div class="block">The Border of a <a href="../../../javafx/scene/layout/Region.html" title="class in javafx.scene.layout"><code>Region</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BorderImage.html" title="class in javafx.scene.layout">BorderImage</a></td>
<td class="colLast">
<div class="block">Defines properties describing how to render an image as the border of
 some Region.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BorderPane.html" title="class in javafx.scene.layout">BorderPane</a></td>
<td class="colLast">
<div class="block">BorderPane lays out children in top, left, right, bottom, and center positions.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BorderStroke.html" title="class in javafx.scene.layout">BorderStroke</a></td>
<td class="colLast">
<div class="block">Defines the stroke to use on a Border for styling a Region.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BorderStrokeStyle.html" title="class in javafx.scene.layout">BorderStrokeStyle</a></td>
<td class="colLast">
<div class="block">Defines the style of the stroke to use on one side of a BorderStroke.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BorderWidths.html" title="class in javafx.scene.layout">BorderWidths</a></td>
<td class="colLast">
<div class="block">Defines widths for four components (top, right, bottom, and left).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/ColumnConstraints.html" title="class in javafx.scene.layout">ColumnConstraints</a></td>
<td class="colLast">
<div class="block">Defines optional layout constraints for a column in a <a href="../../../javafx/scene/layout/GridPane.html" title="class in javafx.scene.layout"><code>GridPane</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/ConstraintsBase.html" title="class in javafx.scene.layout">ConstraintsBase</a></td>
<td class="colLast">
<div class="block">The base class for defining node-specific layout constraints.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/CornerRadii.html" title="class in javafx.scene.layout">CornerRadii</a></td>
<td class="colLast">
<div class="block">Defines the radii of each of the four corners of a BorderStroke.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/FlowPane.html" title="class in javafx.scene.layout">FlowPane</a></td>
<td class="colLast">
<div class="block">FlowPane lays out its children in a flow that wraps at the flowpane's boundary.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/GridPane.html" title="class in javafx.scene.layout">GridPane</a></td>
<td class="colLast">
<div class="block">GridPane lays out its children within a flexible grid of rows and columns.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/HBox.html" title="class in javafx.scene.layout">HBox</a></td>
<td class="colLast">
<div class="block">HBox lays out its children in a single horizontal row.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/Pane.html" title="class in javafx.scene.layout">Pane</a></td>
<td class="colLast">
<div class="block">Base class for layout panes which need to expose the children list as public
 so that users of the subclass can freely add/remove children.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/Region.html" title="class in javafx.scene.layout">Region</a></td>
<td class="colLast">
<div class="block">Region is the base class for all JavaFX Node-based UI Controls, and all layout containers.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/RowConstraints.html" title="class in javafx.scene.layout">RowConstraints</a></td>
<td class="colLast">
<div class="block">Defines optional layout constraints for a row in a <a href="../../../javafx/scene/layout/GridPane.html" title="class in javafx.scene.layout"><code>GridPane</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/StackPane.html" title="class in javafx.scene.layout">StackPane</a></td>
<td class="colLast">
<div class="block">StackPane lays out its children in a back-to-front stack.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/TilePane.html" title="class in javafx.scene.layout">TilePane</a></td>
<td class="colLast">
<div class="block">TilePane lays out its children in a grid of uniformly sized "tiles".</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/VBox.html" title="class in javafx.scene.layout">VBox</a></td>
<td class="colLast">
<div class="block">VBox lays out its children in a single vertical column.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation">
<caption><span>Enum Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Enum</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BackgroundRepeat.html" title="enum in javafx.scene.layout">BackgroundRepeat</a></td>
<td class="colLast">
<div class="block">Enumeration of options for repeating images in backgrounds</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/BorderRepeat.html" title="enum in javafx.scene.layout">BorderRepeat</a></td>
<td class="colLast">
<div class="block">Enum indicating the repetition rules for border images.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javafx/scene/layout/Priority.html" title="enum in javafx.scene.layout">Priority</a></td>
<td class="colLast">
<div class="block">Enumeration used to determine the grow (or shrink) priority of a given node's
 layout area when its region has more (or less) space available and
 multiple nodes are competing for that space.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!--   -->
</a>
<h2 title="Package javafx.scene.layout Description">Package javafx.scene.layout Description</h2>
<div class="block"><p>
Provides classes to support user interface layout.
Each layout pane class supports a different layout strategy for its children
and applications may nest these layout panes to achieve the needed layout structure
in the user interface.  Once a node is added to one of the layout panes,
the pane will automatically manage the layout for the node, so the application
should not position or resize the node directly; see &quot;Node Resizability&quot;
for more details.
</p>

<h3>Scene Graph Layout Mechanism</h3>
<p>
The scene graph layout mechanism is driven automatically by the system once
the application creates and displays a <a href="../../../javafx/scene/Scene.html" title="class in javafx.scene"><code>Scene</code></a>.
The scene graph detects dynamic node changes which affect layout (such as a
change in size or content) and calls <code>requestLayout()</code>, which marks that
branch as needing layout so that on the next pulse, a top-down layout pass is
executed on that branch by invoking <code>layout()</code> on that branch's root.
During that layout pass, the <code>layoutChildren()</code> callback method will
be called on each parent to layout its children.  This mechanism is designed
to maximize layout efficiency by ensuring multiple layout requests are coalesced
and processed in a single pass rather than executing re-layout on on each minute
change. Therefore, applications should not invoke layout directly on nodes.
</p>


<h3>Node Resizability</h3>
<p>
The scene graph supports both resizable and non-resizable node classes.  The
<code>isResizable()</code> method on <a href="../../../javafx/scene/Node.html" title="class in javafx.scene"><code>Node</code></a> returns whether a
given node is resizable or not.  A resizable node class is one which supports a range
of acceptable sizes (minimum <= preferred <= maximum), allowing its parent to resize
it within that range during layout, given the parent's own layout policy and the
layout needs of sibling nodes.  Node supports the following methods for layout code
to determine a node's resizable range:
<code><pre>
    public Orientation getContentBias()
    public double minWidth(double height)
    public double minHeight(double width)
    public double prefWidth(double height)
    public double prefHeight(double width)
    public double maxWidth(double height)
    public double maxHeight(double width)
</pre></code>
<p>
Non-resizable node classes, on the other hand, do <em>not</em> have a consistent
resizing API and so are <em>not</em> resized by their parents during layout.
Applications must establish the size of non-resizable nodes by setting
appropriate properties on each instance. These classes return their current layout bounds for
min, pref, and max, and the <code>resize()</code> method becomes a no-op.</p>
<p>
<br>Resizable classes: <a href="../../../javafx/scene/layout/Region.html" title="class in javafx.scene.layout"><code>Region</code></a>, <a href="../../../javafx/scene/control/Control.html" title="class in javafx.scene.control"><code>Control</code></a>, <a href="../../../javafx/scene/web/WebView.html" title="class in javafx.scene.web"><code>WebView</code></a>
<br>Non-Resizable classes: <a href="../../../javafx/scene/Group.html" title="class in javafx.scene"><code>Group</code></a>, <a href="../../../javafx/scene/shape/Shape.html" title="class in javafx.scene.shape"><code>Shape</code></a>, <a href="../../../javafx/scene/text/Text.html" title="class in javafx.scene.text"><code>Text</code></a>
</p>
<p>
For example, a Button control (resizable) computes its min, pref, and max sizes
which its parent will use to resize it during layout, so the application only needs
to configure its content and properties:

<pre><code>    Button button = new Button("Apply");
</code></pre>
However, a Circle (non-resizable) cannot be resized by its parent, so the application
needs to set appropriate geometric properties which determine its size:

<pre><code>    Circle circle = new Circle();
    circle.setRadius(50);
</code></pre>
</p>

<h3>Resizable Range</h3>

Each resizable node class computes an appropriate min, pref, and max size based
on its own content and property settings (it's 'intrinsic' size range).
Some resizable classes have an unbounded max size (all layout panes) while
others have a max size that is clamped by default to their preferred size (buttons)
(See individual class documentation for the default range of each class).
While these defaults are geared towards common usage, applications often need
to explicitly alter or set a node's resizable range to achieve certain layouts.
The resizable classes provide properties for overriding the min, pref and max
sizes for this purpose.
<p>For example, to override the preferred size of a ListView:</p>
<pre><code>    listview.setPrefSize(200,300);
</code></pre>
<p>Or, to change the max width of a button so it will resize wider to fill a space:
<pre><code>    button.setMaxWidth(Double.MAX_VALUE);
</code></pre>
<p>For the inverse case, where the application needs to clamp the node's min
or max size to its preferred:
<pre><code>    listview.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE);
</code></pre>
And finally, if the application needs to restore the intrinsically computed values:
<pre><code>    listview.setPrefSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);
</code></pre>

<h3>CSS Styling and Node Sizing</h3>

Applications cannot reliably query the bounds of a resizable node until it has been
added to a scene because the size of that node may be dependent on CSS.  This is
because CSS is used to style many aspects of a node which affect it's preferred size
(font, padding, borders, etc) and so the node cannot be layed out (resized) until
CSS has been applied and the parent can access valid size range metrics.
This is always true for Controls (and any panes that contain them), because they
rely on CSS for their default style, even if no user-level style sheets have been set.
Stylesheets are set at the Scene level, which means that styles cannot even
be determined until a node's enclosing scene has been initialized. Once a Scene
is initialized, CSS is applied to nodes on each pulse (when needed) just before
the layout pass.



<h3>Visual Bounds vs. Layout Bounds</h3>

A graphically rich user interface often has the need to make a distinction between
a node's visual bounds and the bounds used for layout.  For example, the tight visual
bounds of a Text node's character glyphs would not work for layout, as the text
would not be aligned and leading/trailing whitespace would be discounted.  Also,
sometimes applications wish to apply affects and transforms to nodes without
disturbing the surrounding layout (bouncing, jiggling, drop shadows, glows, etc).
To support this distinction in the scene graph, <a href="../../../javafx/scene/Node.html" title="class in javafx.scene"><code>Node</code></a>
provides the <code>layoutBounds</code> property to define the 'logical' bounds
of the node for layout and <code>boundsInParent</code> to define the visual bounds
once all effects, clipping, and transforms have been applied.

<p>These two bounds properties will often differ for a given node and
<code>layoutBounds</code> is computed differently depending on the node class:

<table border="1" padding="4" summary="bounds computations">
 <thead>
     <tr>
         <th halign="left">Node Type</th>
         <th halign="left">Layout Bounds</th>
     </tr>
 </thead>
 <tbody>
     <tr>
         <td><a href="../../../javafx/scene/shape/Shape.html" title="class in javafx.scene.shape"><code>Shape</code></a>,<a href="../../../javafx/scene/image/ImageView.html" title="class in javafx.scene.image"><code>ImageView</code></a></td>
         <td>Includes geometric bounds (geometry plus stroke).
             Does NOT include effect, clip, or any transforms.
         </td>
     </tr>
     <tr>
         <td><a href="../../../javafx/scene/text/Text.html" title="class in javafx.scene.text"><code>Text</code></a></td>
         <td>logical bounds based on the font height and content width, including white space.
             can be configured to be tight bounds around chars glyphs by setting <code>boundsType</code>.
             Does NOT include effect, clip, or any transforms.
         </td>
     </tr>
     <tr>
         <td><a href="../../../javafx/scene/layout/Region.html" title="class in javafx.scene.layout"><code>Region</code></a>, <a href="../../../javafx/scene/control/Control.html" title="class in javafx.scene.control"><code>Control</code></a>, <a href="../../../javafx/scene/web/WebView.html" title="class in javafx.scene.web"><code>WebView</code></a></td>
         <td>always <code>[0,0 width x height]</code> regardless of visual bounds,
             which might be larger or smaller than layout bounds.
         </td>
     </tr>
     <tr>
         <td><a href="../../../javafx/scene/Group.html" title="class in javafx.scene"><code>Group</code></a></td>
         <td>Union of all visible childrens' visual bounds (<code>boundsInParent</code>)
             Does NOT include effect, clip, or transforms set directly on group,
             however DOES include effect, clip, transforms set on individual children since
             those are included in the child's <code>boundsInParent</code>.
         </td>
     </tr>
 </tbody>
</table></p>
<p>
So for example, if a <a href="../../../javafx/scene/effect/DropShadow.html" title="class in javafx.scene.effect"><code>DropShadow</code></a> is added to a shape,
that shadow will <em>not</em>  be factored into layout by default.  Or, if a
<a href="../../../javafx/animation/ScaleTransition.html" title="class in javafx.animation"><code>ScaleTransition</code></a> is used to
pulse the size of a button, that pulse animation will not disturb layout around
that button.  If an application wishes to have the effect, clip, or transform
factored into the layout of a node, it should wrap that node in a Group.
</p></div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">JavaFX&nbsp;8</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javafx/scene/input/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../javafx/scene/media/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javafx/scene/layout/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<a name="skip.navbar.bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><small><a href="https://docs.oracle.com/javase/8/docs/legal/cpyr.html">Copyright</a> (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.</small></small></p>
</body>
</html>