01: /*
02: * @(#)EclipseGripperUI.java
03: *
04: * Copyright 2002 - 2004 JIDE Software Inc. All rights reserved.
05: */
06: package com.jidesoft.plaf.eclipse;
07:
08: import com.jidesoft.plaf.UIDefaultsLookup;
09: import com.jidesoft.plaf.basic.BasicGripperUI;
10: import com.jidesoft.swing.Gripper;
11: import com.jidesoft.swing.JideSwingUtilities;
12:
13: import javax.swing.*;
14: import javax.swing.plaf.ComponentUI;
15: import java.awt.*;
16:
17: /**
18: */
19: public class EclipseGripperUI extends BasicGripperUI {
20:
21: protected Color _shadowColor;
22: protected Color _darkShadowColor;
23: protected Color _highlight;
24: protected Color _lightHighlightColor;
25:
26: public static ComponentUI createUI(JComponent c) {
27: return new EclipseGripperUI();
28: }
29:
30: @Override
31: protected void installDefaults(Gripper s) {
32: _shadowColor = UIDefaultsLookup.getColor("controlShadow");
33: _darkShadowColor = UIDefaultsLookup.getColor("controlDkShadow");
34: _highlight = UIDefaultsLookup.getColor("controlHighlight");
35: _lightHighlightColor = UIDefaultsLookup
36: .getColor("controlLtHighlight");
37: super .installDefaults(s);
38: }
39:
40: @Override
41: protected void uninstallDefaults(Gripper s) {
42: _shadowColor = null;
43: _highlight = null;
44: _lightHighlightColor = null;
45: _darkShadowColor = null;
46: super .uninstallDefaults(s);
47: }
48:
49: @Override
50: public void paint(Graphics g, JComponent c) {
51: if (_gripperPainter == null) {
52: getPainter().paintGripper(c, g,
53: new Rectangle(0, 0, c.getWidth(), c.getHeight()),
54: JideSwingUtilities.getOrientationOf(c), 0);
55: } else {
56: _gripperPainter.paint(c, g, new Rectangle(0, 0, c
57: .getWidth(), c.getHeight()), JideSwingUtilities
58: .getOrientationOf(c), 0);
59: }
60: }
61: }
|