1. /*
  2. * @(#)MotifPopupMenuSeparatorUI.java 1.7 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.java.swing.plaf.motif;
  8. import javax.swing.*;
  9. import java.awt.Color;
  10. import java.awt.Dimension;
  11. import java.awt.Graphics;
  12. import java.awt.Insets;
  13. import java.awt.Rectangle;
  14. import javax.swing.plaf.*;
  15. /**
  16. * A Motif L&F implementation of PopupMenuSeparatorUI. This implementation
  17. * is a "combined" view/controller.
  18. *
  19. * @version 1.7 11/29/01
  20. * @author Jeff Shapiro
  21. */
  22. public class MotifPopupMenuSeparatorUI extends MotifSeparatorUI
  23. {
  24. public static ComponentUI createUI( JComponent c )
  25. {
  26. return new MotifPopupMenuSeparatorUI();
  27. }
  28. public void paint( Graphics g, JComponent c )
  29. {
  30. Dimension s = c.getSize();
  31. g.setColor( c.getForeground() );
  32. g.drawLine( 0, 0, s.width, 0 );
  33. g.setColor( c.getBackground() );
  34. g.drawLine( 0, 1, s.width, 1 );
  35. }
  36. public Dimension getPreferredSize( JComponent c )
  37. {
  38. return new Dimension( 0, 2 );
  39. }
  40. }