author | alexsch |
Wed, 25 Sep 2013 17:08:31 +0400 | |
changeset 20168 | 137788883a22 |
parent 5506 | 202f599c92aa |
child 23010 | 6dadb192ad81 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
5506 | 2 |
* Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
package javax.swing.plaf.synth; |
|
26 |
||
4394 | 27 |
import java.awt.Graphics; |
28 |
import javax.swing.JComponent; |
|
2 | 29 |
import javax.swing.plaf.ComponentUI; |
30 |
||
31 |
/** |
|
20168
137788883a22
8025070: [javadoc] fix some javadoc errors in javax/swing/plaf/synth
alexsch
parents:
5506
diff
changeset
|
32 |
* Provides the Synth L&F UI delegate for |
4394 | 33 |
* {@link javax.swing.JFormattedTextField}. |
2 | 34 |
* |
4394 | 35 |
* @since 1.7 |
2 | 36 |
*/ |
4394 | 37 |
public class SynthFormattedTextFieldUI extends SynthTextFieldUI { |
2 | 38 |
/** |
39 |
* Creates a UI for a JFormattedTextField. |
|
40 |
* |
|
41 |
* @param c the formatted text field |
|
42 |
* @return the UI |
|
43 |
*/ |
|
44 |
public static ComponentUI createUI(JComponent c) { |
|
45 |
return new SynthFormattedTextFieldUI(); |
|
46 |
} |
|
47 |
||
48 |
/** |
|
49 |
* Fetches the name used as a key to lookup properties through the |
|
50 |
* UIManager. This is used as a prefix to all the standard |
|
51 |
* text properties. |
|
52 |
* |
|
53 |
* @return the name "FormattedTextField" |
|
54 |
*/ |
|
4394 | 55 |
@Override |
2 | 56 |
protected String getPropertyPrefix() { |
57 |
return "FormattedTextField"; |
|
58 |
} |
|
59 |
||
4394 | 60 |
/** |
20168
137788883a22
8025070: [javadoc] fix some javadoc errors in javax/swing/plaf/synth
alexsch
parents:
5506
diff
changeset
|
61 |
* {@inheritDoc} |
4394 | 62 |
*/ |
63 |
@Override |
|
2 | 64 |
void paintBackground(SynthContext context, Graphics g, JComponent c) { |
65 |
context.getPainter().paintFormattedTextFieldBackground(context, g, 0, |
|
66 |
0, c.getWidth(), c.getHeight()); |
|
67 |
} |
|
68 |
||
4394 | 69 |
/** |
20168
137788883a22
8025070: [javadoc] fix some javadoc errors in javax/swing/plaf/synth
alexsch
parents:
5506
diff
changeset
|
70 |
* {@inheritDoc} |
4394 | 71 |
*/ |
72 |
@Override |
|
2 | 73 |
public void paintBorder(SynthContext context, Graphics g, int x, |
74 |
int y, int w, int h) { |
|
75 |
context.getPainter().paintFormattedTextFieldBorder(context, g, x, y, |
|
76 |
w, h); |
|
77 |
} |
|
78 |
} |