1. /*
  2. * @(#)MotifPopupMenuSeparatorUI.java 1.8 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.motif;
  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 Motif L&F implementation of PopupMenuSeparatorUI. This implementation
  20. * is a "combined" view/controller.
  21. *
  22. * @version 1.8 02/02/00
  23. * @author Jeff Shapiro
  24. */
  25. public class MotifPopupMenuSeparatorUI extends MotifSeparatorUI
  26. {
  27. public static ComponentUI createUI( JComponent c )
  28. {
  29. return new MotifPopupMenuSeparatorUI();
  30. }
  31. public void paint( Graphics g, JComponent c )
  32. {
  33. Dimension s = c.getSize();
  34. g.setColor( c.getForeground() );
  35. g.drawLine( 0, 0, s.width, 0 );
  36. g.setColor( c.getBackground() );
  37. g.drawLine( 0, 1, s.width, 1 );
  38. }
  39. public Dimension getPreferredSize( JComponent c )
  40. {
  41. return new Dimension( 0, 2 );
  42. }
  43. }