1 |
/* FontUIResource.java |
/* FontUIResource.java |
2 |
Copyright (C) 2002 Free Software Foundation, Inc. |
Copyright (C) 2003 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
37 |
|
|
38 |
|
|
39 |
package javax.swing.plaf; |
package javax.swing.plaf; |
40 |
|
|
41 |
import java.awt.Font; |
import java.awt.Font; |
42 |
|
|
43 |
|
|
44 |
/** |
/** |
45 |
* STUBBED |
* A font that is marked as <code>UIResource</code>, which |
46 |
|
* indicates that it has been installed by a pluggable |
47 |
|
* LookAndFeel. Such dimensions are replaced when the LookAndFeel |
48 |
|
* changes. |
49 |
|
* |
50 |
|
* @author Andrew Selkirk (aselkirk@sympatico.ca) |
51 |
|
* @author Sascha Brawer (brawer@dandelis.ch) |
52 |
*/ |
*/ |
53 |
public class FontUIResource extends Font implements UIResource |
public class FontUIResource |
54 |
|
extends Font |
55 |
|
implements UIResource |
56 |
{ |
{ |
57 |
public FontUIResource(Font f) |
/** |
58 |
{ |
* Constructs a new <code>FontUIResource</code> given |
59 |
super(f.getName(), f.getStyle(), f.getSize()); |
* the name, style and size of the font. |
60 |
} |
* |
61 |
|
* @param name the name of the font. A number of |
62 |
|
* “logical” names are supported by any Java |
63 |
|
* implementation. These are |
64 |
|
* <code>“Dialog”</code>, |
65 |
|
* <code>“DialogInput”</code>, |
66 |
|
* <code>“Monospaced”</code>, |
67 |
|
* <code>“Serif”</code>, and |
68 |
|
* <code>“SansSerif”</code>. |
69 |
|
* |
70 |
|
* @param style the style of the font, for instance {@link |
71 |
|
* java.awt.Font#BOLD} or {@link java.awt.Font#PLAIN}. |
72 |
|
* |
73 |
|
* @param size the size of the font in typographic points, for |
74 |
|
* instance 10, 12 or 13. Designers of LookAndFeels should be |
75 |
|
* aware that some languages (like Japanese and Chinese) have |
76 |
|
* glyphs that are too complex to be legible at small point |
77 |
|
* sizes. |
78 |
|
*/ |
79 |
public FontUIResource(String name, int style, int size) |
public FontUIResource(String name, int style, int size) |
80 |
{ |
{ |
81 |
super(name, style, size); |
super(name, style, size); |
82 |
} |
} |
83 |
} // class FontUIResource |
|
84 |
|
|
85 |
|
/** |
86 |
|
* Constructs a new <code>FontUIResource</code> given |
87 |
|
* an existing font. |
88 |
|
* |
89 |
|
* @param f the font that serves as a template. |
90 |
|
*/ |
91 |
|
public FontUIResource(Font f) |
92 |
|
{ |
93 |
|
/* This implementation will get rid of many font properties, |
94 |
|
* such as skewing, values of multiple master design axes, |
95 |
|
* etc., unless they get encoded into the name. It probably |
96 |
|
* is not a problem for LookAndFeels because user interfaces |
97 |
|
* are usually not very advanced with respect to typography. |
98 |
|
*/ |
99 |
|
super(f.getName(), f.getStyle(), f.getSize()); |
100 |
|
} |
101 |
|
} |