Package org.jfree.chart.text
Class G2TextMeasurer
- java.lang.Object
-
- org.jfree.chart.text.G2TextMeasurer
-
- All Implemented Interfaces:
TextMeasurer
public class G2TextMeasurer extends java.lang.Object implements TextMeasurer
ATextMeasurer
based on aGraphics2D
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Graphics2D
g2
The graphics device.
-
Constructor Summary
Constructors Constructor Description G2TextMeasurer(java.awt.Graphics2D g2)
Creates a new text measurer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getStringWidth(java.lang.String text, int start, int end)
Returns the string width.
-
-
-
Method Detail
-
getStringWidth
public float getStringWidth(java.lang.String text, int start, int end)
Returns the string width.- Specified by:
getStringWidth
in 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.
-
-