<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation. Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the LICENSE file that accompanied this code.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
-->
</head>
<body bgcolor="white">
<p>
Synth is a skinnable look and feel in which all painting is
delegated. Synth does not provide a default look. In
order to use Synth you need to specify a
provide a {@link
configuration options require an
understanding of the synth architecture, which is described
below, as well as an understanding of Swing's architecture.
</p>
<p>
Unless otherwise specified null is not a legal value to any of
the methods defined in the synth package and if passed in will
result in a <code>NullPointerException</code>.
<h2>Synth</h2>
<p>
itself with one {@link
<code>Components</code> only have one <code>Region</code> and
therefor only one <code>SynthStyle</code>.
<code>SynthStyle</code>
is used to access all style related properties: fonts, colors
and other <code>Component</code> properties. In addition
<code>SynthStyle</code>s are used to obtain
focus and other portions of a <code>Component</code>. The <code>ComponentUI</code>s obtain
<code>SynthStyle</code>s from a
A <code>SynthStyleFactory</code>
can be provided directly by way of
{@link javax.swing.plaf.synth.SynthLookAndFeel#setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory)},
or indirectly by way of
method to configure a <code>SynthLookAndFeel</code> and sets it
as the current look and feel:
</p>
<div class="example">
<pre>
SynthLookAndFeel laf = new SynthLookAndFeel();
UIManager.setLookAndFeel(laf);
</pre>
</div>
<p>
Many <code>JComponent</code>s are broken down into smaller
pieces and identified by the type safe enumeration in
consists of a <code>Region</code> for the
<code>JTabbedPane</code> ({@link
area ({@link
area behind the tabs ({@link
tabs ({@link
<code>Region</code> of each
<code>JComponent</code> will have a
<code>SynthStyle</code>. This allows
you to customize individual pieces of each region of each
<code>JComponent</code>.
<p>
is used to provide information about the current
<code>Component</code> and includes: the
as a bitmask (refer to {@link
the <code>Component</code> being painted.
<p>
All text rendering by non-<code>JTextComponent</code>s is
delegated to a {@link
customize text rendering
</p>
<h2>Notes on specific components</h2>
<h3>JTree</h3>
<p>
Synth provides a region for the cells of a tree:
renderer you'll want to provide a style for the
<code>TREE_CELL</code> region. The following illustrates this:
<pre>
<style id="treeCellStyle">
<opaque value="TRUE"/>
<state>
<color value="WHITE" type="TEXT_FOREGROUND"/>
<color value="RED" type="TEXT_BACKGROUND"/>
</state>
<state value="SELECTED">
<color value="RED" type="TEXT_FOREGROUND"/>
<color value="WHITE" type="BACKGROUND"/>
</state>
</style>
<bind style="treeCellStyle" type="region" key="TreeCell"/>
</pre>
<p>
This specifies a color combination of red on white, when
selected, and white on red when not selected. To see the
background you need to specify that labels are not opaque. The
following XML fragment does that:
<pre>
<style id="labelStyle">
<opaque value="FALSE"/>
</style>
<bind style="labelStyle" type="region" key="Label"/>
</pre>
<h3>JList and JTable</h3>
<p>
The colors that the renderers for JList and JTable use are
specified by way of the list and table Regions. The following
XML fragment illustrates how to specify red on white, when
selected, and white on red when not selected:
<pre>
<style id="style">
<opaque value="TRUE"/>
<state>
<color value="WHITE" type="TEXT_FOREGROUND"/>
<color value="RED" type="TEXT_BACKGROUND"/>
<color value="RED" type="BACKGROUND"/>
</state>
<state value="SELECTED">
<color value="RED" type="TEXT_FOREGROUND"/>
<color value="WHITE" type="TEXT_BACKGROUND"/>
</state>
</style>
<bind style="style" type="region" key="Table"/>
<bind style="style" type="region" key="List"/>
</pre>
</body>
</html>