yu.ac.bg.etf.javaqx.qswing.graphics
Class FontMetrics

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.qswing.graphics.FontMetrics
All Implemented Interfaces:
Disposable

public class FontMetrics
extends java.lang.Object
implements Disposable

Font Metrics.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Constructor Summary
FontMetrics(Font font)
          Constructs new FontMetrics for the specified font.
 
Method Summary
 void dispose()
          Disposes the object.
protected  void finalize()
          
 int getAscent()
          Returns font ascent.
 int getDescent()
          Returns font descent.
 Font getFont()
          Returns font.
 int getHeight()
          Returns font height.
 int getLeading()
          Returns font leading.
 boolean isDisposed()
          Returns true if the object is disposed.
 int stringWidth(java.lang.String str)
          Returns width of the specified string.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontMetrics

public FontMetrics(Font font)
Constructs new FontMetrics for the specified font.

Parameters:
font - the specified font
Throws:
java.lang.IllegalArgumentException - if the font is null
java.lang.RuntimeException - if native font metrics creation failed
Method Detail

getFont

public Font getFont()
Returns font.

Returns:
font

stringWidth

public int stringWidth(java.lang.String str)
Returns width of the specified string.

Parameters:
str - the string
Returns:
width of the specified string

getAscent

public int getAscent()
Returns font ascent.

Returns:
font ascent

getDescent

public int getDescent()
Returns font descent.

Returns:
font descent

getHeight

public int getHeight()
Returns font height.

Returns:
font height

getLeading

public int getLeading()
Returns font leading.

Returns:
font leading

isDisposed

public final boolean isDisposed()
Returns true if the object is disposed.

Specified by:
isDisposed in interface Disposable
Returns:
true if the object is disposed

dispose

public final void dispose()
Disposes the object.

Specified by:
dispose in interface Disposable

finalize

protected final void finalize()



Copyright © 2007 ETF and contributors. All Rights Reserved.