1. /*
  2. * @(#)WindowsSplitPaneDivider.java 1.14 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.java.swing.plaf.windows;
  8. import java.awt.*;
  9. import javax.swing.JSplitPane;
  10. import javax.swing.UIManager;
  11. import javax.swing.plaf.basic.BasicSplitPaneUI;
  12. import javax.swing.plaf.basic.BasicSplitPaneDivider;
  13. /**
  14. * Divider used for Windows split pane.
  15. * <p>
  16. * <strong>Warning:</strong>
  17. * Serialized objects of this class will not be compatible with
  18. * future Swing releases. The current serialization support is appropriate
  19. * for short term storage or RMI between applications running the same
  20. * version of Swing. A future release of Swing will provide support for
  21. * long term persistence.
  22. *
  23. * @version 1.2 10/25/97
  24. * @author Jeff Dinkins
  25. */
  26. public class WindowsSplitPaneDivider extends BasicSplitPaneDivider
  27. {
  28. /**
  29. * Creates a new Windows SplitPaneDivider
  30. */
  31. public WindowsSplitPaneDivider(BasicSplitPaneUI ui) {
  32. super(ui);
  33. }
  34. /**
  35. * Paints the divider.
  36. */
  37. public void paint(Graphics g) {
  38. Color bgColor = (splitPane.hasFocus()) ?
  39. UIManager.getColor("SplitPane.shadow") :
  40. getBackground();
  41. Dimension size = getSize();
  42. if(bgColor != null) {
  43. g.setColor(bgColor);
  44. g.fillRect(0, 0, size.width, size.height);
  45. }
  46. super.paint(g);
  47. }
  48. }