| <?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="borders"> |
| <properties> |
| <title>Borders</title> |
| </properties> |
| |
| <body> |
| <p> |
| Like <a href="separators.html">separators</a>, borders are used to visually partition |
| application content. Like <tt>Separator</tt>, the <tt>Border</tt> class provides an |
| optional <tt>title</tt> property that can be used to assign a heading to the border. |
| However, unlike separators, borders are containers. A border accepts a single content |
| component that it sizes to fit its available client area. |
| </p> |
| |
| <p> |
| The example below shows two <tt>Border</tt> components, each of which contains a label. |
| The border on the left has a title and showcases the default border style. The border |
| on the left has no title and applies some custom style values: |
| </p> |
| |
| <application class="org.apache.pivot.wtk.ScriptApplication" |
| width="320" height="240"> |
| <libraries> |
| <library>core</library> |
| <library>wtk</library> |
| <library>wtk-terra</library> |
| <library>tutorials</library> |
| </libraries> |
| <startup-properties> |
| <src>/org/apache/pivot/tutorials/layout/borders.bxml</src> |
| </startup-properties> |
| </application> |
| |
| <p> |
| The BXML for this example is shown below: |
| </p> |
| |
| <source type="xml" location="org/apache/pivot/tutorials/layout/borders.bxml"> |
| <![CDATA[ |
| <Window title="Borders" maximized="true" |
| xmlns:bxml="http://pivot.apache.org/bxml" |
| xmlns="org.apache.pivot.wtk"> |
| <TablePane styles="{horizontalSpacing:10}"> |
| <columns> |
| <TablePane.Column width="1*"/> |
| <TablePane.Column width="1*"/> |
| </columns> |
| |
| <TablePane.Row height="1*"> |
| <Border title="Border 1" styles="{padding:2}"> |
| <Label text="Default border with title" |
| styles="{horizontalAlignment:'center', verticalAlignment:'center', wrapText:true}"/> |
| </Border> |
| <Border styles="{color:'#ff0000', titleColor:'#000000', thickness:10, |
| cornerRadii:20, padding:2}"> |
| <Label text="Custom border with 10-pixel thick red border, rounded corners, and no title" |
| styles="{horizontalAlignment:'center', verticalAlignment:'center', wrapText:true}"/> |
| </Border> |
| </TablePane.Row> |
| </TablePane> |
| </Window> |
| ]]> |
| </source> |
| |
| <p> |
| Since this example contains no logic, there is no associated Java source. |
| </p> |
| </body> |
| </document> |