info.monitorenter.gui.chart
Interface IAxis<T extends IAxisScalePolicy>

Type Parameters:
T - Subtypes may be more picky which scale policies the accept to disallow incorrect scales: This supports it (see setAxisScalePolicy(IAxisScalePolicy)).
All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AAxis, AAxisTransformation, AxisInverse, AxisLinear, AxisLog10, AxisLogE

public interface IAxis<T extends IAxisScalePolicy>
extends java.io.Serializable

Interface for an axis of the Chart2D.

Version:
$Revision: 1.39 $
Author:
Achim Westermann

Nested Class Summary
static class IAxis.AxisTitle
          Represents a title of an axis.
 
Field Summary
static java.lang.String PROPERTY_ADD_REMOVE_TRACE
          The bean property constant identifying a change of the internal set of ITrace2D instances.
static java.lang.String PROPERTY_AXIS_SCALE_POLICY_CHANGED
          The bean property constant identifying a change of the axis scale policy.
static java.lang.String PROPERTY_LABELFORMATTER
          Constant for a PropertyChangeEvent of the IAxisTitlePainter.
static java.lang.String PROPERTY_PAINTGRID
          Constant for a PropertyChangeEvent of the paint grid flag.
static java.lang.String PROPERTY_PAINTSCALE
          Constant for a PropertyChangeEvent of the paint scale flag.
static java.lang.String PROPERTY_RANGEPOLICY
          Constant for a PropertyChangeEvent of the range policy.
 
Method Summary
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Add a listener for the given property.
 boolean addTrace(ITrace2D trace)
          Adds a trace that belongs to this axis.
 AAxis.AChart2DDataAccessor getAccessor()
          Returns the accessor to the chart.
 int getAxisPosition()
          Returns the constant for the position of this axis for the chart.
 IAxisScalePolicy getAxisScalePolicy()
          Returns the axis scale policy which controls the position and distance of the ticks to draw.
 IAxis.AxisTitle getAxisTitle()
          Returns the title of this axis.
 int getDimension()
          Returns the constant for the dimension this axis stands for in the chart.
 java.lang.String getDimensionString()
          Returns the String constant for the dimension this axis stands for in the chart.
 IAxisLabelFormatter getFormatter()
          Returns the formatter for labels.
 int getHeight(java.awt.Graphics g2d)
          Returns the height in pixel this axis needs to paint itself.
 double getMajorTickSpacing()
          Get the major tick spacing for label generation.
 double getMax()
          Returns the maximum value from all traces of this axis with respect to the installed range policy.
 double getMaxValue()
          Returns the maximum value of all TracePoint2D instances in all ITrace2D instances in this axis regardless of the configured IRangePolicy (see setRangePolicy(IRangePolicy)).
 double getMin()
          Returns the minimum value of all traces of this axis with respect to the installed range policy.
 double getMinorTickSpacing()
          Get the minor tick spacing for label generation.
 double getMinValue()
          Returns the minimum value of all TracePoint2D instances in all ITrace2D instances in this axis regardless of the configured IRangePolicy (see setRangePolicy(IRangePolicy)).
 int getPixelXLeft()
          Returns the left pixel of this axis coordinate in the graphic context of the current paint operation.
 int getPixelXRight()
          Returns the right pixel coordinate of this axis in the graphic context of the current paint operation.
 int getPixelYBottom()
          Returns the bottom pixel coordinate of this axis in the graphic context of the current paint operation.
 int getPixelYTop()
          Returns the top pixel coordinate of this axis in the graphic context of the current paint operation.
 java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
          Returns an array of all the listeners that were added to the this instance with addPropertyChangeListener(String, PropertyChangeListener).
 Range getRange()
          Returns the range lasting from getMin() to getMax().
 IRangePolicy getRangePolicy()
          Returns the range policy of this axis.
 double getScaledValue(double absolute)
          Scales the given absolute value into a value between 0 and 1.0 (if it is in the range of the data).
 java.lang.String getTitle()
          Deprecated. use getAxisTitle() and on the result IAxis.AxisTitle.getTitle().
 IAxisTitlePainter getTitlePainter()
          Deprecated. this method might be dropped because the painter should be of no concern.
 java.util.Set<ITrace2D> getTraces()
          Returns a Set<ITrace2D> with all traces covered by this axis.
 int getWidth(java.awt.Graphics g2d)
          Returns the width in pixel this axis needs to paint itself.
 boolean hasTrace(ITrace2D trace)
          Returns true if this axis is responsible for rendering the scale of the given trace (addTrace(ITrace2D) was called on this instance with the given trace).
 void initPaintIteration()
          Allows to perform expensive calculations for various values that are used by many calls throughout a paint iterations.
 boolean isDirtyScaling()
          Returns true if the bounds in the given dimension of all TracePoint2D instances of all internal ITrace2D instances have changed since all points have been normalized to a value between 0 and 1 or true if this axis has different range since the last call to scale().
 boolean isPaintGrid()
          Returns wether the x grid is painted or not.
 boolean isPaintScale()
          Returns whether the scale for this axis should be painted or not.
 boolean isStartMajorTick()
          Check wether scale values are started from major ticks.
 boolean isVisible()
          Check whether this axis is visible, i.e.
 void paint(java.awt.Graphics g2d)
          Renders the axis line along with title, scale, scale labels and unit label.
 int paintTitle(java.awt.Graphics g2d)
          Routine for painting the title of this axis.
 java.util.Set<ITrace2D> removeAllTraces()
          Convenience method for removing all contained ITrace2D instances of this axis.
 IAxis.AxisTitle removeAxisTitle()
          Removes the title of this axis.
 void removePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
          Remove a PropertyChangeListener for a specific property.
 boolean removeTrace(ITrace2D trace)
          Removes the given trace from this axis.
 void scale()
          Scales all ITrace2D instances in the dimension represented by this axis.
 void scaleTrace(ITrace2D trace)
          Scales the given ITrace2D in the dimension represented by this axis.
 IAxisScalePolicy setAxisScalePolicy(T axisScalePolicy)
          Sets the axis scale policy which controls the position and distance of the ticks to draw.
 void setAxisTitle(IAxis.AxisTitle axisTitle)
          Sets the title of this axis.
 void setFormatter(IAxisLabelFormatter formatter)
          Sets the formatter to use for labels.
 void setMajorTickSpacing(double majorTickSpacing)
          This method sets the major tick spacing for label generation.
 void setMinorTickSpacing(double minorTickSpacing)
          This method sets the minor tick spacing for label generation.
 void setPaintGrid(boolean grid)
          Set wether the grid in this dimension should be painted or not.
 void setPaintScale(boolean show)
          Set if the scale for this axis should be shown.
 void setPixelXLeft(int pixel)
          Sets a Range to use for filtering the view to the the connected Axis.
 void setPixelXRight(int pixel)
          Sets the right pixel of this axis coordinate in the graphic context of the current paint operation.
 void setPixelYBottom(int pixel)
          Sets the bottom pixel of this axis coordinate in the graphic context of the current paint operation.
 void setPixelYTop(int pixel)
          Sets the top pixel of this axis coordinate in the graphic context of the current paint operation.
 void setRange(Range range)
          Sets a Range to use for filtering the view to the the connected Axis.
 void setRangePolicy(IRangePolicy rangePolicy)
          Sets the RangePolicy.
 void setStartMajorTick(boolean majorTick)
          Set wether scale values are started from major ticks.
 java.lang.String setTitle(java.lang.String title)
          Deprecated. use getAxisTitle() and on the result IAxis.AxisTitle.setTitle(String)
 IAxisTitlePainter setTitlePainter(IAxisTitlePainter painter)
          Deprecated. use getAxisTitle() and on the result IAxis.AxisTitle.setTitlePainter(IAxisTitlePainter).
 void setVisible(boolean visible)
          Show/hide this axis.
 double translatePxToValue(int pixel)
          Transforms the given pixel value (which has to be a awt value like MouseEvent.getY() into the chart value.
 int translateValueToPx(double value)
          Transforms the given chart data value into the corresponding awt pixel value for the chart.
 

Field Detail

PROPERTY_ADD_REMOVE_TRACE

static final java.lang.String PROPERTY_ADD_REMOVE_TRACE
The bean property constant identifying a change of the internal set of ITrace2D instances.

Use this constant to register a PropertyChangeListener with the IAxis.

See addPropertyChangeListener(String, PropertyChangeListener) for property change events fired.

See Also:
Constant Field Values

PROPERTY_AXIS_SCALE_POLICY_CHANGED

static final java.lang.String PROPERTY_AXIS_SCALE_POLICY_CHANGED
The bean property constant identifying a change of the axis scale policy.

Use this constant to register a PropertyChangeListener with the IAxis.

See addPropertyChangeListener(String, PropertyChangeListener) for property change events fired.

See Also:
Constant Field Values

PROPERTY_LABELFORMATTER

static final java.lang.String PROPERTY_LABELFORMATTER
Constant for a PropertyChangeEvent of the IAxisTitlePainter.

See Also:
Constant Field Values

PROPERTY_PAINTGRID

static final java.lang.String PROPERTY_PAINTGRID
Constant for a PropertyChangeEvent of the paint grid flag.

See Also:
Constant Field Values

PROPERTY_PAINTSCALE

static final java.lang.String PROPERTY_PAINTSCALE
Constant for a PropertyChangeEvent of the paint scale flag.

See Also:
Constant Field Values

PROPERTY_RANGEPOLICY

static final java.lang.String PROPERTY_RANGEPOLICY
Constant for a PropertyChangeEvent of the range policy.

See Also:
Constant Field Values
Method Detail

addPropertyChangeListener

void addPropertyChangeListener(java.lang.String propertyName,
                               java.beans.PropertyChangeListener listener)
Add a listener for the given property.

The following PropertyChangeEvent types should be fired to listeners:

getPropertyName() getSource() getOldValue() getNewValue()
PROPERTY_ADD_REMOVE_TRACE IAxis that changed null - a new trace was added. ITrace2D, the new trace.
PROPERTY_ADD_REMOVE_TRACE IAxis that changed ITrace2D, the old trace. null - the trace was removed.
PROPERTY_RANGEPOLICY IAxis that changed IRangePolicy, the old value. IRangePolicy, the new value.
PROPERTY_PAINTGRID IAxis that changed Boolean, the old value. Boolean, the new value.
PROPERTY_LABELFORMATTER IAxis that changed IAxisLabelFormatter, the old value or null if there was no formatter before. IAxisLabelFormatter, the new value.
PROPERTY_AXIS_SCALE_POLICY_CHANGED IAxis that changed IAxisScalePolicy, the old value. IAxisScalePolicy, the new value.

Parameters:
propertyName - the property to be informed about changes.
listener - the listener that will be informed.

addTrace

boolean addTrace(ITrace2D trace)
Adds a trace that belongs to this axis.

Adding a trace that is already contained may be problematic, so an exception should be raised in that case to warn you that your code is doing unnecessary to malicious operations.

Parameters:
trace - the trace to add.
Returns:
true if the trace was added, false else.

getAccessor

AAxis.AChart2DDataAccessor getAccessor()
Returns the accessor to the chart.

Returns:
the accessor to the chart.

getAxisPosition

int getAxisPosition()
Returns the constant for the position of this axis for the chart.

Returns:
Chart2D.CHART_POSITION_LEFT, Chart2D.CHART_POSITION_RIGHT, Chart2D.CHART_POSITION_TOP, Chart2D.CHART_POSITION_BOTTOM or -1 if this axis is not assigned to a chart.

getAxisTitle

IAxis.AxisTitle getAxisTitle()
Returns the title of this axis.

Returns:
the axis title used.

removeAxisTitle

IAxis.AxisTitle removeAxisTitle()
Removes the title of this axis.

Prefer this method instead of getAxisTitle() if you want to drop the axis title as this method also "unlistens" this axis from it's title.

Returns:
the removed title.

getDimension

int getDimension()
Returns the constant for the dimension this axis stands for in the chart.

Returns:
Chart2D.X, Chart2D.Y or -1 if this axis is not assigned to a chart.

getDimensionString

java.lang.String getDimensionString()
Returns the String constant for the dimension this axis stands for in the chart.

Returns:
"X", "Y" or null if not assigned to a Chart2D.

getFormatter

IAxisLabelFormatter getFormatter()
Returns the formatter for labels.

Returns:
the formatter for labels.

getHeight

int getHeight(java.awt.Graphics g2d)
Returns the height in pixel this axis needs to paint itself.

This includes the axis line, it's ticks and labels and it's title.

Note:
For an y axis the hight only includes the overhang it needs on the upper edge for painting a complete lable, not the complete space it needs for the complete line.

Parameters:
g2d - needed for font metric information.
Returns:
the height in pixel this axis needs to paint itself.

getMajorTickSpacing

double getMajorTickSpacing()
Get the major tick spacing for label generation.

Returns:
the major tick spacing for label generation.
See Also:
setMajorTickSpacing(double)

getMax

double getMax()
Returns the maximum value from all traces of this axis with respect to the installed range policy.

Returns:
the maximum value from all traces of this axis with respect to the installed range policy.

getMaxValue

double getMaxValue()
Returns the maximum value of all TracePoint2D instances in all ITrace2D instances in this axis regardless of the configured IRangePolicy (see setRangePolicy(IRangePolicy)). The returned value is either in x or y dimension - depending on the dimension this axis is working in for the chart.

Returns:
the maximum value of all TracePoint2D instances in all ITrace2D instances in this axis regardless of the configured IRangePolicy (see setRangePolicy(IRangePolicy)).

getMin

double getMin()
Returns the minimum value of all traces of this axis with respect to the installed range policy.

Returns:
the minimum value of all traces of this axis with respect to the installed range policy.

getMinorTickSpacing

double getMinorTickSpacing()
Get the minor tick spacing for label generation.

Returns:
the minor tick spacing for label generation.
See Also:
setMinorTickSpacing(double)

getMinValue

double getMinValue()
Returns the minimum value of all TracePoint2D instances in all ITrace2D instances in this axis regardless of the configured IRangePolicy (see setRangePolicy(IRangePolicy)). The returned value is either in x or y dimension - depending on the dimension this axis is working in for the chart.

Returns:
the minimum value of all TracePoint2D instances in all ITrace2D instances in this axis regardless of the configured IRangePolicy (see setRangePolicy(IRangePolicy)).

getPixelXLeft

int getPixelXLeft()
Returns the left pixel of this axis coordinate in the graphic context of the current paint operation.

Note that this value is only valid throughout a Chart2D.paint(java.awt.Graphics) invocation.

Returns:
the left pixel coordinate of this axis in the graphic context of the current paint operation.

getPixelXRight

int getPixelXRight()
Returns the right pixel coordinate of this axis in the graphic context of the current paint operation.

Note that this value is only valid throughout a Chart2D.paint(java.awt.Graphics) invocation.

Returns:
the right pixel coordinate of this axis in the graphic context of the current paint operation.

getPixelYBottom

int getPixelYBottom()
Returns the bottom pixel coordinate of this axis in the graphic context of the current paint operation.

Note that this value is only valid throughout a Chart2D.paint(java.awt.Graphics) invocation.

Returns:
the bottom pixel coordinate of this axis in the graphic context of the current paint operation.

getPixelYTop

int getPixelYTop()
Returns the top pixel coordinate of this axis in the graphic context of the current paint operation.

Note that this value is only valid throughout a Chart2D.paint(java.awt.Graphics) invocation.

Returns:
the top pixel coordinate of this axis in the graphic context of the current paint operation.

getPropertyChangeListeners

java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
Returns an array of all the listeners that were added to the this instance with addPropertyChangeListener(String, PropertyChangeListener).

Parameters:
propertyName - The name of the property being listened to.
Returns:
an array of all the listeners that were added to the this instance with addPropertyChangeListener(String, PropertyChangeListener).
See Also:
PropertyChangeSupport.getPropertyChangeListeners(java.lang.String)

getRange

Range getRange()
Returns the range lasting from getMin() to getMax().

This method is used by the Chart2D to scale it's values during painting.

Caution: This method does not necessarily return the Range configured with setRange(Range). The internal IRangePolicy is taken into account.

Returns:
the range corresponding to the upper and lower bound of the values that will be displayable on this Axis of the Chart2D.
See Also:
setRangePolicy(IRangePolicy)

getRangePolicy

IRangePolicy getRangePolicy()
Returns the range policy of this axis.

Returns:
the range policy of this axis.

getScaledValue

double getScaledValue(double absolute)
Scales the given absolute value into a value between 0 and 1.0 (if it is in the range of the data).

If the given absolute value is not in the display- range of the Chart2D, negative values or values greater than 1.0 may result.

Parameters:
absolute - a value in the real value range of the corresponding chart.
Returns:
a value between 0.0 and 1.0 that is mapped to a position within the chart.

getAxisScalePolicy

IAxisScalePolicy getAxisScalePolicy()
Returns the axis scale policy which controls the position and distance of the ticks to draw.

Returns:
the axis scale policy which controls the position and distance of the ticks to draw.

setAxisScalePolicy

IAxisScalePolicy setAxisScalePolicy(T axisScalePolicy)
Sets the axis scale policy which controls the position and distance of the ticks to draw.

Parameters:
axisScalePolicy - the axis scale policy which controls the position and distance of the ticks to draw to use.
Returns:
the previous axis scale policy that was used before.

getTitle

@Deprecated
java.lang.String getTitle()
Deprecated. use getAxisTitle() and on the result IAxis.AxisTitle.getTitle().

Returns the title or null if there was no title configured before.

Returns:
the title or null if there was no title configured before.
See Also:
getTitlePainter()

getTitlePainter

@Deprecated
IAxisTitlePainter getTitlePainter()
Deprecated. this method might be dropped because the painter should be of no concern.

Returns the instance that will paint the title of this axis.

Returns:
the instance that will paint the title of this axis.

getTraces

java.util.Set<ITrace2D> getTraces()
Returns a Set<ITrace2D> with all traces covered by this axis.

Caution!
The original internal modifiable set is returned for performance reasons and by contract (to allow removing traces) so do not mess with it to avoid ugly unpredictable side effects!

Returns:
a Set<ITrace2D> with all traces covered by this axis.

getWidth

int getWidth(java.awt.Graphics g2d)
Returns the width in pixel this axis needs to paint itself.

This includes the axis line, it's ticks and labels and it's title.

Note:
For an x axis the width only includes the overhang it needs on the right edge for painting a complete label, not the complete space it needs for the complete line.

Parameters:
g2d - needed for font metric information.
Returns:
the width in pixel this axis needs to paint itself.

hasTrace

boolean hasTrace(ITrace2D trace)
Returns true if this axis is responsible for rendering the scale of the given trace (addTrace(ITrace2D) was called on this instance with the given trace).

Parameters:
trace - the trace to check for containment.
Returns:
true if this axis is responsible for rendering the scale of the given trace (addTrace(ITrace2D) was called on this instance with the given trace).

initPaintIteration

void initPaintIteration()
Allows to perform expensive calculations for various values that are used by many calls throughout a paint iterations.

These values are constant throughout a paint iteration by the contract that no point is added removed or changed in this period. Because these values are used from many methods it is impossible to calculate them at a "transparent" method that may perform this caching over a paint period without knowledge from outside. The first method called in a paint iteration is called several further times in the iteration. So this is the common hook to invoke before painting a chart.


isDirtyScaling

boolean isDirtyScaling()
Returns true if the bounds in the given dimension of all TracePoint2D instances of all internal ITrace2D instances have changed since all points have been normalized to a value between 0 and 1 or true if this axis has different range since the last call to scale().

Returns:
true if the bounds in the given dimension of all TracePoint2D instances of all internal ITrace2D instances have changed since all points have been normalized to a value between 0 and 1 or true if this axis has different range since the last call to scale().

isPaintGrid

boolean isPaintGrid()
Returns wether the x grid is painted or not.

Returns:
wether the x grid is painted or not.

isPaintScale

boolean isPaintScale()
Returns whether the scale for this axis should be painted or not.

Returns:
whether the scale for this axis should be painted or not.

isStartMajorTick

boolean isStartMajorTick()
Check wether scale values are started from major ticks.

Returns:
true if scale values start from major ticks.
See Also:
AAxis.setMajorTickSpacing(double)

isVisible

boolean isVisible()
Check whether this axis is visible, i.e. needs to be painted on the chart

Returns:
the visibility state of this axis

paint

void paint(java.awt.Graphics g2d)
Renders the axis line along with title, scale, scale labels and unit label.

This should only be called from Chart2D, all other uses may cause damaged UI or deadlocks.

Parameters:
g2d - the graphics context to use.

paintTitle

int paintTitle(java.awt.Graphics g2d)
Routine for painting the title of this axis.

Intended for Chart2D only!!!

Parameters:
g2d - needed for painting.
Returns:
the width consumed in pixel for y axis, the height consumed in pixel for x axis.

removeAllTraces

java.util.Set<ITrace2D> removeAllTraces()
Convenience method for removing all contained ITrace2D instances of this axis.

Implementations should fire a PropertyChangeEvent for the PropertyChangeEvent.getPropertyName() PROPERTY_ADD_REMOVE_TRACE for every single trace removed. This is done best by delegating this call to several calls to removeTrace(ITrace2D).

Returns:
a shallow copy of the set of traces that were contained before.

removePropertyChangeListener

void removePropertyChangeListener(java.lang.String property,
                                  java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property. If listener was added more than once to the same event source for the specified property, it will be notified one less time after being removed. If propertyName is null, no exception is thrown and no action is taken. If listener is null, or was never added for the specified property, no exception is thrown and no action is taken.

Parameters:
property - The name of the property that was listened on.
listener - The PropertyChangeListener to be removed.
See Also:
PropertyChangeSupport.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)

removeTrace

boolean removeTrace(ITrace2D trace)
Removes the given trace from this axis.

A PropertyChangeEvent for the PropertyChangeEvent.getPropertyName() PROPERTY_ADD_REMOVE_TRACE has to be fired on the registered PropertyChangeListener for the trace removed.

Parameters:
trace - the trace to remove from this axis.
Returns:
true if the given trace could be removed from this axis, false else.

scale

void scale()
Scales all ITrace2D instances in the dimension represented by this axis.

This method is not deadlock - safe and should be called by the Chart2D only!


scaleTrace

void scaleTrace(ITrace2D trace)
Scales the given ITrace2D in the dimension represented by this axis.

This method is not deadlock - safe and should be called by the Chart2D only!

Parameters:
trace - the trace to scale.

setAxisTitle

void setAxisTitle(IAxis.AxisTitle axisTitle)
Sets the title of this axis.

Parameters:
axisTitle - the axis title to use.

setFormatter

void setFormatter(IAxisLabelFormatter formatter)
Sets the formatter to use for labels.

Parameters:
formatter - The formatter to set.

setMajorTickSpacing

void setMajorTickSpacing(double majorTickSpacing)
This method sets the major tick spacing for label generation.

Only values between 0.0 and 100.0 are allowed.

The number that is passed in represents the distance, measured in values, between each major tick mark. If you have a trace with a range from 0 to 50 and the major tick spacing is set to 10, you will get major ticks next to the following values: 0, 10, 20, 30, 40, 50.

Note:
Ticks are free of any multiples of 1000. If the chart contains values between 0 an 1000 and configured a tick of 2 the values 0, 200, 400, 600, 800 and 1000 will highly probable to be displayed. This depends on the size (in pixels) of the Chart2D<. Of course there is a difference: ticks are used in divisions and multiplications: If the internal values are very low and the ticks are very high, huge rounding errors might occur (division by ticks results in very low values a double cannot hit exactly. So prefer setting ticks between 0 an 10 or - if you know your values are very small (e.g. in nano range [10 -9 ]) use a small value (e.g. 2*10 -9 ).

Parameters:
majorTickSpacing - the major tick spacing for label generation.

setMinorTickSpacing

void setMinorTickSpacing(double minorTickSpacing)
This method sets the minor tick spacing for label generation.

The number that is passed-in represents the distance, measured in values, between each minor tick mark. If you have a trace with a range from 0 to 10 and the minor tick spacing is set to 2, you will get major ticks next to the following values: 0, 2, 4, 6, 8, 10. If a major tick hits the same values the tick will be a major ticks. For this example: if a major tick spacing is set to 5 you will only get minor ticks for: 2, 4, 6, 8.

Note:
Ticks are free of any powers of 10. There is no difference between setting a tick to 2, 200 or 20000 because ticks cannot break the rule that every scale label has to be visible. If the chart contains values between 0 an 1000 and configured a tick of 2 the values 0, 200, 400, 600, 800 and 1000 will highly probable to be displayed. This depends on the size (in pixels) of the Chart2D<. Of course there is a difference: ticks are used in divisions and multiplications: If the internal values are very low and the ticks are very high, huge rounding errors might occur (division by ticks results in very low values a double cannot hit exactly. So prefer setting ticks between 0 an 10 or - if you know your values are very small (e.g. in nano range [10 -9 ]) use a small value (e.g. 2*10 -9 ).

Parameters:
minorTickSpacing - the minor tick spacing to set.

setPaintGrid

void setPaintGrid(boolean grid)
Set wether the grid in this dimension should be painted or not.

A repaint operation for the chart is triggered.

Parameters:
grid - true if the grid should be painted or false if not.

setPaintScale

void setPaintScale(boolean show)
Set if the scale for this axis should be shown.

Parameters:
show - true if the scale on this axis should be shown, false else.

setPixelXLeft

void setPixelXLeft(int pixel)
Sets a Range to use for filtering the view to the the connected Axis. Note that it's effect will be affected by the internal IRangePolicy.

This must only be called from the Chart2D itself!

Parameters:
pixel - the left pixel coordinate of this axis in the graphic context of the current paint operation.

setPixelXRight

void setPixelXRight(int pixel)
Sets the right pixel of this axis coordinate in the graphic context of the current paint operation.

This must only be called from the Chart2D itself!

Parameters:
pixel - the right pixel coordinate of this axis in the graphic context of the current paint operation.

setPixelYBottom

void setPixelYBottom(int pixel)
Sets the bottom pixel of this axis coordinate in the graphic context of the current paint operation.

This must only be called from the Chart2D itself!

Parameters:
pixel - the bottom pixel coordinate of this axis in the graphic context of the current paint operation.

setPixelYTop

void setPixelYTop(int pixel)
Sets the top pixel of this axis coordinate in the graphic context of the current paint operation.

This must only be called from the Chart2D itself!

Parameters:
pixel - the top pixel coordinate of this axis in the graphic context of the current paint operation.

setRange

void setRange(Range range)
Sets a Range to use for filtering the view to the the connected Axis. Note that it's effect will be affected by the internal IRangePolicy.

To get full control use:
setRangePolicy(new <AnARangePolicy>(range);

Parameters:
range - Range to use for filtering the view to the the connected Axis.
See Also:
getRangePolicy(), IRangePolicy.setRange(Range)

setRangePolicy

void setRangePolicy(IRangePolicy rangePolicy)
Sets the RangePolicy.

If the given RangePolicy has an unconfigured internal Range ( Range.RANGE_UNBOUNDED) the old internal RangePolicy is taken into account:
If the old RangePolicy has a configured Range this is transferred to the new RangePolicy.

Parameters:
rangePolicy - The rangePolicy to set.

setStartMajorTick

void setStartMajorTick(boolean majorTick)
Set wether scale values are started from major ticks.

Parameters:
majorTick - true if scale values shall start with a major tick.
See Also:
AAxis.setMajorTickSpacing(double)

setTitle

@Deprecated
java.lang.String setTitle(java.lang.String title)
Deprecated. use getAxisTitle() and on the result IAxis.AxisTitle.setTitle(String)

Sets the title of this axis will be painted by the {IAxisTitlePainter} of this instance.

Parameters:
title - the title to set.
Returns:
the previous Title or null if there was no title configured before.
See Also:
setTitlePainter(IAxisTitlePainter)

setTitlePainter

@Deprecated
IAxisTitlePainter setTitlePainter(IAxisTitlePainter painter)
Deprecated. use getAxisTitle() and on the result IAxis.AxisTitle.setTitlePainter(IAxisTitlePainter).

Sets the title painter that will paint the title of this axis.

Parameters:
painter - the instance that will paint the title of this axis.
Returns:
the previous title painter of this axis or null if there was none configured before.

setVisible

void setVisible(boolean visible)
Show/hide this axis.

Parameters:
visible - true to paint axis, false to hide.

translatePxToValue

double translatePxToValue(int pixel)
Transforms the given pixel value (which has to be a awt value like MouseEvent.getY() into the chart value.

Internal use only, the interface does not guarantee that the pixel corresponds to any valid awt pixel value within the chart component.

Parameters:
pixel - a pixel value of the chart component as used by awt.
Returns:
the awt pixel value transformed to the chart value.

translateValueToPx

int translateValueToPx(double value)
Transforms the given chart data value into the corresponding awt pixel value for the chart.

Parameters:
value - a chart data value.
Returns:
the awt pixel value corresponding to the chart data value.


Copyright © 2001 - 2010 LGPL, All Rights Footloose.