KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > java > swing > plaf > motif > MotifPopupMenuSeparatorUI


1 /*
2  * @(#)MotifPopupMenuSeparatorUI.java 1.11 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.java.swing.plaf.motif;
9
10 import javax.swing.*;
11 import java.awt.Color JavaDoc;
12 import java.awt.Dimension JavaDoc;
13 import java.awt.Graphics JavaDoc;
14 import java.awt.Insets JavaDoc;
15 import java.awt.Rectangle JavaDoc;
16 import javax.swing.plaf.*;
17
18 /**
19  * A Motif L&F implementation of PopupMenuSeparatorUI. This implementation
20  * is a "combined" view/controller.
21  *
22  * @version 1.11 12/19/03
23  * @author Jeff Shapiro
24  */

25
26 public class MotifPopupMenuSeparatorUI extends MotifSeparatorUI
27 {
28     public static ComponentUI createUI( JComponent c )
29     {
30         return new MotifPopupMenuSeparatorUI();
31     }
32
33     public void paint( Graphics JavaDoc g, JComponent c )
34     {
35         Dimension JavaDoc s = c.getSize();
36
37     g.setColor( c.getForeground() );
38     g.drawLine( 0, 0, s.width, 0 );
39
40     g.setColor( c.getBackground() );
41     g.drawLine( 0, 1, s.width, 1 );
42     }
43
44     public Dimension JavaDoc getPreferredSize( JComponent c )
45     {
46         return new Dimension JavaDoc( 0, 2 );
47     }
48
49 }
50
Popular Tags