public class IlvScale extends IlvChartOwnedDrawable implements IlvChartAreaAccessible, Serializable
Scales might be defined as a graphical representation of a chart axis. As
such, a scale is always associated with an IlvAxis
instance. The axis to bind
to a scale is determined when a scale is added to a chart, using the
IlvChart.setXScale(ilog.views.chart.IlvScale)
and IlvChart.setYScale(int, ilog.views.chart.IlvScale)
methods.
A scale is composed of:
Here is a figure showing the different parts of a scale:
Modifier and Type | Field and Description |
---|---|
static int |
ADAPTIVE_SKIP
Skip label type: indicates that the scale considers every label from the
first to the last, and determines which one should be skipped to avoid
overlapping.
|
static int |
CONSTANT_SKIP
Skip label type: indicates that the scale computes a constant number of
labels to skip to avoid overlapping.
|
static int |
INSIDE
Circular scale side (x scale in polar or radar chart): Labels, title, and
"outside" ticks are drawn inside the circle.
|
static int |
LEFT_SIDE
Radial scale side (y scale in polar or radar chart): Labels, title, and
"outside" ticks are drawn to the left of the radial scale.
|
static int |
LOWER_SIDE
Side: Labels, title, and "outside" ticks are drawn towards decreasing
values of the dual axis.
|
static int |
OUTSIDE
Circular scale side (x scale in polar or radar chart): Labels, title, and
"outside" ticks are drawn outside the circle.
|
static int |
RIGHT_SIDE
Radial scale side (y scale in polar or radar chart): Labels, title, and
"outside" ticks are drawn to the right of the radial scale.
|
static int |
TICK_CROSS
Tick layout type: ticks are drawn both inside and outside the plot area.
|
static int |
TICK_INSIDE
Tick layout type: ticks are drawn inside the plot area.
|
static int |
TICK_OUTSIDE
Tick layout type: ticks are drawn outside the plot area.
|
static int |
UPPER_SIDE
Side: Labels, title, and "outside" ticks are drawn towards increasing
values of the dual axis.
|
Constructor and Description |
---|
IlvScale()
Creates a numeric scale with the step and substep units automatically
computed.
|
IlvScale(double stepUnit,
double subStepUnit)
Creates a new numeric scale with the specified step and substep units.
|
IlvScale(IlvTimeUnit timeUnit)
Creates a new time scale with the specified time unit.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(IlvScaleAnnotation annotation)
Adds an annotation to this scale.
|
protected void |
baseTextDirectionChanged()
This method is invoked when the effective base text direction has changed.
|
protected void |
chartConnected(IlvChart oldChart,
IlvChart newChart)
This method is called with a non-
null argument when this
drawable object is being attached to a chart. |
protected void |
componentOrientationChanged(ComponentOrientation oldOrientation,
ComponentOrientation newOrientation)
This method is invoked when the component orientation of the chart that
displays this scale has changed.
|
protected Rectangle2D |
computeBounds(Rectangle2D bounds)
Computes the entire bounds.
|
String |
computeLabel(double value)
Returns the label associated with the specified value.
|
protected IlvDoublePoint |
computeLabelLocation(IlvDoublePoint loc,
double tickAngle,
int offset,
double width,
double height)
Computes the location of a step label.
|
void |
draw(Graphics dst)
Draws the scale into the specified
Graphics context. |
void |
drawHighlight(Graphics g)
Draws this scale as highlighted.
|
void |
drawIntoHitmap(IlvChartHitmapDefinition definition,
IlvChartHitmapAccumulator accumulator)
Draws the rendering into a hitmap.
|
void |
drawSelectionHandles(Graphics g,
IlvHandlesSelectionStyle style)
Draws this scale with selection handles.
|
IlvScaleAnnotation[] |
getAnnotations()
Returns the annotations attached to this scale.
|
IlvAxis |
getAxis()
Returns the axis to which this scale is connected.
|
static int |
getAxisIndex(IlvScale scale)
Returns the axis index of the specified scale.
|
Stroke |
getAxisStroke()
Returns the stroke used to draw the axis and ticks.
|
Rectangle2D |
getBounds(Rectangle2D bounds)
Returns the bounds of this scale.
|
Rectangle2D |
getBoundsUsingCache(Rectangle2D bounds)
Returns the bounds of this scale, without unnecessary recomputations.
|
IlvChart |
getChart()
Returns the chart displaying this scale.
|
int |
getCircleSide()
Returns the side of the labels, title, and "outside" ticks
along the circular scale of a polar or radial chart.
|
ComponentOrientation |
getComponentOrientation()
Returns the component orientation of the chart that displays this scale.
|
IlvCoordinateSystem |
getCoordinateSystem()
Returns the coordinate system formed by this scale axis and its dual
axis.
|
IlvAxis.Crossing |
getCrossing()
Returns where this scale crosses its dual axis.
|
double |
getCrossingValue()
Returns the value at which this scale crosses its dual axis.
|
int |
getDefaultSide()
Returns the default side of the labels, title and "outside" ticks.
|
int |
getDrawOrder()
Returns the drawing order of this scale.
|
IlvAxis |
getDualAxis()
Returns the dual axis of this scale.
|
Color |
getForeground()
Returns the color used to draw the axis and step labels.
|
int |
getLabelAlignment()
Returns the alignment of step labels.
|
Rectangle2D |
getLabelBounds(int stepIdx,
Rectangle2D bounds)
Returns the bounds of the step label at the specified index.
|
Color |
getLabelColor()
Returns the color used to display the step labels.
|
int |
getLabelCount()
Returns the number of step labels.
|
Font |
getLabelFont()
Returns the font used to draw the step labels.
|
IlvValueFormat |
getLabelFormat()
Returns the format of step labels.
|
int |
getLabelOffset()
Returns the offset between tick marks and labels.
|
double |
getLabelRotation()
Returns the rotation applied to the step labels.
|
double |
getLabelValue(int stepIdx)
Returns the value associated with the specified step label.
|
int |
getMajorTickSize()
Returns the size of major tick marks.
|
int |
getMinorTickSize()
Returns the size of minor tick marks.
|
int |
getRadialSide()
Returns the side of the labels, title, and "outside" ticks
along the radial scale of a polar or radial chart.
|
int |
getResolvedBaseTextDirection()
Returns the resolved base text direction.
|
int |
getSide()
Returns the side of the labels, title, and "outside" ticks.
|
int |
getSkipLabelMode()
Indicates how the scale determines the labels to skip.
|
IlvStepsDefinition |
getStepsDefinition()
Returns the object used to compute the steps of this scale.
|
IlvDoubleArray |
getStepValues()
Returns the step values.
|
IlvDoubleArray |
getSubStepValues()
Returns the substep values.
|
int |
getTickLayout()
Returns the layout of tick marks.
|
String |
getTitle()
Returns the title associated to this scale.
|
Shape |
getTitleBackgroundShape()
Returns the background shape of the title.
|
Font |
getTitleFont()
Returns the title font.
|
int |
getTitleOffset()
Returns the offset between the scale title and the step labels.
|
int |
getTitlePlacement()
Returns the title placement.
|
IlvLabelRenderer |
getTitleRenderer()
Returns the
IlvLabelRenderer used to draw the title. |
double |
getTitleRotation()
Returns the title rotation.
|
boolean |
has3DSupport()
Indicates whether the scale supports three-dimensional drawing.
|
boolean |
hit(Point2D pt)
Returns the result of a hit testing on the specified point.
|
boolean |
isAutoCrossing()
Indicates whether the scale uses a default crossing location.
|
boolean |
isAutoSide()
Indicates whether the side of the labels, title and "outside" ticks is
chosen automatically.
|
boolean |
isAutoWrapping()
Indicates whether step labels are wrapped.
|
boolean |
isAxisVisible()
Indicates whether the axis is visible.
|
boolean |
isCategory()
Indicates whether this scale displays categories.
|
boolean |
isLabelVisible()
Indicates whether step labels are visible.
|
boolean |
isMajorTickVisible()
Indicates whether major ticks are visible.
|
boolean |
isMinorTickVisible()
Indicates whether minor ticks are visible.
|
boolean |
isSkippingLabel()
Indicates whether the scale skips step labels when they overlap.
|
boolean |
isViewable()
Indicates whether this scale can be displayed.
|
boolean |
isVisible()
Indicates whether this scale is visible.
|
void |
recalc()
Recalculates the steps values and labels.
|
void |
removeAnnotation(IlvScaleAnnotation annotation)
Removes the specified annotation from this scale.
|
void |
setAnnotations(IlvScaleAnnotation[] annotations)
Sets the annotations attached to this scale.
|
void |
setAutoCrossing(boolean auto)
Specifies whether the scale uses a default crossing location.
|
void |
setAutoSide(boolean auto)
Specifies whether the side of the labels, title and "outside" ticks
should be chosen automatically.
|
void |
setAutoWrapping(boolean autoWrapping)
Toggles the automatic wrapping of step labels.
|
void |
setAxisStroke(Stroke stroke)
Specifies the stroke for the axis and ticks.
|
void |
setAxisVisible(boolean visible)
Toggles the visibility of the axis.
|
void |
setCategory(boolean isCategory)
Specifies that this scale should display categories.
|
void |
setCategory(IlvDataSet dataSet,
boolean tickBetweenCategory)
Specifies that this scale should display categories.
|
void |
setCircleSide(int side)
Sets the side where to place the labels, title, and "outside" ticks
along the circular scale of a polar or radial chart.
|
void |
setCrossing(IlvAxis.Crossing crossing)
Specifies where this scale crosses its dual axis.
|
void |
setCrossingValue(double value)
Specifies where this scale crosses its dual axis.
|
void |
setDrawOrder(int drawOrder)
Sets the drawing order of this scale.
|
void |
setForeground(Color color)
Changes the color of the scale axis.
|
void |
setLabelAlignment(int alignment)
Specifies the alignment of step labels.
|
void |
setLabelColor(Color color)
Changes the color used to display the step labels.
|
void |
setLabelFont(Font font)
Sets the font used to draw the step labels.
|
void |
setLabelFormat(IlvValueFormat fmt)
Specifies a format for the step labels.
|
void |
setLabelOffset(int offset)
Specifies the offset between tick marks and labels.
|
void |
setLabelRotation(double angle)
Specifies the rotation of the step labels.
|
void |
setLabelVisible(boolean visible)
Toggles the visibility of step labels.
|
void |
setLogarithmic(double logBase)
Put the scale into logarithmic mode.
|
void |
setMajorTickSize(int size)
Specifies the size of major tick marks.
|
void |
setMajorTickVisible(boolean visible)
Toggles the visibility of major ticks.
|
void |
setMinorTickSize(int size)
Specifies the size of minor tick marks.
|
void |
setMinorTickVisible(boolean visible)
Toggles the visibility of minor ticks.
|
void |
setRadialSide(int side)
Sets the side where to place the labels, title, and "outside" ticks
along the radial scale of a polar or radial chart.
|
void |
setSide(int side)
Sets the side where to place the labels, title, and "outside" ticks.
|
void |
setSkipLabelMode(int mode)
Specifies how the scale determines the labels to skip.
|
void |
setSkippingLabel(boolean skip)
Tells the scale to skip step labels when they overlap.
|
void |
setStepsDefinition(IlvStepsDefinition stepsDefinition)
Changes the steps definition.
|
void |
setStepUnit(Double stepUnit,
Double subStepUnit)
Specifies the step and substep units of this scale.
|
void |
setTickLayout(int layout)
Specifies the layout of tick marks.
|
void |
setTimeUnit(IlvTimeUnit timeUnit)
Specifies a time unit for this scale.
|
void |
setTitle(String text)
Sets the scale title text.
|
void |
setTitle(String text,
double rotation)
Sets the scale title to the specified string with the specified rotation.
|
void |
setTitleFont(Font font)
Sets the title font.
|
void |
setTitleOffset(int offset)
Specifies the offset between the scale title and the step labels.
|
void |
setTitlePlacement(int pos)
Sets the title placement.
|
void |
setTitleRotation(double angle)
Sets the title rotation.
|
void |
setVisible(boolean visible)
Toggles the visibility of this scale.
|
Point |
toPoint(double value)
Returns the location on the axis of the specified value.
|
double |
toValue(int x,
int y)
Returns the value corresponding to the specified point on the scale.
|
void |
updateAnnotations()
Called by the scale while it computes its bounds.
|
public static final int TICK_INSIDE
setTickLayout(int)
,
Constant Field Valuespublic static final int TICK_OUTSIDE
setTickLayout(int)
,
Constant Field Valuespublic static final int TICK_CROSS
setTickLayout(int)
,
Constant Field Valuespublic static final int CONSTANT_SKIP
setSkipLabelMode(int)
,
Constant Field Valuespublic static final int ADAPTIVE_SKIP
setSkipLabelMode(int)
,
Constant Field Valuespublic static final int LOWER_SIDE
setSide(int)
,
Constant Field Valuespublic static final int UPPER_SIDE
setSide(int)
,
Constant Field Valuespublic static final int LEFT_SIDE
setRadialSide(int)
,
Constant Field Valuespublic static final int RIGHT_SIDE
setRadialSide(int)
,
Constant Field Valuespublic static final int OUTSIDE
setCircleSide(int)
,
Constant Field Valuespublic static final int INSIDE
setCircleSide(int)
,
Constant Field Valuespublic IlvScale()
public IlvScale(double stepUnit, double subStepUnit)
stepUnit
- The step unit of the scale steps definition.
If this parameter is zero, the step unit is automatically computed.subStepUnit
- The substep unit of the scale steps definition.
If this parameter is zero, the substep unit is automatically computed.setStepUnit(Double, Double)
public IlvScale(IlvTimeUnit timeUnit)
timeUnit
- The time unit of the scale steps definition.
If this parameter is null
, the time unit is
automatically computed.setTimeUnit(ilog.views.chart.IlvTimeUnit)
public final ComponentOrientation getComponentOrientation()
protected void componentOrientationChanged(ComponentOrientation oldOrientation, ComponentOrientation newOrientation)
oldOrientation
- The component orientation before the change.newOrientation
- The component orientation after the change.getComponentOrientation()
public final Stroke getAxisStroke()
setAxisStroke(java.awt.Stroke)
public void setAxisStroke(Stroke stroke)
getAxisStroke()
public int getResolvedBaseTextDirection()
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
.protected void baseTextDirectionChanged()
getResolvedBaseTextDirection()
has
changed, orgetComponentOrientation()
has changed
and the value of getResolvedBaseTextDirection()
is
IlvBidiUtil.CONTEXTUAL_DIRECTION
.public final Font getLabelFont()
public void setLabelFont(Font font)
public final Color getLabelColor()
setLabelColor(java.awt.Color)
public void setLabelColor(Color color)
getLabelColor()
public Color getForeground()
public void setForeground(Color color)
setLabelColor(java.awt.Color)
public final int getDrawOrder()
Integer.MAX_VALUE
.getDrawOrder
in interface IlvChartDrawable
IlvChartDrawable
objects are drawn in ascending drawing
order. The drawing order also specifies whether the object is drawn above
(positive values) or below (negative values) the graphical representations
of the chart data.setDrawOrder(int)
public void setDrawOrder(int drawOrder)
IlvChart.DRAW_ABOVE
,
IlvChart.DRAW_BELOW
,
getDrawOrder()
public final int getMajorTickSize()
setMajorTickSize(int)
public void setMajorTickSize(int size)
6
.getMajorTickSize()
public final int getMinorTickSize()
setMinorTickSize(int)
public void setMinorTickSize(int size)
3
.getMinorTickSize()
public final int getTickLayout()
setTickLayout(int)
public void setTickLayout(int layout)
TICK_INSIDE
,
TICK_OUTSIDE
,
TICK_CROSS
,
getTickLayout()
public final int getLabelOffset()
setLabelOffset(int)
public void setLabelOffset(int offset)
3
.getLabelOffset()
public final int getTitleOffset()
setTitleOffset(int)
public void setTitleOffset(int offset)
3
.offset
- The new title offset.getTitleOffset()
public final boolean isAutoWrapping()
setAutoWrapping(boolean)
public void setAutoWrapping(boolean autoWrapping)
'\n'
) that are embedded in the label string.
Note: Label wrapping does not check the orientation nor the type of the scale. Similarly, it does not take into account the rotation of scale labels. It should only be enabled for scales whose labels are parallel to the axis.
autoWrapping
- Whether automatic wrapping is used.public final int getLabelAlignment()
setLabelAlignment(int)
public void setLabelAlignment(int alignment)
SwingConstants.LEFT
: left alignment.SwingConstants.CENTER
(default): centered alignment.SwingConstants.RIGHT
: right alignment.setAutoWrapping(boolean)
,
getLabelAlignment()
public double getTitleRotation()
setTitle(String, double)
public void setTitleRotation(double angle)
angle
- The rotation angle (in degree).public Font getTitleFont()
public void setTitleFont(Font font)
public final String getTitle()
null
if no title is displayed.setTitle(String, double)
public void setTitle(String text)
getTitle()
public void setTitle(String text, double rotation)
public IlvLabelRenderer getTitleRenderer()
IlvLabelRenderer
used to draw the title.public int getTitlePlacement()
setTitlePlacement(int)
public void setTitlePlacement(int pos)
0
meaning the title is drawn
at the minimum axis value, 100
meaning the title is drawn at the
maximum axis value. The default value is 50
, meaning the title is
drawn in the middle of the scale.public final boolean isViewable()
A scale can be displayed when the following conditions are verified:
IlvChart.setXScale(ilog.views.chart.IlvScale)
or IlvChart.setYScale(int, ilog.views.chart.IlvScale)
method.
isVisible()
).
isViewable
in interface IlvChartAreaAccessible
public double getLabelRotation()
setLabelRotation(double)
public void setLabelRotation(double angle)
getLabelRotation()
public final boolean isSkippingLabel()
setSkippingLabel(boolean)
public void setSkippingLabel(boolean skip)
skip
- If set to true
, the scale may discard labels
so that they do not overlap. If false
, no overlapping test
is performed. The default value is true
.isSkippingLabel()
,
setSkipLabelMode(int)
public final int getSkipLabelMode()
CONSTANT_SKIP
.setSkipLabelMode(int)
,
CONSTANT_SKIP
,
ADAPTIVE_SKIP
public void setSkipLabelMode(int mode)
public boolean has3DSupport()
has3DSupport
in interface IlvChart3DSupport
has3DSupport
in interface IlvChartDrawable
public final boolean isVisible()
isVisible
in interface IlvChartDrawable
setVisible(boolean)
public void setVisible(boolean visible)
isVisible()
public final boolean isAxisVisible()
setAxisVisible(boolean)
public void setAxisVisible(boolean visible)
isAxisVisible()
public final boolean isMajorTickVisible()
setMajorTickVisible(boolean)
public void setMajorTickVisible(boolean visible)
isMajorTickVisible()
public final boolean isMinorTickVisible()
setMinorTickVisible(boolean)
public void setMinorTickVisible(boolean visible)
isMinorTickVisible()
public final boolean isLabelVisible()
setLabelVisible(boolean)
public void setLabelVisible(boolean visible)
isLabelVisible()
public final boolean isAutoCrossing()
setAutoCrossing(boolean)
public void setAutoCrossing(boolean auto)
Note: The bean property "autoCrossing" must not be specified together with the bean properties "crossing" or "crossingValue".
isAutoCrossing()
,
setCrossing(ilog.views.chart.IlvAxis.Crossing)
public final IlvAxis.Crossing getCrossing()
setCrossing(ilog.views.chart.IlvAxis.Crossing)
method, or
the default crossing if isAutoCrossing()
returns true
.setCrossing(ilog.views.chart.IlvAxis.Crossing)
public void setCrossing(IlvAxis.Crossing crossing)
Note: The bean property "crossing" must not be specified together with the bean properties "autoCrossing" or "crossingValue".
crossing
- The new crossing. If set to null
, the
crossing is automatically computed.getDualAxis()
,
isAutoCrossing()
public final double getCrossingValue()
public void setCrossingValue(double value)
Note: The bean property "crossingValue" must not be specified together with the bean properties "autoCrossing" or "crossing".
public final boolean isAutoSide()
public void setAutoSide(boolean auto)
Note: The bean property "autoSide" must not be specified together with the bean property "side".
public int getDefaultSide()
LOWER_SIDE
, UPPER_SIDE
.getSide()
public int getSide()
LOWER_SIDE
, UPPER_SIDE
.getDefaultSide()
,
setSide(int)
public void setSide(int side)
Note: The bean property "side" must not be specified together with the bean property "autoSide".
side
- one of LOWER_SIDE
, UPPER_SIDE
.getSide()
,
isAutoSide()
public int getRadialSide()
LEFT_SIDE
, RIGHT_SIDE
.setRadialSide(int)
public void setRadialSide(int side)
side
- one of LEFT_SIDE
, RIGHT_SIDE
.getRadialSide()
public int getCircleSide()
OUTSIDE
, INSIDE
.setCircleSide(int)
public void setCircleSide(int side)
side
- one of OUTSIDE
, INSIDE
.getCircleSide()
public final IlvStepsDefinition getStepsDefinition()
public void setStepsDefinition(IlvStepsDefinition stepsDefinition)
public void setStepUnit(Double stepUnit, Double subStepUnit)
IlvDefaultStepsDefinition
.stepUnit
- The new step unit. If null
, the unit is
automatically computed.subStepUnit
- The new substep unit. If null
, the unit is
automatically computed.IlvDefaultStepsDefinition.setStepUnit(double)
,
IlvDefaultStepsDefinition.setSubStepUnit(double)
public void setTimeUnit(IlvTimeUnit timeUnit)
IlvTimeStepsDefinition
.timeUnit
- The new time unit. If this parameter is null
,
the time unit is automatically computed.IlvTimeStepsDefinition.setAutoUnit(boolean)
,
IlvTimeStepsDefinition.setUnit(ilog.views.chart.IlvTimeUnit)
public final boolean isCategory()
setCategory(boolean)
public final void setCategory(boolean isCategory)
setCategory(ilog.views.chart.data.IlvDataSet, boolean)
public void setCategory(IlvDataSet dataSet, boolean tickBetweenCategory)
IlvCategoryStepsDefinition
.dataSet
- An optional data set argument, which is passed to the
IlvCategoryStepsDefinition
class. This data set is thereby used
to provide step labels.tickBetweenCategory
- If set to true
, the scale will
display ticks between categories. Otherwise, ticks will be displayed at
each category.public void setLogarithmic(double logBase)
IlvLogarithmicStepsDefinition
. It also sets an
IlvLogarithmicAxisTransformer
on the associated axis.
Note: This method should only be called on a scale already added to a chart.
logBase
- The logarithmic base.IlvLogarithmicAxisTransformer
,
IlvLogarithmicStepsDefinition
public final IlvAxis getAxis()
null
until the scale is added to a
chart with the IlvChart.setXScale(ilog.views.chart.IlvScale)
or IlvChart.setYScale(int, ilog.views.chart.IlvScale)
method.getDualAxis()
public final IlvAxis getDualAxis()
null
until the scale is added to a
chart with the IlvChart.setXScale(ilog.views.chart.IlvScale)
or IlvChart.setYScale(int, ilog.views.chart.IlvScale)
method. If this scale is connected to an x-axis, the dual axis is the main
y-axis of the chart. Otherwise, the dual axis is the x-axis of the chart.getAxis()
,
getCoordinateSystem()
public final IlvCoordinateSystem getCoordinateSystem()
getAxis()
,
getDualAxis()
public final IlvChart getChart()
null
until the scale is added to a
chart with the IlvChart.setXScale(ilog.views.chart.IlvScale)
or IlvChart.setYScale(int, ilog.views.chart.IlvScale)
method.getChart
in class IlvChartOwnedDrawable
protected void chartConnected(IlvChart oldChart, IlvChart newChart)
null
argument when this
drawable object is being attached to a chart. It is called with a
null
chart argument when this drawable object is being
detached from its chart.
You should not call this method directly.
chartConnected
in class IlvChartOwnedDrawable
oldChart
- The previous owning chart. May be null
if this drawable object was not attached to a chart before.newChart
- The new associated chart. May be null
if
if this drawable object is being detached from its chart.IlvChartOwnedDrawable.getChart()
public final IlvDoubleArray getStepValues()
public final IlvDoubleArray getSubStepValues()
public final void recalc()
public void draw(Graphics dst)
Graphics
context.draw
in interface IlvChartDrawable
public double toValue(int x, int y)
public Point toPoint(double value)
protected Rectangle2D computeBounds(Rectangle2D bounds)
bounds
- A rectangle optionally used to store the result.
If this parameter is null
, a new Rectangle2D
is allocated.public Rectangle2D getBounds(Rectangle2D bounds)
getBounds
in interface IlvChartDrawable
bounds
- A rectangle optionally used to store the result.
If this parameter is null
, a new Rectangle2D
is allocated.getBoundsUsingCache(java.awt.geom.Rectangle2D)
public Rectangle2D getBoundsUsingCache(Rectangle2D bounds)
bounds
- A rectangle optionally used to store the result.
If this parameter is null
, a new Rectangle2D
is allocated.getBounds(Rectangle2D)
public void drawSelectionHandles(Graphics g, IlvHandlesSelectionStyle style)
drawSelectionHandles
in interface IlvChartAreaAccessible
public void drawHighlight(Graphics g)
public boolean hit(Point2D pt)
public void drawIntoHitmap(IlvChartHitmapDefinition definition, IlvChartHitmapAccumulator accumulator)
definition
- The specification how to construct the hitmap.accumulator
- The object that accumulates objects in the hitmap.public IlvScaleAnnotation[] getAnnotations()
public void setAnnotations(IlvScaleAnnotation[] annotations)
public void addAnnotation(IlvScaleAnnotation annotation)
public void removeAnnotation(IlvScaleAnnotation annotation)
public void updateAnnotations()
public Rectangle2D getLabelBounds(int stepIdx, Rectangle2D bounds)
stepIdx
- The index of the considered step label.bounds
- A rectangle optionally used to store the result. If this parameter
is null
, a new Rectangle2D
is allocated.IndexOutOfBoundsException
- If the index of the step label
is not valid.getLabelCount()
public int getLabelCount()
public double getLabelValue(int stepIdx)
IndexOutOfBoundsException
- If the index of the step label
is not valid.getLabelCount()
public final IlvValueFormat getLabelFormat()
public void setLabelFormat(IlvValueFormat fmt)
computeLabel
method of the steps
definition. Providing a custom format is thus an alternative
to overriding the IlvStepsDefinition.computeLabel(double)
method.computeLabel(double)
public String computeLabel(double value)
IlvStepsDefinition.computeLabel(double)
method.public Shape getTitleBackgroundShape()
getTitle()
,
its font (see getTitleFont()
, and its positioning
(see getTitleOffset()
, getTitlePlacement()
,
getTitleRotation()
).null
if the title is absent or empty.protected IlvDoublePoint computeLabelLocation(IlvDoublePoint loc, double tickAngle, int offset, double width, double height)
loc
- The reference location on the scale axis. This parameter is
modified and returned by the method.tickAngle
- The tick angle.offset
- The desired distance between the axis and the label
boundaries.width
- The width of the label.height
- The height of the label.public static int getAxisIndex(IlvScale scale)
IllegalArgumentException
- The scale is not connected to a chart.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.