站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

FontMetricsCache (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor
Class FontMetricsCache

java.lang.Object
  extended by org.netbeans.editor.FontMetricsCache

public class FontMetricsCache
extends Object

Static cache that holds the font metrics for the fonts. This can generally speed up drawing if the metrics are not cached directly by the system.


Nested Class Summary
static interface FontMetricsCache.Info
           
 
Constructor Summary
FontMetricsCache()
           
 
Method Summary
static void clear()
          Clear all the metrics from the cache.
static FontMetrics getFontMetrics(Font f, Component c)
          Get the font-metrics for the given font.
static FontMetrics getFontMetrics(Font f, Graphics g)
          Get the font-metrics for the given font.
static FontMetricsCache.Info getInfo(Font f)
          Get the info about the space-width and strike-through and underline constants.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontMetricsCache

public FontMetricsCache()
Method Detail

getFontMetrics

public static FontMetrics getFontMetrics(Font f,
                                         Component c)
Get the font-metrics for the given font.

Parameters:
font - font for which the metrics is being retrieved.
c - component that is used to retrieve the metrics in case it's not yet in the cache.

getFontMetrics

public static FontMetrics getFontMetrics(Font f,
                                         Graphics g)
Get the font-metrics for the given font.

Parameters:
font - font for which the metrics is being retrieved.
g - graphics that is used to retrieve the metrics in case it's not yet in the cache.

getInfo

public static FontMetricsCache.Info getInfo(Font f)
Get the info about the space-width and strike-through and underline constants.

Parameters:
font - font for which the info is being retrieved.

clear

public static void clear()
Clear all the metrics from the cache. It's usually done when any of the editor ui is being garbage collected to ensure there will be no more unused metrics.


org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.