|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.reporting.engine.classic.core.layout.DefaultSizeCalculator
public class DefaultSizeCalculator
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.
DefaultSizeCalculator
Nested Class Summary | |
---|---|
static class |
DefaultSizeCalculator.BuggyFontRendererDetector
A helper class that is able to detect whether the implementation is considered buggy. |
Field Summary |
---|
Fields inherited from interface org.pentaho.reporting.engine.classic.core.layout.SizeCalculator |
---|
CLIP_TEXT, USE_MAX_CHAR_SIZE |
Constructor Summary | |
---|---|
DefaultSizeCalculator(Font font,
boolean maxLineHeightUsed)
Creates a new size calculator. |
|
DefaultSizeCalculator(FontDefinition font,
boolean maxLineHeightUsed)
Deprecated. Do not use the FontDefinition, use the Font-constructor instead. |
Method Summary | |
---|---|
static DefaultSizeCalculator |
getDefaultSizeCalculator(FontDefinition font,
boolean maxLineHeightUsed)
Deprecated. Do not use the FontDefinition, use the Font-constructor instead and instantiate the size-calculator directly. |
static DefaultSizeCalculator.BuggyFontRendererDetector |
getFrcDetector()
Returns a singleon instance of the FontRenderContext bug detector. |
float |
getLineHeight()
Returns the height of the current font. |
float |
getStringWidth(String text,
int lineStartPos,
int endPos)
Calculates the width of the specified String in the current Graphics context. |
String |
toString()
Converts this object to a string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultSizeCalculator(FontDefinition font, boolean maxLineHeightUsed)
font
- the fontmaxLineHeightUsed
- a flag indicating whether the maximum bounding box is used.public DefaultSizeCalculator(Font font, boolean maxLineHeightUsed)
font
- the font.maxLineHeightUsed
- a flag indicating whether the maximum bounding box is used.Method Detail |
---|
public static DefaultSizeCalculator.BuggyFontRendererDetector getFrcDetector()
public static DefaultSizeCalculator getDefaultSizeCalculator(FontDefinition font, boolean maxLineHeightUsed)
font
- The font definition.maxLineHeightUsed
- a flag indicating whether the maximum bounding box is used.
public float getLineHeight()
getLineHeight
in interface SizeCalculator
public float getStringWidth(String text, int lineStartPos, int endPos)
getStringWidth
in interface SizeCalculator
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.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |