Commit d6e4d86e by David Gilbert Committed by Michael Koch

Font.java (decode): Handle null argument and allow space as delimiter.

2005-04-19  vid Gilbert <david.gilbert@object-refinery.com>

	* java/awt/Font.java (decode): Handle null argument and allow
	space as delimiter.

From-SVN: r98373
parent 24809ca8
2005-04-19 vid Gilbert <david.gilbert@object-refinery.com>
* java/awt/Font.java (decode): Handle null argument and allow
space as delimiter.
2005-04-19 Robert Schuster <thebohemian@gmx.net> 2005-04-19 Robert Schuster <thebohemian@gmx.net>
* java/beans/EventHandler.java: Reworked documentation. * java/beans/EventHandler.java: Reworked documentation.
......
...@@ -209,14 +209,21 @@ private static final long serialVersionUID = -4206021311591459213L; ...@@ -209,14 +209,21 @@ private static final long serialVersionUID = -4206021311591459213L;
* The style should be one of BOLD, ITALIC, or BOLDITALIC. The default * The style should be one of BOLD, ITALIC, or BOLDITALIC. The default
* style if none is specified is PLAIN. The default size if none * style if none is specified is PLAIN. The default size if none
* is specified is 12. * is specified is 12.
*
* @param fontspec a string specifying the required font (<code>null</code>
* permitted, interpreted as 'Dialog-PLAIN-12').
*
* @return A font.
*/ */
public static Font decode (String fontspec) public static Font decode (String fontspec)
{ {
if (fontspec == null)
fontspec = "Dialog-PLAIN-12";
String name = null; String name = null;
int style = PLAIN; int style = PLAIN;
int size = 12; int size = 12;
StringTokenizer st = new StringTokenizer(fontspec, "-"); StringTokenizer st = new StringTokenizer(fontspec, "- ");
while (st.hasMoreTokens()) while (st.hasMoreTokens())
{ {
String token = st.nextToken(); String token = st.nextToken();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment