- java.lang.Object
-
- org.jfree.chart.text.G2TextMeasurer
-
- All Implemented Interfaces:
TextMeasurer
public class G2TextMeasurer extends Object implements TextMeasurer
ATextMeasurerbased on aGraphics2D.
-
-
Constructor Summary
Constructors Constructor Description G2TextMeasurer(Graphics2D g2)Creates a new text measurer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetStringWidth(String text, int start, int end)Returns the string width.
-
-
-
Constructor Detail
-
G2TextMeasurer
public G2TextMeasurer(Graphics2D g2)
Creates a new text measurer.- Parameters:
g2- the graphics device.
-
-
Method Detail
-
getStringWidth
public float getStringWidth(String text, int start, int end)
Returns the string width.- Specified by:
getStringWidthin interfaceTextMeasurer- Parameters:
text- the text.start- the index of the first character to measure.end- the index of the last character to measure.- Returns:
- The string width.
-
-