< prev index next >

src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuSeparatorUI.java

Print this page




  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.java.swing.plaf.motif;
  27 
  28 import javax.swing.*;
  29 import java.awt.Color;
  30 import java.awt.Dimension;
  31 import java.awt.Graphics;
  32 import java.awt.Insets;
  33 import java.awt.Rectangle;
  34 import javax.swing.plaf.*;
  35 
  36 /**
  37  * A Motif L&F implementation of PopupMenuSeparatorUI.  This implementation
  38  * is a "combined" view/controller.
  39  *
  40  * @author Jeff Shapiro
  41  */
  42 
  43 public class MotifPopupMenuSeparatorUI extends MotifSeparatorUI
  44 {
  45     public static ComponentUI createUI( JComponent c )
  46     {
  47         return new MotifPopupMenuSeparatorUI();
  48     }
  49 
  50     public void paint( Graphics g, JComponent c )
  51     {
  52         Dimension s = c.getSize();
  53 
  54         g.setColor( c.getForeground() );
  55         g.drawLine( 0, 0, s.width, 0 );
  56 
  57         g.setColor( c.getBackground() );
  58         g.drawLine( 0, 1, s.width, 1 );


  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.java.swing.plaf.motif;
  27 
  28 import javax.swing.*;
  29 import java.awt.Color;
  30 import java.awt.Dimension;
  31 import java.awt.Graphics;
  32 import java.awt.Insets;
  33 import java.awt.Rectangle;
  34 import javax.swing.plaf.*;
  35 
  36 /**
  37  * A Motif {@literal L&F} implementation of PopupMenuSeparatorUI.
  38  * This implementation is a "combined" view/controller.
  39  *
  40  * @author Jeff Shapiro
  41  */
  42 
  43 public class MotifPopupMenuSeparatorUI extends MotifSeparatorUI
  44 {
  45     public static ComponentUI createUI( JComponent c )
  46     {
  47         return new MotifPopupMenuSeparatorUI();
  48     }
  49 
  50     public void paint( Graphics g, JComponent c )
  51     {
  52         Dimension s = c.getSize();
  53 
  54         g.setColor( c.getForeground() );
  55         g.drawLine( 0, 0, s.width, 0 );
  56 
  57         g.setColor( c.getBackground() );
  58         g.drawLine( 0, 1, s.width, 1 );
< prev index next >