1. /*
  2. * @(#)BasicViewportUI.java 1.4 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 javax.swing.plaf.basic;
  8. import java.awt.*;
  9. import javax.swing.*;
  10. import javax.swing.border.*;
  11. import javax.swing.plaf.*;
  12. import java.awt.*;
  13. import java.awt.event.*;
  14. /**
  15. * BasicViewport implementation
  16. *
  17. * @version 1.1 05/01/98
  18. * @author Rich Schiavi
  19. */
  20. public class BasicViewportUI extends ViewportUI {
  21. // Shared UI object
  22. private static ViewportUI viewportUI;
  23. public static ComponentUI createUI(JComponent c) {
  24. if(viewportUI == null) {
  25. viewportUI = new BasicViewportUI();
  26. }
  27. return viewportUI;
  28. }
  29. public void installUI(JComponent c) {
  30. super.installUI(c);
  31. installDefaults(c);
  32. }
  33. public void uninstallUI(JComponent c) {
  34. super.uninstallUI(c);
  35. }
  36. protected void installDefaults(JComponent c) {
  37. LookAndFeel.installColorsAndFont(c,
  38. "Viewport.background",
  39. "Viewport.foreground",
  40. "Viewport.font");
  41. }
  42. protected void uninstallDefaults(JComponent c) {
  43. }
  44. }