KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > java > swing > plaf > windows > WindowsSplitPaneDivider


1 /*
2  * @(#)WindowsSplitPaneDivider.java 1.15 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.java.swing.plaf.windows;
9
10 import java.awt.*;
11 import javax.swing.JSplitPane JavaDoc;
12 import javax.swing.UIManager JavaDoc;
13 import javax.swing.plaf.basic.BasicSplitPaneUI JavaDoc;
14 import javax.swing.plaf.basic.BasicSplitPaneDivider JavaDoc;
15
16
17 /**
18  * Divider used for Windows split pane.
19  * <p>
20  * <strong>Warning:</strong>
21  * Serialized objects of this class will not be compatible with
22  * future Swing releases. The current serialization support is appropriate
23  * for short term storage or RMI between applications running the same
24  * version of Swing. A future release of Swing will provide support for
25  * long term persistence.
26  *
27  * @version 1.2 10/25/97
28  * @author Jeff Dinkins
29  */

30 public class WindowsSplitPaneDivider extends BasicSplitPaneDivider JavaDoc
31 {
32
33     /**
34      * Creates a new Windows SplitPaneDivider
35      */

36     public WindowsSplitPaneDivider(BasicSplitPaneUI JavaDoc ui) {
37         super(ui);
38     }
39
40     /**
41       * Paints the divider.
42       */

43     public void paint(Graphics g) {
44         Color bgColor = (splitPane.hasFocus()) ?
45                             UIManager.getColor("SplitPane.shadow") :
46                             getBackground();
47         Dimension size = getSize();
48
49         if(bgColor != null) {
50             g.setColor(bgColor);
51             g.fillRect(0, 0, size.width, size.height);
52         }
53         super.paint(g);
54     }
55 }
56
Popular Tags