public class mxCurveLabelShape extends Object implements mxITextShape
Modifier and Type | Class and Description |
---|---|
class |
mxCurveLabelShape.LabelGlyphCache
Utility class to describe the characteristics of each glyph of a branch
branch label.
|
class |
mxCurveLabelShape.LabelPosition
Utility class that stores details of how the label is positioned
on the curve
|
Modifier and Type | Field and Description |
---|---|
int |
centerVisibleIndex
The index of the central glyph of the label that is visible
|
protected mxCurve |
curve
Cache of the points between which drawing straight lines views as a
curve
|
static double |
CURVE_TEXT_STRETCH_FACTOR
Factor by which text on the inside of curve is stretched
|
static Object |
FONT_FRACTIONALMETRICS
Specifies if image aspect should be preserved in drawImage.
|
static FontRenderContext |
frc
Shared FRC for font size calculations
|
static mxRectangle |
INVALID_GLYPH_BOUNDS
Indicates that a glyph does not have valid drawing bounds, usually
because it is not visible
|
static double |
LABEL_BUFFER
Buffer at both ends of the label
|
protected mxRectangle |
labelBounds
Cache of the bounds of the label
|
protected mxCurveLabelShape.LabelGlyphCache[] |
labelGlyphs
Cache of information describing characteristics relating to drawing
each glyph of this label
|
protected mxCurveLabelShape.LabelPosition |
labelPosition
ADT to encapsulate label positioning information
|
protected double |
labelSize
Cache of the total length of the branch label
|
protected Font |
lastFont
Cache of the label font
|
protected List<mxPoint> |
lastPoints
Cache of the last set of guide points that this label was calculated for
|
protected String |
lastValue
Cache of the label text
|
protected boolean |
rotationEnabled |
GlyphVector[] |
rtlGlyphVectors
Cache of BIDI glyph vectors
|
protected mxCellState |
state
Cache the state associated with this shape
|
Constructor and Description |
---|
mxCurveLabelShape(mxCellState state,
mxCurve value) |
Modifier and Type | Method and Description |
---|---|
protected void |
calculationLabelPosition(Map<String,Object> style,
String label)
Hook method to override how the label is positioned on the curve
|
mxRectangle |
getCenterVisiblePosition()
Returns the drawing bounds of the central indexed visible glyph
|
mxCurve |
getCurve() |
mxRectangle |
getLabelBounds() |
boolean |
getRotationEnabled() |
boolean |
intersectsRect(Rectangle rect)
Returns whether or not the rectangle passed in hits any part of this
curve.
|
void |
paintShape(mxGraphics2DCanvas canvas,
String text,
mxCellState state,
Map<String,Object> style) |
protected void |
postprocessGlyph(mxCurve curve,
String label,
int j,
double currentPos)
Hook for sub-classers to perform additional processing on
each glyph
|
void |
setCurve(mxCurve curve) |
void |
setRotationEnabled(boolean value) |
mxRectangle |
updateLabelBounds(String label,
Map<String,Object> style)
Updates the cached position and size of each glyph in the edge label.
|
protected String lastValue
protected Font lastFont
protected List<mxPoint> lastPoints
protected mxCurve curve
protected mxCellState state
protected mxCurveLabelShape.LabelGlyphCache[] labelGlyphs
protected double labelSize
protected mxRectangle labelBounds
protected mxCurveLabelShape.LabelPosition labelPosition
public static double LABEL_BUFFER
public static double CURVE_TEXT_STRETCH_FACTOR
public static mxRectangle INVALID_GLYPH_BOUNDS
public int centerVisibleIndex
public static Object FONT_FRACTIONALMETRICS
public GlyphVector[] rtlGlyphVectors
public static FontRenderContext frc
protected boolean rotationEnabled
public mxCurveLabelShape(mxCellState state, mxCurve value)
public boolean getRotationEnabled()
public void setRotationEnabled(boolean value)
public void paintShape(mxGraphics2DCanvas canvas, String text, mxCellState state, Map<String,Object> style)
paintShape
in interface mxITextShape
public mxRectangle updateLabelBounds(String label, Map<String,Object> style)
label
- the entire string of the label.style
- the edge styleprotected void postprocessGlyph(mxCurve curve, String label, int j, double currentPos)
curve
- The curve object holding the label curvelabel
- the text label of the curvej
- the index of the labelcurrentPos
- the distance along the label curve the glyph ispublic boolean intersectsRect(Rectangle rect)
rect
- the rectangle to detect for a hitprotected void calculationLabelPosition(Map<String,Object> style, String label)
style
- the style of the curvelabel
- the string label to be displayed on the curvepublic mxCurve getCurve()
public void setCurve(mxCurve curve)
curve
- the curve to setpublic mxRectangle getLabelBounds()
public mxRectangle getCenterVisiblePosition()
Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.