public class IlvLabelDecoration extends IlvPositionableDecoration
IlvChartDecoration
,
Serialized FormBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
IlvLabelDecoration(String text)
Creates a new
IlvLabelDecoration object displaying the
specified string centered within the plot area. |
IlvLabelDecoration(String text,
IlvLabelRenderer labelRenderer,
int anchor)
Creates a new
IlvLabelDecoration object displaying the
specified string. |
Modifier and Type | Method and Description |
---|---|
protected void |
baseTextDirectionChanged()
This method is invoked when the effective base text direction of the chart
has changed.
|
protected void |
chartConnected(IlvChart oldChart,
IlvChart newChart)
Called when the decoration is added to or removed from a chart.
|
protected void |
componentOrientationChanged(ComponentOrientation oldOrientation,
ComponentOrientation newOrientation)
This method is invoked when the component orientation of the chart has
changed.
|
void |
draw(Graphics g)
Draws the decoration into the specified
Graphics context. |
Rectangle2D |
getBounds(Rectangle2D retBounds)
Returns the bounds of this decoration.
|
IlvLabelRenderer |
getLabelRenderer()
Returns the renderer used to display the label.
|
String |
getText()
Returns the text of this decoration.
|
void |
setLabelRenderer(IlvLabelRenderer labelRenderer)
Sets the renderer that displays the label.
|
void |
setText(String text)
Sets the text of this decoration.
|
void |
setVisible(boolean visible)
Toggles the visibility of this decoration.
|
protected void |
updateBoundsCache()
Updates the bounds cache of this decoration.
|
computeLocation, getAnchor, getLocation, getOffset, setAnchor, setOffset
afterDraw, beforeDraw, getChart, getDrawOrder, has3DSupport, isVisible, repaint, setDrawOrder
public IlvLabelDecoration(String text)
IlvLabelDecoration
object displaying the
specified string centered within the plot area.text
- The string to display.public IlvLabelDecoration(String text, IlvLabelRenderer labelRenderer, int anchor)
IlvLabelDecoration
object displaying the
specified string.text
- The string to display.labelRenderer
- The appearance of the label.anchor
- The text position within the plot area. One of the
SwingConstants.CENTER
, SwingConstants.NORTH
,
SwingConstants.NORTH_WEST
, SwingConstants.WEST
,
SwingConstants.SOUTH_WEST
, SwingConstants.SOUTH
,
SwingConstants.SOUTH_EAST
, SwingConstants.EAST
,
SwingConstants.NORTH_EAST
constants.protected void chartConnected(IlvChart oldChart, IlvChart newChart)
chartConnected
in class IlvPositionableDecoration
oldChart
- The chart with which the decoration was associated, or
null
if the decoration is added to a new chart.newChart
- The chart to which the decoration is added, or
null
if the decoration is removed from its current chart.IlvChartOwnedDrawable.getChart()
public final String getText()
setText(java.lang.String)
public void setText(String text)
public final IlvLabelRenderer getLabelRenderer()
public void setLabelRenderer(IlvLabelRenderer labelRenderer)
public void draw(Graphics g)
Graphics
context.draw
in interface IlvChartDrawable
draw
in class IlvChartDecoration
public Rectangle2D getBounds(Rectangle2D retBounds)
getBounds
in interface IlvChartDrawable
getBounds
in class IlvPositionableDecoration
retBounds
- A rectangle used to store the result. If this parameter
is null
, a new Rectangle2D
is allocated.protected void updateBoundsCache()
getChart() && isVisible()
is true, or when
getChart() && isVisible()
becomes true.updateBoundsCache
in class IlvChartDecoration
protected void componentOrientationChanged(ComponentOrientation oldOrientation, ComponentOrientation newOrientation)
componentOrientationChanged
in class IlvChartDecoration
oldOrientation
- The component orientation before the change.newOrientation
- The component orientation after the change.Component.getComponentOrientation()
protected void baseTextDirectionChanged()
chart.getResolvedBaseTextDirection()
has changed, orchart.getComponentOrientation()
has
changed and the value of
chart.getResolvedBaseTextDirection()
is
IlvBidiUtil.CONTEXTUAL_DIRECTION
.baseTextDirectionChanged
in class IlvChartDecoration
IlvChart.getResolvedBaseTextDirection()
,
Component.getComponentOrientation()
public void setVisible(boolean visible)
setVisible
in class IlvChartDecoration
IlvChartDecoration.isVisible()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.