01: /*
02: * $Id: WindowsClassicTaskPaneUI.java,v 1.4 2005/10/10 18:02:26 rbair Exp $
03: *
04: * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
05: * Santa Clara, California 95054, U.S.A. All rights reserved.
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this library; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20: */
21: package org.jdesktop.swingx.plaf.windows;
22:
23: import java.awt.Color;
24: import java.awt.Graphics;
25: import java.awt.Graphics2D;
26: import java.awt.RenderingHints;
27:
28: import javax.swing.JComponent;
29: import javax.swing.border.Border;
30: import javax.swing.plaf.ComponentUI;
31:
32: import org.jdesktop.swingx.JXTaskPane;
33: import org.jdesktop.swingx.plaf.basic.BasicTaskPaneUI;
34:
35: /**
36: * Windows Classic (NT/2000) implementation of the
37: * <code>JXTaskPane</code> UI.
38: *
39: * @author <a href="mailto:fred@L2FProd.com">Frederic Lavigne</a>
40: */
41: public class WindowsClassicTaskPaneUI extends BasicTaskPaneUI {
42:
43: public static ComponentUI createUI(JComponent c) {
44: return new WindowsClassicTaskPaneUI();
45: }
46:
47: protected void installDefaults() {
48: super .installDefaults();
49: group.setOpaque(false);
50: }
51:
52: protected Border createPaneBorder() {
53: return new ClassicPaneBorder();
54: }
55:
56: /**
57: * The border of the taskpane group paints the "text", the "icon", the
58: * "expanded" status and the "special" type.
59: *
60: */
61: class ClassicPaneBorder extends PaneBorder {
62:
63: protected void paintExpandedControls(JXTaskPane group,
64: Graphics g, int x, int y, int width, int height) {
65: ((Graphics2D) g).setRenderingHint(
66: RenderingHints.KEY_ANTIALIASING,
67: RenderingHints.VALUE_ANTIALIAS_ON);
68:
69: paintRectAroundControls(group, g, x, y, width, height,
70: Color.white, Color.gray);
71: g.setColor(getPaintColor(group));
72: paintChevronControls(group, g, x, y, width, height);
73:
74: ((Graphics2D) g).setRenderingHint(
75: RenderingHints.KEY_ANTIALIASING,
76: RenderingHints.VALUE_ANTIALIAS_OFF);
77: }
78: }
79:
80: }
|