blob: c67571b981dddf66124aaf9926a2bf7de4b0d919 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<document id="stack-panes">
<properties>
<title>Stack Panes</title>
</properties>
<body>
<p>
Stack panes arrange their children in layers, like a stack of transparencies.
Unlike <a href="card-panes.html">card panes</a>, which show only a single component at
a time, stack panes always display all of their child components. Components with a
higher z-index (position within the stack pane) are painted on top of components with
a lower z-index.
</p>
<p>
The following example shows a stack pane containing an image view and a label. The
label is layered on top of the image:
</p>
<application class="org.apache.pivot.wtk.ScriptApplication"
width="480" height="360">
<libraries>
<library>core</library>
<library>wtk</library>
<library>wtk-terra</library>
<library>tutorials</library>
</libraries>
<startup-properties>
<src>/org/apache/pivot/tutorials/layout/stack_panes.bxml</src>
</startup-properties>
</application>
<p>
The BXML source for the example is as follows:
</p>
<source type="xml" location="org/apache/pivot/tutorials/layout/stack_panes.bxml">
<![CDATA[
<Window title="Stack Panes" maximized="true"
xmlns:bxml="http://pivot.apache.org/bxml"
xmlns="org.apache.pivot.wtk">
<StackPane>
<ImageView image="@background.png"
styles="{fill:true, preserveAspectRatio:false}"/>
<Label text="StackPane Demo"
styles="{font:'Helvetica bold 64', color:'#ffffff', wrapText:true,
horizontalAlignment:'center', verticalAlignment:'center'}"/>
</StackPane>
</Window>
]]>
</source>
<p>
Since this example contains no logic, there is no associated Java source.
</p>
</body>
</document>