KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > plaf > synth > SynthFormattedTextFieldUI


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
9 import java.awt.*;
10 import javax.swing.*;
11 import javax.swing.plaf.ComponentUI JavaDoc;
12
13 /**
14  * Provides the look and feel implementation for
15  * <code>JFormattedTextField</code>.
16  *
17  * @version 1.5, 12/19/03
18  */

19 class SynthFormattedTextFieldUI extends SynthTextFieldUI JavaDoc {
20     /**
21      * Creates a UI for a JFormattedTextField.
22      *
23      * @param c the formatted text field
24      * @return the UI
25      */

26     public static ComponentUI JavaDoc createUI(JComponent c) {
27         return new SynthFormattedTextFieldUI JavaDoc();
28     }
29
30     /**
31      * Fetches the name used as a key to lookup properties through the
32      * UIManager. This is used as a prefix to all the standard
33      * text properties.
34      *
35      * @return the name "FormattedTextField"
36      */

37     protected String JavaDoc getPropertyPrefix() {
38     return "FormattedTextField";
39     }
40
41     void paintBackground(SynthContext JavaDoc context, Graphics g, JComponent c) {
42         context.getPainter().paintFormattedTextFieldBackground(context, g, 0,
43                              0, c.getWidth(), c.getHeight());
44     }
45
46     public void paintBorder(SynthContext JavaDoc context, Graphics g, int x,
47                             int y, int w, int h) {
48         context.getPainter().paintFormattedTextFieldBorder(context, g, x, y,
49                                                            w, h);
50     }
51 }
52
Popular Tags