|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.chart.marker.AbstractMarker
lt.monarch.chart.marker.AbstractTextMarker
lt.monarch.chart.marker.LabeledMarker
public class LabeledMarker extends AbstractTextMarker
Renders a text label of the associated entity above the marker point. To change connector color set default foreground in PaintStyle. To change label area fill set label background in PaintStyle. To change label area outline set label foreground in PaintStyle.
| Modifier and Type | Field and Description |
|---|---|
protected Alignment |
horizontalLabelAlignment
|
protected Rectangle2D |
labelBounds
Label bounds |
protected Marker |
nestedMarker
the nested marker |
protected int |
offsetX
|
protected int |
offsetY
|
protected boolean |
useLabelAlignWithOffset
|
protected Alignment |
verticalLabelAlignment
|
| Fields inherited from class lt.monarch.chart.marker.AbstractTextMarker |
|---|
chart, defaultBackground, painter, textStyle |
| Fields inherited from class lt.monarch.chart.marker.AbstractMarker |
|---|
dirty, map, metaModel, paintStyle, projectedLocation, style |
| Constructor and Description |
|---|
LabeledMarker(Marker marker,
MetaDataModel metaModel)
Constructs a new LabeledMarker with the specified nested marker. |
LabeledMarker(MetaDataModel metaModel)
Constructs a new LabeledMarker. |
| Modifier and Type | Method and Description |
|---|---|
void |
applyConstraints(MarkerConstraints[] mc,
AbstractGraphics g,
Projector projector)
Apply marker constraints |
void |
dispose()
Disposes object |
void |
draw(AbstractGraphics g,
SeriesPaintTags tag,
Style style)
Renders the marker on the Graphics context. |
protected void |
drawConnectionLine(AbstractGraphics g)
Renders marker connection line. |
protected void |
drawMarkerText(AbstractGraphics g,
Style style)
Renders marker text. |
protected void |
drawNestedMarker(AbstractGraphics g,
SeriesPaintTags tag,
Style style)
Renders nested marker. |
Rectangle2D |
getBounds()
Gets bounds of this marker. |
java.awt.Color |
getConnectionColor()
Returns color of line that connect marker and label bounds. |
Alignment |
getHorizontalLabelAlignment()
Returns horizontal alignment of label. |
Rectangle2D |
getLabelBounds()
Returns bounds of this marker tip. |
Marker |
getNestedMarker()
Gets nested marker. |
Alignment |
getVerticalLabelAlignment()
Returns vertical alignment of label. |
void |
prepare(AbstractGraphics g)
Prepares the marker for drawing. |
void |
reset()
Resets the marker after use. |
void |
setConnectionColor(java.awt.Color color)
Sets color of line that connects marker and label bounds. |
void |
setEntity(ChartEntity entity)
References the entity object, for which the marker is being painted. |
void |
setLabelAlignment(Alignment hAlign,
Alignment vAlign)
Sets label alignment. |
void |
setLocation(Projector projector,
GeneralPoint npt)
Sets location of the marker. |
void |
setOffset(int offsetX,
int offsetY)
Sets horizontal and vertical offsets for this marker. |
protected void |
setText(java.lang.String text)
Sets text to paint |
void |
setTextAlignment(Alignment hAlign,
Alignment vAlign)
Sets text alignment in label. |
| Methods inherited from class lt.monarch.chart.marker.AbstractTextMarker |
|---|
getPainter, getParent, getStyle, getTextStyle, isAdjustingForNonFittingBars, setAdjustingForNonFittingBars |
| Methods inherited from class lt.monarch.chart.marker.AbstractMarker |
|---|
clearChartObjectsMap, draw, finalize, getChartObjectBounds, getMetaModel, getPaintStyle, getTransparencyValue, isVisible, mapChartObject, setChartObjectsMap, setMetaModel, setTransparencyValue, setVisible |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Marker nestedMarker
protected Rectangle2D labelBounds
protected int offsetX
protected int offsetY
protected boolean useLabelAlignWithOffset
protected Alignment verticalLabelAlignment
protected Alignment horizontalLabelAlignment
| Constructor Detail |
|---|
public LabeledMarker(MetaDataModel metaModel)
LabeledMarker. A new NullMarker is used as
nested marker.
metaModel - meta data model
public LabeledMarker(Marker marker,
MetaDataModel metaModel)
LabeledMarker with the specified nested marker.
marker - the nested markermetaModel - meta data model| Method Detail |
|---|
public void setTextAlignment(Alignment hAlign,
Alignment vAlign)
setTextAlignment in interface MarkersetTextAlignment in class AbstractMarkerhAlign - horizontal alignment. Possible alignments: Alignment.CENTER, Alignment.LEFT,
Alignment.RIGHTvAlign - vertical alignment. Possible alignments: Alignment.CENTER, Alignment.TOP,
Alignment.BOTTOMTextPainterpublic void setEntity(ChartEntity entity)
setEntity in interface MarkersetEntity in class AbstractMarkerentity - the referenced chart entityprotected void setText(java.lang.String text)
text - text to paint
public void setLocation(Projector projector,
GeneralPoint npt)
setLocation in interface MarkersetLocation in class AbstractMarkerprojector - projector used to project the normalized pointnpt - normalized point that specifies marker positionpublic void reset()
reset in interface Markerreset in class AbstractMarkerpublic void prepare(AbstractGraphics g)
prepare in interface Markerprepare in class AbstractMarkerg - graphics contextpublic Rectangle2D getBounds()
public Rectangle2D getLabelBounds()
public void draw(AbstractGraphics g,
SeriesPaintTags tag,
Style style)
Marker
g - graphics contexttag - painting tagstyle - drawing styleprotected void drawConnectionLine(AbstractGraphics g)
g - graphics context
protected void drawNestedMarker(AbstractGraphics g,
SeriesPaintTags tag,
Style style)
g - graphics contexttag - painting tagstyle - drawing style
protected void drawMarkerText(AbstractGraphics g,
Style style)
g - graphics contextstyle - drawing style
public void setOffset(int offsetX,
int offsetY)
offsetX - the horizontal offsetoffsetY - the vertical offsetpublic Marker getNestedMarker()
public void dispose()
dispose in interface Markerdispose in class AbstractMarkerpublic void setConnectionColor(java.awt.Color color)
color - Color of connecting linepublic java.awt.Color getConnectionColor()
public Alignment getVerticalLabelAlignment()
public Alignment getHorizontalLabelAlignment()
public void setLabelAlignment(Alignment hAlign,
Alignment vAlign)
hAlign - horizontal alignment. Possible alignments: Alignment.CENTER, Alignment.LEFT,
Alignment.RIGHTvAlign - vertical alignment. Possible alignments: Alignment.CENTER, Alignment.TOP,
Alignment.BOTTOM
public void applyConstraints(MarkerConstraints[] mc,
AbstractGraphics g,
Projector projector)
applyConstraints in class AbstractTextMarkermc - marker constraintsg - graphicsprojector - projector
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||