1. /*
  2. * @(#)MetalPopupMenuSeparatorUI.java 1.5 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 javax.swing.plaf.metal;
  11. import javax.swing.*;
  12. import java.awt.Color;
  13. import java.awt.Dimension;
  14. import java.awt.Graphics;
  15. import java.awt.Insets;
  16. import java.awt.Rectangle;
  17. import javax.swing.plaf.*;
  18. /**
  19. * A Metal L&F implementation of PopupMenuSeparatorUI. This implementation
  20. * is a "combined" view/controller.
  21. *
  22. * @version 1.5 02/02/00
  23. * @author Jeff Shapiro
  24. */
  25. public class MetalPopupMenuSeparatorUI extends MetalSeparatorUI
  26. {
  27. public static ComponentUI createUI( JComponent c )
  28. {
  29. return new MetalPopupMenuSeparatorUI();
  30. }
  31. public void paint( Graphics g, JComponent c )
  32. {
  33. Dimension s = c.getSize();
  34. g.setColor( c.getForeground() );
  35. g.drawLine( 0, 1, s.width, 1 );
  36. g.setColor( c.getBackground() );
  37. g.drawLine( 0, 2, s.width, 2 );
  38. g.drawLine( 0, 0, 0, 0 );
  39. g.drawLine( 0, 3, 0, 3 );
  40. }
  41. public Dimension getPreferredSize( JComponent c )
  42. {
  43. return new Dimension( 0, 4 );
  44. }
  45. }