Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.editor
Class FontHelper

java.lang.Object
  extended by oracle.javatools.editor.FontHelper


public final class FontHelper
extends java.lang.Object

The FontHelper class is used for caching all style variations of a single font, such as plain or bold, from a single family and font size.


Constructor Summary
FontHelper(java.lang.String fontFamily, int fontSize)
          Construct a new FontHelper using the specified base font family and font size.

 

Method Summary
 java.awt.Font getBaseFont()
          Fetches the current base font for the font helper.
 java.awt.Font getFont(int fontStyle)
          Fetches the font in the given style from the font helper.
 java.awt.FontMetrics getFontMetrics(java.awt.Font font, java.awt.Component component)
          Retrieves the font metrics for the given font.
 java.awt.FontMetrics getFontMetrics(int fontStyle, java.awt.Component component)
          Retrieves the font metrics for the given font style.
 java.awt.Font setBaseFont(java.lang.String fontFamily, int fontSize)
          Sets the new base font for the font helper based on the given family and font size.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

FontHelper

public FontHelper(java.lang.String fontFamily,
                  int fontSize)
Construct a new FontHelper using the specified base font family and font size.
Parameters:
fontFamily - the font family to use
fontSize - the font size to use

Method Detail

setBaseFont

public java.awt.Font setBaseFont(java.lang.String fontFamily,
                                 int fontSize)
Sets the new base font for the font helper based on the given family and font size.
Parameters:
fontFamily - the font family to use
fontSize - the font size to use
Returns:
the font instance corresponding to the specified font family and size for the PLAIN style.

getBaseFont

public java.awt.Font getBaseFont()
Fetches the current base font for the font helper.
Returns:
the current base font

getFont

public java.awt.Font getFont(int fontStyle)
Fetches the font in the given style from the font helper. The font is derived from the base style if necessary.
Parameters:
fontStyle - the font style to retrieve, such as Font.ITALIC
Returns:
the derived font in the given font style

getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font font,
                                           java.awt.Component component)
Retrieves the font metrics for the given font. The component is provided for convenience to retrieve the font metrics.
Parameters:
font - the font we are requesting metrics for
component - a UI component we can use for retrieving font metrics
Returns:
the font metrics for the given font

getFontMetrics

public java.awt.FontMetrics getFontMetrics(int fontStyle,
                                           java.awt.Component component)
Retrieves the font metrics for the given font style. The component is provided for convenience to retrieve the font metrics.
Parameters:
fontStyle - the font style to get the metrics for
component - a UI component we can use for retrieving font metrics
Returns:
the font metrics for the given font style

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.