public abstract class IlvPositionableDecoration extends IlvChartDecoration implements SwingConstants
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 |
---|
IlvPositionableDecoration(int anchor)
Creates a new
IlvPositionableDecoration object. |
Modifier and Type | Method and Description |
---|---|
protected void |
chartConnected(IlvChart oldChart,
IlvChart newChart)
Called when the decoration is added to or removed from a chart.
|
protected void |
computeLocation()
Computes the current location of the decoration, and stores the result in
the object returned by
getLocation() . |
int |
getAnchor()
Returns the decoration's anchor within the plot area.
|
abstract Rectangle2D |
getBounds(Rectangle2D retBounds)
Returns the bounds of this decoration.
|
protected Point |
getLocation()
Returns the current location of the decoration, as an offset from the
chart area's coordinate system and this decoration's coordinate system.
|
Point |
getOffset()
Returns the decoration's position, relative to the anchor.
|
void |
setAnchor(int anchor)
Sets the decoration's anchor within the plot area.
|
void |
setOffset(Point offset)
Sets the decoration's position, relative to the anchor.
|
afterDraw, baseTextDirectionChanged, beforeDraw, componentOrientationChanged, draw, getChart, getDrawOrder, has3DSupport, isVisible, repaint, setDrawOrder, setVisible, updateBoundsCache
public IlvPositionableDecoration(int anchor)
IlvPositionableDecoration
object.anchor
- The 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 IlvChartDecoration
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 int getAnchor()
setAnchor(int)
public void setAnchor(int anchor)
anchor
- 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.public Point getOffset()
setOffset(java.awt.Point)
public void setOffset(Point offset)
protected final Point getLocation()
protected void computeLocation()
getLocation()
.public abstract Rectangle2D getBounds(Rectangle2D retBounds)
The result must consider getLocation()
for the x and y values
of the result, and must ignore getLocation()
for the width
and height of the result.
The result must not use getAnchor()
or
getOffset()
directly; these parameters are already taken into
account by the computation of getLocation
.
getBounds
in interface IlvChartDrawable
getBounds
in class IlvChartDecoration
retBounds
- A rectangle used to store the result. If this parameter
is null
, a new Rectangle2D
is allocated.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.