com.sibvisions.rad.ui.web.impl
Class WebFont

java.lang.Object
  extended by com.sibvisions.rad.ui.web.impl.WebResource
      extended by com.sibvisions.rad.ui.web.impl.WebFont
All Implemented Interfaces:
IFont, IResource

public class WebFont
extends WebResource
implements IFont

Web server implementation of Font.


Field Summary
 
Fields inherited from interface javax.rad.ui.IFont
BOLD, DIALOG, DIALOG_INPUT, ITALIC, MONOSPACED, PLAIN, SANS_SERIF, SERIF
 
Constructor Summary
WebFont(String pName, int pStyle, int pSize)
          Creates a new instance of WebFont from the specified name, style and point size.
 
Method Summary
 String getAsString()
          Gets this Object as String.
 String getFamily()
          Returns the family name of this IFont.
 String getFontName()
          Returns the font face name of this IFont.
 String getName()
          Returns the logical name of this IFont.
 int getSize()
          Returns the point size of this IFont, rounded to an integer.
 int getStyle()
          Returns the style of this IFont.
 void setAsString(String pValue)
          Sets this Object as String.
 
Methods inherited from class com.sibvisions.rad.ui.web.impl.WebResource
getNullableAsString, getResource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

WebFont

public WebFont(String pName,
               int pStyle,
               int pSize)
Creates a new instance of WebFont from the specified name, style and point size.

Parameters:
pName - the font name.
pStyle - the style constant for the WebFont
pSize - the point size of the WebFont
Method Detail

getAsString

public String getAsString()
Gets this Object as String.

Specified by:
getAsString in class WebResource
Returns:
the String.

getName

public String getName()
Returns the logical name of this IFont. Use getFamily to get the family name of the font. Use getFontName to get the font face name of the font.

Specified by:
getName in interface IFont
Returns:
a String representing the logical name of this IFont.
See Also:
IFont.getFamily(), IFont.getFontName()

getFamily

public String getFamily()
Returns the family name of this IFont.

The family name of a font is font specific. Two fonts such as Helvetica Italic and Helvetica Bold have the same family name, Helvetica, whereas their font face names are Helvetica Bold and Helvetica Italic. The list of available family names may be obtained by using the GraphicsEnvironment.getAvailableFontFamilyNames() method.

Use getName to get the logical name of the font. Use getFontName to get the font face name of the font.

Specified by:
getFamily in interface IFont
Returns:
a String that is the family name of this IFont.
See Also:
IFont.getName(), IFont.getFontName()

getFontName

public String getFontName()
Returns the font face name of this IFont. For example, Helvetica Bold could be returned as a font face name. Use getFamily to get the family name of the font. Use getName to get the logical name of the font.

Specified by:
getFontName in interface IFont
Returns:
a String representing the font face name of this IFont.
See Also:
IFont.getFamily(), IFont.getName()

getStyle

public int getStyle()
Returns the style of this IFont. The style can be PLAIN, BOLD, ITALIC, or BOLD+ITALIC.

Specified by:
getStyle in interface IFont
Returns:
the style of this IFont

getSize

public int getSize()
Returns the point size of this IFont, rounded to an integer. Most users are familiar with the idea of using point size to specify the size of glyphs in a font. This point size defines a measurement between the baseline of one line to the baseline of the following line in a single spaced text document. The point size is based on typographic points, approximately 1/72 of an inch.

The Java(tm)2D API adopts the convention that one point is equivalent to one unit in user coordinates. When using a normalized transform for converting user space coordinates to device space coordinates 72 user space units equal 1 inch in device space. In this case one point is 1/72 of an inch.

Specified by:
getSize in interface IFont
Returns:
the point size of this IFont in 1/72 of an inch units.

setAsString

public void setAsString(String pValue)
Sets this Object as String.

Overrides:
setAsString in class WebResource
Parameters:
pValue - the String.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.