public class TextRenderer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TextRenderer.collectModeData |
Modifier and Type | Field and Description |
---|---|
static int |
collectModeState |
Constructor and Description |
---|
TextRenderer(RenderContext context,
java.awt.Font font,
com.mindfusion.drawing.Brush textBrush)
Initializes a new instance of the TextRenderer class.
|
TextRenderer(RenderContext context,
java.awt.Font font,
com.mindfusion.drawing.Brush textBrush,
com.mindfusion.drawing.Brush background,
com.mindfusion.drawing.Pen borderPen)
Initializes a new instance of the TextRenderer class.
|
Modifier and Type | Method and Description |
---|---|
void |
drawLabelAtPoint(Series series,
int index,
java.awt.geom.Point2D point,
LabelKinds labelKind)
Draws the specified label centered at specified location.
|
void |
drawLabelInRect(Series series,
int index,
java.awt.geom.Rectangle2D bounds,
LabelKinds labelKind)
Draws the specified label in specified layout rectangle.
|
void |
drawLeftFromPoint(Series series,
int index,
java.awt.geom.Point2D point,
LabelKinds labelKind)
Draws the specified label on the left side of specified point.
|
void |
drawRightFromPoint(Series series,
int index,
java.awt.geom.Point2D point,
LabelKinds labelKind)
Draws the specified label on the right side of specified point.
|
void |
drawRotatedLabelInRect(Series series,
int index,
java.awt.geom.Rectangle2D bounds,
LabelKinds labelKind)
Draws the specified label rotated at 90 degrees in specified layout rectangle.
|
void |
drawRotatedLabelInRect(java.lang.String text,
java.awt.geom.Rectangle2D bounds,
com.mindfusion.drawing.Brush textBrush,
com.mindfusion.drawing.Align alignment)
Draws a 90-degree rotated text in specified layout rectangle.
|
void |
drawRotatedLabelInRect(java.lang.String text,
java.awt.geom.Rectangle2D bounds,
com.mindfusion.drawing.Brush textBrush,
com.mindfusion.drawing.Align alignment,
com.mindfusion.drawing.Align lineAlignment) |
static void |
drawText(java.awt.Graphics2D graphics,
java.lang.String text,
java.awt.geom.Rectangle2D rect,
java.awt.Font font,
com.mindfusion.drawing.Align alignment,
com.mindfusion.drawing.Align verticalAlignment,
float maxWidth) |
static void |
enterCollectMode() |
static void |
exitCollectMode(RenderContext context) |
java.awt.Font |
getLabelFont()
Gets the Font used to draw labels.
|
com.mindfusion.drawing.Brush |
getTextBrush()
Gets the Brush used to draw labels.
|
static com.mindfusion.common.XDimension2D.Double |
measureText(java.lang.String text,
float maxWidth,
java.awt.Font font,
java.awt.Graphics2D graphics)
Calculates how much space is needed to display specified text.
|
static com.mindfusion.common.XDimension2D.Double |
measureText(java.lang.String text,
float maxWidth,
java.awt.Font font,
RenderContext context)
Calculates how much space is needed to display specified text.
|
void |
setLabelFont(java.awt.Font value)
Sets the Font used to draw labels.
|
void |
setTextBrush(com.mindfusion.drawing.Brush value)
Sets the Brush used to draw labels.
|
public TextRenderer(RenderContext context, java.awt.Font font, com.mindfusion.drawing.Brush textBrush)
context
- A RenderContext instance.font
- A System.Drawing.Font instance.textBrush
- A System.Drawing.Brush instance.public TextRenderer(RenderContext context, java.awt.Font font, com.mindfusion.drawing.Brush textBrush, com.mindfusion.drawing.Brush background, com.mindfusion.drawing.Pen borderPen)
context
- A RenderContext instance.font
- A System.Drawing.Font instance.textBrush
- A System.Drawing.Brush instance.background
- A Brush
that will be used to draw labels' background.borderPen
- A Pen
that will be used to draw labels' borders.public static void enterCollectMode()
public static void exitCollectMode(RenderContext context)
public static void drawText(java.awt.Graphics2D graphics, java.lang.String text, java.awt.geom.Rectangle2D rect, java.awt.Font font, com.mindfusion.drawing.Align alignment, com.mindfusion.drawing.Align verticalAlignment, float maxWidth)
public static com.mindfusion.common.XDimension2D.Double measureText(java.lang.String text, float maxWidth, java.awt.Font font, java.awt.Graphics2D graphics)
text
- The text to measure.maxWidth
- The maximum width available.font
- A Font
instance.graphics
- A Graphics2D where the text will be rendered.public static com.mindfusion.common.XDimension2D.Double measureText(java.lang.String text, float maxWidth, java.awt.Font font, RenderContext context)
text
- The text to measure.maxWidth
- The maximum width available.font
- A Font
instance.context
- A RenderContext
where the text will be rendered.public java.awt.Font getLabelFont()
public void setLabelFont(java.awt.Font value)
public com.mindfusion.drawing.Brush getTextBrush()
public void setTextBrush(com.mindfusion.drawing.Brush value)
public void drawLabelAtPoint(Series series, int index, java.awt.geom.Point2D point, LabelKinds labelKind)
series
- A Series whose label to draw.index
- An integer index of the label.point
- A PointF specifying the label's location.labelKind
- A member of the LabelKinds enumeration.public void drawRightFromPoint(Series series, int index, java.awt.geom.Point2D point, LabelKinds labelKind)
series
- A Series whose label to draw.index
- An integer index of the label.point
- A PointF specifying the label's location.labelKind
- A member of the LabelKinds enumeration.public void drawLeftFromPoint(Series series, int index, java.awt.geom.Point2D point, LabelKinds labelKind)
series
- A Series whose label to draw.index
- An integer index of the label.point
- A PointF specifying the label's location.labelKind
- A member of the LabelKinds enumeration.public void drawRotatedLabelInRect(java.lang.String text, java.awt.geom.Rectangle2D bounds, com.mindfusion.drawing.Brush textBrush, com.mindfusion.drawing.Align alignment)
text
- A string containing the text to draw.bounds
- A RectangleF specifying the layout rectangle.textBrush
- A System.Drawing.Brush instance.alignment
- A member of the Align enumeration.public void drawRotatedLabelInRect(java.lang.String text, java.awt.geom.Rectangle2D bounds, com.mindfusion.drawing.Brush textBrush, com.mindfusion.drawing.Align alignment, com.mindfusion.drawing.Align lineAlignment)
public void drawRotatedLabelInRect(Series series, int index, java.awt.geom.Rectangle2D bounds, LabelKinds labelKind)
series
- A Series whose label to draw.index
- An integer index of the label.bounds
- A RectangleF specifying the layout rectangle.labelKind
- A member of the LabelKinds enumeration.public void drawLabelInRect(Series series, int index, java.awt.geom.Rectangle2D bounds, LabelKinds labelKind)
series
- A Series whose label to draw.index
- An integer index of the label.bounds
- A RectangleF specifying the layout rectangle.labelKind
- A member of the LabelKinds enumeration.