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