01: /**
02: * L2FProd.com Common Components 7.3 License.
03: *
04: * Copyright 2005-2007 L2FProd.com
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */package com.l2fprod.common.swing.plaf.windows;
18:
19: import com.l2fprod.common.swing.JTaskPaneGroup;
20: import com.l2fprod.common.swing.plaf.basic.BasicTaskPaneGroupUI;
21:
22: import java.awt.Color;
23: import java.awt.Graphics;
24: import java.awt.Graphics2D;
25: import java.awt.RenderingHints;
26:
27: import javax.swing.JComponent;
28: import javax.swing.border.Border;
29: import javax.swing.plaf.ComponentUI;
30:
31: /**
32: * Windows Classic (NT/2000) implementation of the
33: * <code>JTaskPaneGroup</code> UI.
34: *
35: * @author <a href="mailto:fred@L2FProd.com">Frederic Lavigne</a>
36: */
37: public class WindowsClassicTaskPaneGroupUI extends BasicTaskPaneGroupUI {
38:
39: public static ComponentUI createUI(JComponent c) {
40: return new WindowsClassicTaskPaneGroupUI();
41: }
42:
43: protected void installDefaults() {
44: super .installDefaults();
45: group.setOpaque(false);
46: }
47:
48: protected Border createPaneBorder() {
49: return new ClassicPaneBorder();
50: }
51:
52: /**
53: * The border of the taskpane group paints the "text", the "icon", the
54: * "expanded" status and the "special" type.
55: *
56: */
57: class ClassicPaneBorder extends PaneBorder {
58:
59: protected void paintExpandedControls(JTaskPaneGroup group,
60: Graphics g, int x, int y, int width, int height) {
61: ((Graphics2D) g).setRenderingHint(
62: RenderingHints.KEY_ANTIALIASING,
63: RenderingHints.VALUE_ANTIALIAS_ON);
64:
65: paintRectAroundControls(group, g, x, y, width, height,
66: Color.white, Color.gray);
67: g.setColor(getPaintColor(group));
68: paintChevronControls(group, g, x, y, width, height);
69:
70: ((Graphics2D) g).setRenderingHint(
71: RenderingHints.KEY_ANTIALIASING,
72: RenderingHints.VALUE_ANTIALIAS_OFF);
73: }
74: }
75:
76: }
|