~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to core/swing/plaf/api/doc/overview.html

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--
 
2
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
3
 
 
4
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
 
5
 
 
6
 
 
7
The contents of this file are subject to the terms of either the GNU
 
8
General Public License Version 2 only ("GPL") or the Common
 
9
Development and Distribution License("CDDL") (collectively, the
 
10
"License"). You may not use this file except in compliance with the
 
11
License. You can obtain a copy of the License at
 
12
http://www.netbeans.org/cddl-gplv2.html
 
13
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
 
14
specific language governing permissions and limitations under the
 
15
License.  When distributing the software, include this License Header
 
16
Notice in each file and include the License file at
 
17
nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
 
18
particular file as subject to the "Classpath" exception as provided
 
19
by Sun in the GPL Version 2 section of the License file that
 
20
accompanied this code. If applicable, add the following below the
 
21
License Header, with the fields enclosed by brackets [] replaced by
 
22
your own identifying information:
 
23
"Portions Copyrighted [year] [name of copyright owner]"
 
24
 
 
25
Contributor(s):
 
26
 
 
27
The Original Software is NetBeans. The Initial Developer of the Original
 
28
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
 
29
Microsystems, Inc. All Rights Reserved.
 
30
 
 
31
If you wish your version of this file to be governed by only the CDDL
 
32
or only the GPL Version 2, indicate your decision by adding
 
33
"[Contributor] elects to include this software in this distribution
 
34
under the [CDDL or GPL Version 2] license." If you do not indicate a
 
35
single choice of license, a recipient has the option to distribute
 
36
your version of this file under either the CDDL, the GPL Version 2 or
 
37
to extend the choice of license to its licensees as provided above.
 
38
However, if you add GPL Version 2 code and therefore, elected the GPL
 
39
Version 2 license, then the option applies only if the new code is
 
40
made subject to such option by the copyright holder.
 
41
-->
 
42
<html><head><title>The NetBeans look and feel customization library</title></head><body>
 
43
 
 
44
This library installs custom values into UIDefaults, such as colors, borders and UI class names, which
 
45
various components in NetBeans use to provide a customized or native appearance.
 
46
<p>
 
47
NetBeans provides a number of custom components, such as the tabbed containers in its main window;
 
48
other components may look for custom colors - for example, the property sheet will look for a custom color
 
49
in UIDefaults to use for its margin and the background color of property set entries, in order that it may
 
50
be customized to match the UI specification for different platforms/look and feels.
 
51
<p>
 
52
This library centralizes the installation and setup of such custom values.  It also:
 
53
<ul>
 
54
<li>Handles the setup of custom font sizes for look and feels (other than GTK, which 
 
55
gets its font sizes from the operating system theme), by replacing the font entries in UIDefaults with those
 
56
of the requested font size</li>
 
57
<li>Allows UIDefaults values to be guaranteed to be present for look and feels (GTK) which do not
 
58
provide them, to enable older code that depends on such values being there (as they were for all look
 
59
and feels until JDK 1.4) to work without modification</li>
 
60
<li>Handles loading of a theme file for those look and feels (Metal) that support MetalTheme</li>
 
61
<li>Installs per-look-and-feel customizations needed to ensure a harmonious, native appearance on a
 
62
      given look and feel</li>
 
63
<li>Contains custom implementations of things like ToolbarUI for some platforms on which 
 
64
      NetBeans does not use the standard JDK implementation (GTK and Aqua).</li>
 
65
</ul>
 
66
 
 
67
<h4>Usage</h4>
 
68
An application using NetBeans tab control, window system, property sheet or some other component
 
69
of NetBeans, which wants to guarantee that the same colors and styles are used in their application as in
 
70
NetBeans, needs simply to call <code>org.netbeans.swing.plaf.Startup.run()</code> early in its startup
 
71
sequence, as <code>org.netbeans.core.Main</code> does.
 
72
<p>
 
73
A look and feel or application author who wishes to provide custom values for some thing can provide
 
74
an implementation of <code>org.netbeans.swing.plaf.LFCustoms</code>, and place it in UIManager under
 
75
a key which contains the unique ID of the look and feel.  See the documentation for LFCustoms for further
 
76
details of how to do this.
 
77
<p>
 
78
Another option is simply to provide values for the (quite self-explanatory) keys defined as static fields
 
79
of the LFCustoms class.  The advantage to providing an implementation of LFCustoms is simply that those
 
80
values would not be loaded unless requested; either approach is equivalent.
 
81
<p>
 
82
Also, if a look and feel is designed to be an improvement on an existing platform-specific look and 
 
83
feel (such as JGoodies for Windows or QuaQua for Apple), it may simply provide the appropriate existing
 
84
LFCustoms subclass name in UIDefaults, in accordance with the following:
 
85
<p>
 
86
<table>
 
87
<tr>
 
88
<th>Look and feel</th>
 
89
<th>UIManager key</th>
 
90
<th>Class name</th>
 
91
</tr>
 
92
 
 
93
 
 
94
<tr>
 
95
<td>Metal look and feel</td>
 
96
<td>Nb.MetalLFCustoms</td>
 
97
<td>org.netbeans.swing.plaf.metal.MetalLFCustoms</td>
 
98
</tr>
 
99
    
 
100
<tr>
 
101
<td>Windows classic look and feel</td>
 
102
<td>Nb.WindowsLFCustoms</td>
 
103
<td>org.netbeans.swing.plaf.winclassic.WindowsLFCustoms</td>
 
104
</tr>
 
105
    
 
106
<tr>
 
107
<td>Windows XP look and feel</td>
 
108
<td>Nb.WindowsXPLFCustoms</td>
 
109
<td>org.netbeans.swing.plaf.winxp.XPLFCustoms</td>
 
110
</tr>
 
111
 
 
112
<tr>
 
113
<td>Aqua look and feel (Mac)</td>
 
114
<td>Nb.AquaLFCustoms</td>
 
115
<td>org.netbeans.swing.plaf.aqua.AquaLFCustoms</td>
 
116
</tr>
 
117
 
 
118
<tr>
 
119
<td>GTK Look and Feel (Linux &amp; Solaris) - JDK 1.5 and up</td>    
 
120
<td>Nb.GTKLFCustoms</td>
 
121
<td>org.netbeans.swing.plaf.gtk.GtkLFCustoms</td>
 
122
</tr>
 
123
</table>
 
124
 
 
125
For details on the specific requirements and design of this library, see its
 
126
<a href="architecture-summary.html">arch questions and answers</a>.
 
127
 
 
128
</body>
 
129
</html>