java.awt
Class Font.FontLineMetrics

java.lang.Object
  extended byjava.awt.font.LineMetrics
      extended byjava.awt.Font.FontLineMetrics
Enclosing class:
Font

private final class Font.FontLineMetrics
extends LineMetrics

Metrics from a font for layout of characters along a line and layout of set of lines.


Field Summary
(package private)  float ascent
           
(package private)  int baselineIndex
           
(package private)  float[] baselineOffsets
           
(package private)  float descent
           
(package private)  float height
           
(package private)  float leading
           
(package private)  int numchars
           
(package private)  float strikethroughOffset
           
(package private)  float strikethroughThickness
           
(package private)  float underlineOffset
           
(package private)  float underlineThickness
           
 
Constructor Summary
private Font.FontLineMetrics()
           
 
Method Summary
 boolean equals(Object rhs)
          Indicates whether some other object is "equal to" this one.
 float getAscent()
          Returns the ascent of the text.
 int getBaselineIndex()
          Returns the baseline index of the text.
 float[] getBaselineOffsets()
          Returns the baseline offsets of the text, relative to the baseline of the text.
 float getDescent()
          Returns the descent of the text.
 float getHeight()
          Returns the height of the text.
 float getLeading()
          Returns the leading of the text.
 int getNumChars()
          Returns the number of characters in the text whose metrics are encapsulated by this LineMetrics object.
 float getStrikethroughOffset()
          Returns the position of the strike-through line relative to the baseline.
 float getStrikethroughThickness()
          Returns the thickness of the strike-through line.
 float getUnderlineOffset()
          Returns the position of the underline relative to the baseline.
 float getUnderlineThickness()
          Returns the thickness of the underline.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numchars

int numchars

ascent

float ascent

descent

float descent

leading

float leading

height

float height

baselineIndex

int baselineIndex

baselineOffsets

float[] baselineOffsets

strikethroughOffset

float strikethroughOffset

strikethroughThickness

float strikethroughThickness

underlineOffset

float underlineOffset

underlineThickness

float underlineThickness
Constructor Detail

Font.FontLineMetrics

private Font.FontLineMetrics()
Method Detail

getNumChars

public final int getNumChars()
Description copied from class: LineMetrics
Returns the number of characters in the text whose metrics are encapsulated by this LineMetrics object.

Specified by:
getNumChars in class LineMetrics
Returns:
the number of characters in the text with which this LineMetrics was created.

getAscent

public final float getAscent()
Description copied from class: LineMetrics
Returns the ascent of the text. The ascent is the distance from the baseline to the ascender line. The ascent usually represents the the height of the capital letters of the text. Some characters can extend above the ascender line.

Specified by:
getAscent in class LineMetrics
Returns:
the ascent of the text.

getDescent

public final float getDescent()
Description copied from class: LineMetrics
Returns the descent of the text. The descent is the distance from the baseline to the descender line. The descent usually represents the distance to the bottom of lower case letters like 'p'. Some characters can extend below the descender line.

Specified by:
getDescent in class LineMetrics
Returns:
the descent of the text.

getLeading

public final float getLeading()
Description copied from class: LineMetrics
Returns the leading of the text. The leading is the recommended distance from the bottom of the descender line to the top of the next line.

Specified by:
getLeading in class LineMetrics
Returns:
the leading of the text.

getHeight

public final float getHeight()
Description copied from class: LineMetrics
Returns the height of the text. The height is equal to the sum of the ascent, the descent and the leading.

Specified by:
getHeight in class LineMetrics
Returns:
the height of the text.

getBaselineIndex

public final int getBaselineIndex()
Description copied from class: LineMetrics
Returns the baseline index of the text. The index is one of ROMAN_BASELINE, CENTER_BASELINE, HANGING_BASELINE.

Specified by:
getBaselineIndex in class LineMetrics
Returns:
the baseline of the text.

getBaselineOffsets

public final float[] getBaselineOffsets()
Description copied from class: LineMetrics
Returns the baseline offsets of the text, relative to the baseline of the text. The offsets are indexed by baseline index. For example, if the baseline index is CENTER_BASELINE then offsets[HANGING_BASELINE] is usually negative, offsets[CENTER_BASELINE] is zero, and offsets[ROMAN_BASELINE] is usually positive.

Specified by:
getBaselineOffsets in class LineMetrics
Returns:
the baseline offsets of the text.

getStrikethroughOffset

public final float getStrikethroughOffset()
Description copied from class: LineMetrics
Returns the position of the strike-through line relative to the baseline.

Specified by:
getStrikethroughOffset in class LineMetrics
Returns:
the position of the strike-through line.

getStrikethroughThickness

public final float getStrikethroughThickness()
Description copied from class: LineMetrics
Returns the thickness of the strike-through line.

Specified by:
getStrikethroughThickness in class LineMetrics
Returns:
the thickness of the strike-through line.

getUnderlineOffset

public final float getUnderlineOffset()
Description copied from class: LineMetrics
Returns the position of the underline relative to the baseline.

Specified by:
getUnderlineOffset in class LineMetrics
Returns:
the position of the underline.

getUnderlineThickness

public final float getUnderlineThickness()
Description copied from class: LineMetrics
Returns the thickness of the underline.

Specified by:
getUnderlineThickness in class LineMetrics
Returns:
the thickness of the underline.

equals

public final boolean equals(Object rhs)
Description copied from class: Object
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Overrides:
equals in class Object
Parameters:
rhs - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode(), Hashtable