org.jfree.report.layout
Class DefaultSizeCalculator
java.lang.Object
|
+--org.jfree.report.layout.DefaultSizeCalculator
- public class DefaultSizeCalculator
- extends java.lang.Object
- implements SizeCalculator
An AWT-Based default implementation of an SizeCalculator. This implementation tries to
detect the currently used FontRendererContext; some JDKs are unable to return
reasonable sizes for the given text.
- Author:
- Thomas Morgner
- See Also:
DefaultSizeCalculator
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
DefaultSizeCalculator
public DefaultSizeCalculator(FontDefinition font,
boolean maxLineHeightUsed)
- Creates a new size calculator.
- Parameters:
font - the font.
getFrcDetector
public static DefaultSizeCalculator.BuggyFontRendererDetector getFrcDetector()
- Returns a singleon instance of the FontRenderContext bug detector.
- Returns:
- the FontRenderContext-detector
getDefaultSizeCalculator
public static DefaultSizeCalculator getDefaultSizeCalculator(FontDefinition font,
boolean maxLineHeightUsed)
- Returns an instance.
- Parameters:
font - The font definition.- Returns:
- A default size calculator.
getLineHeight
public float getLineHeight()
- Returns the height of the current font. The font height specifies the distance
between 2 base lines.
- Specified by:
- getLineHeight in interface SizeCalculator
- Returns:
- the font height.
getStringWidth
public float getStringWidth(java.lang.String text,
int lineStartPos,
int endPos)
- Calculates the width of the specified String in the current Graphics context.
- Specified by:
- getStringWidth in interface SizeCalculator
- Parameters:
text - the text to be weighted.lineStartPos - the start position of the substring to be weighted.endPos - the position of the last characterto be included in the
weightening process.- Returns:
- the width of the given string in 1/72" dpi.
toString
public java.lang.String toString()
- Converts this object to a string.
- Overrides:
- toString in class java.lang.Object
- Returns:
- a string.