KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > plaf > basic > BasicViewportUI


1 /*
2  * @(#)BasicViewportUI.java 1.9 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 javax.swing.plaf.basic;
9
10 import java.awt.*;
11 import javax.swing.*;
12 import javax.swing.border.*;
13 import javax.swing.plaf.*;
14 import java.awt.*;
15 import java.awt.event.*;
16
17
18 /**
19  * BasicViewport implementation
20  *
21  * @version 1.1 05/01/98
22  * @author Rich Schiavi
23  */

24 public class BasicViewportUI extends ViewportUI {
25
26     // Shared UI object
27
private static ViewportUI viewportUI;
28
29     public static ComponentUI createUI(JComponent c) {
30     if(viewportUI == null) {
31             viewportUI = new BasicViewportUI JavaDoc();
32     }
33         return viewportUI;
34     }
35
36     public void installUI(JComponent c) {
37         super.installUI(c);
38         installDefaults(c);
39     }
40
41     public void uninstallUI(JComponent c) {
42         super.uninstallUI(c);
43
44     }
45
46     protected void installDefaults(JComponent c) {
47         LookAndFeel.installColorsAndFont(c,
48                      "Viewport.background",
49                      "Viewport.foreground",
50                      "Viewport.font");
51         LookAndFeel.installProperty(c, "opaque", Boolean.TRUE);
52     }
53
54     protected void uninstallDefaults(JComponent c) {
55     }
56 }
57
Popular Tags