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