1. /*
  2. * @(#)SynthFormattedTextFieldUI.java 1.5 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. package javax.swing.plaf.synth;
  8. import java.awt.*;
  9. import javax.swing.*;
  10. import javax.swing.plaf.ComponentUI;
  11. /**
  12. * Provides the look and feel implementation for
  13. * <code>JFormattedTextField</code>.
  14. *
  15. * @version 1.5, 12/19/03
  16. */
  17. class SynthFormattedTextFieldUI extends SynthTextFieldUI {
  18. /**
  19. * Creates a UI for a JFormattedTextField.
  20. *
  21. * @param c the formatted text field
  22. * @return the UI
  23. */
  24. public static ComponentUI createUI(JComponent c) {
  25. return new SynthFormattedTextFieldUI();
  26. }
  27. /**
  28. * Fetches the name used as a key to lookup properties through the
  29. * UIManager. This is used as a prefix to all the standard
  30. * text properties.
  31. *
  32. * @return the name "FormattedTextField"
  33. */
  34. protected String getPropertyPrefix() {
  35. return "FormattedTextField";
  36. }
  37. void paintBackground(SynthContext context, Graphics g, JComponent c) {
  38. context.getPainter().paintFormattedTextFieldBackground(context, g, 0,
  39. 0, c.getWidth(), c.getHeight());
  40. }
  41. public void paintBorder(SynthContext context, Graphics g, int x,
  42. int y, int w, int h) {
  43. context.getPainter().paintFormattedTextFieldBorder(context, g, x, y,
  44. w, h);
  45. }
  46. }