|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ijchart.xychart.axis.AbstractAxis
com.ijchart.xychart.axis.value.AbstractValueAxis
public abstract class AbstractValueAxis
Title: IJChart
Description: a chart library for the Java(tm) platform.
An axis that displays values (Y-Axis).Copyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
static boolean |
DEFAULT_AXIS_TICK_INCLUDE_ZERO
The default value for the axisRangeIncludeZero flag. |
static java.awt.Paint |
DEFAULT_CROSSHAIR_PAINT
The default crosshair line paint. |
static java.awt.Stroke |
DEFAULT_CROSSHAIR_STROKE
The default value line stroke. |
static java.awt.Paint |
DEFAULT_GRID_BAND_ALTERNATE_PAINT
The default paint for alternate grid bands. |
static java.awt.Paint |
DEFAULT_GRID_BAND_PAINT
The default grid band paint. |
static boolean |
DEFAULT_GRID_BAND_VISIBLE
The default flag that indicates whether or not grid bands are visible. |
static boolean |
DEFAULT_INVERTED
The default inverted flag setting. |
static boolean |
DEFAULT_VALUE_LINE_VISIBLE
The default crosshair visibility. |
static java.awt.Paint |
DEFAULT_VALUE_PAINT
The default value line paint. |
static double |
INVALID_COORDINATE_VALUE
If the value not between the minimum and maximum of axis tick mark,this axis in the coordinates did not correspond to a point. |
Constructor Summary | |
---|---|
protected |
AbstractValueAxis(IMatrixDataset dataset)
Constructs an axis using a dataset. |
protected |
AbstractValueAxis(java.lang.String label,
IMatrixDataset dataset)
Constructs an axis using label and a dataset. |
Method Summary | |
---|---|
void |
addIntervalValueMarker(Layer layer,
IntervalValueMarker marker)
Adds a interval value marker for display by a particular render. |
void |
addValueMarker(Layer layer,
ValueMarker marker)
Adds a value marker for display by a particular render. |
void |
clearIntervalValueMarkers(Layer layer)
Clears all the interval value markers for the plot and sends an AxisChangeEvent to all registered listeners. |
void |
clearValueMarkers(Layer layer)
Clears all the value markers for the plot and sends an AxisChangeEvent to all registered listeners. |
java.lang.Object |
clone()
Returns a clone of the object. |
abstract void |
drawValueLine(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
RectangleEdge edge,
RenderShapeCollection shapeCollection)
Draw the value line,only call after IAxis.draw(). |
boolean |
equals(java.lang.Object obj)
Tests the axis for equality with an arbitrary object. |
abstract NumberRange |
getDatasetRange()
Returns the value range of a dataset. |
NumberRange |
getEmptyDatasetRange()
Returns the default range is used when the dataset is empty and the axis needs to determine the auto range. |
java.awt.Paint |
getGridBandAlternatePaint()
Returns the paint used to fill the alternate grid bands. |
java.awt.Paint |
getGridBandPaint()
Returns the paint used to color the grid bands. |
java.util.Collection |
getIntervalValueMarkers(Layer layer)
Returns a collection of interval value markers for specified layer. |
IRenderWithAxis |
getRender()
Returns the render object. |
IFormatter |
getTickValueFormatter()
Returns the tick value formatter. |
java.awt.Paint |
getValueLinePaint()
Returns the paint used to draw the value line. |
java.awt.Stroke |
getValueLineStroke()
Returns the pen-style (Stroke) used to draw the value line (if visible). |
double |
getValueLineValue()
Returns the value line value. |
java.util.Collection |
getValueMarkers(Layer layer)
Returns a collection of value markers for specified layer. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isAxisRangeIncludeZero()
Returns the flag whether or not include zero when calculate the axis data range. |
boolean |
isGridBandVisible()
Returns the flag that indicates whether or not grid bands are visible. |
boolean |
isInverted()
Returns a flag that controls the direction of values on the axis. |
boolean |
isValueLineVisible()
Returns the flag that controls whether or not a value line is drawn. |
void |
markerChanged(MarkerChangeEvent event)
Receives notification of an marker change event. |
boolean |
removeValueMarker(Layer layer,
IntervalValueMarker marker)
Removes a interval marker for a specific layer and sends an AxisChangeEvent to all registered listeners. |
boolean |
removeValueMarker(Layer layer,
ValueMarker marker)
Removes a marker for a specific layer and sends an AxisChangeEvent to all registered listeners. |
void |
setAxisRangeIncludeZero(boolean flag)
Sets the flag whether or not include zero when calculate the axis ticks,and notifies registered listeners that the axis has changed. |
void |
setEmptyDatasetRange(NumberRange range)
Sets the default range is used when the dataset is empty and the axis needs to determine the auto range,and notifies registered listeners that the axis has changed. |
void |
setGridBandAlternatePaint(java.awt.Paint paint)
Sets the paint used to fill the alternate grid bands and notifies registered listeners that the axis has changed. |
void |
setGridBandPaint(java.awt.Paint paint)
Sets the paint used to color the grid bands and notifies registered listeners that the axis has changed. |
void |
setGridBandVisible(boolean visible)
Sets the flag that indicates whether or not grid bands are visible and notifies registered listeners that the axis has changed. |
void |
setInverted(boolean flag)
Sets a flag that controls the direction of values on the axis,and notifies registered listeners that the axis has changed. |
void |
setRender(IRenderWithAxis render)
The render object. |
void |
setTickValueFormatter(IFormatter tickValueFormatter)
Sets the tick value formatter,and notifies registered listeners that the axis has changed. |
void |
setValueLinePaint(java.awt.Paint paint)
Sets the paint used to draw the value line (if visible) and sends an AxisChangeEvent to all registered listeners. |
void |
setValueLineStroke(java.awt.Stroke stroke)
Sets the pen-style (Stroke) used to draw the value crosshair (if visible), and sends an AxisChangeEvent to all registered listeners. |
void |
setValueLineValue(double value)
Sets the value line value and, if requested, sends an AxisChangeEvent to
all registered listeners (but only if the value line is visible). |
void |
setValueLineVisible(boolean flag)
Sets the flag indicating whether or not the value line is visible,and notifies registered listeners that the axis has changed. |
java.lang.String |
toString()
Returns a string representation of the object. |
abstract double |
valueToJava2D(java.awt.geom.Rectangle2D dataArea,
RectangleEdge edge,
double value,
boolean forceInDataArea)
Converts a data value to a coordinate in Java2D space, assuming that the axis runs along one edge of the specified dataArea. |
abstract double |
valueToJava2D(java.awt.geom.Rectangle2D dataArea,
RectangleEdge edge,
double value,
boolean forceInDataArea,
boolean expandAxisRange)
Converts a data value to a coordinate in Java2D space, assuming that the axis runs along one edge of the specified dataArea. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean DEFAULT_AXIS_TICK_INCLUDE_ZERO
public static final boolean DEFAULT_INVERTED
public static final boolean DEFAULT_VALUE_LINE_VISIBLE
public static final java.awt.Stroke DEFAULT_CROSSHAIR_STROKE
public static final java.awt.Paint DEFAULT_CROSSHAIR_PAINT
public static final java.awt.Paint DEFAULT_VALUE_PAINT
public static final double INVALID_COORDINATE_VALUE
public static final java.awt.Paint DEFAULT_GRID_BAND_PAINT
public static final java.awt.Paint DEFAULT_GRID_BAND_ALTERNATE_PAINT
public static final boolean DEFAULT_GRID_BAND_VISIBLE
Constructor Detail |
---|
protected AbstractValueAxis(IMatrixDataset dataset)
dataset
- IMatrixDataset
The two dimension matrix dataset (null not permitted).protected AbstractValueAxis(java.lang.String label, IMatrixDataset dataset)
label
-
The axis label (null permitted).dataset
- IMatrixDataset
The two dimension matrix dataset (null not permitted).Method Detail |
---|
public boolean isAxisRangeIncludeZero()
public void setAxisRangeIncludeZero(boolean flag)
flag
- boolean
The new value of the flag.public boolean isInverted()
For a regular axis, values increase from left to right (for a horizontal axis) and bottom to top (for a vertical axis). When the axis is 'inverted', the values increase in the opposite direction.
public void setInverted(boolean flag)
flag
- boolean
The flag.public NumberRange getEmptyDatasetRange()
public void setEmptyDatasetRange(NumberRange range)
range
- NumberRange
(null not permitted).public IFormatter getTickValueFormatter()
public void setTickValueFormatter(IFormatter tickValueFormatter)
tickValueFormatter
- IFormatter
The tick value formatter.public boolean isValueLineVisible()
public void setValueLineVisible(boolean flag)
flag
- boolean
The new value of the flag.public double getValueLineValue()
public void setValueLineValue(double value)
AxisChangeEvent
to
all registered listeners (but only if the value line is visible).
value
- double
The new value.public java.awt.Stroke getValueLineStroke()
public void setValueLineStroke(java.awt.Stroke stroke)
AxisChangeEvent
to all registered listeners.
stroke
- Stroke
The new value line stroke (null not permitted).public java.awt.Paint getValueLinePaint()
public void setValueLinePaint(java.awt.Paint paint)
AxisChangeEvent
to all registered listeners.
paint
- Paint
The paint (null not permitted).public boolean isGridBandVisible()
public void setGridBandVisible(boolean visible)
visible
- boolean
The boolean.public java.awt.Paint getGridBandPaint()
public void setGridBandPaint(java.awt.Paint paint)
paint
- Paint
The paint (null not permitted).public java.awt.Paint getGridBandAlternatePaint()
public void setGridBandAlternatePaint(java.awt.Paint paint)
paint
- Paint
The paint (null not permitted).public IRenderWithAxis getRender()
public void setRender(IRenderWithAxis render)
render
- IRenderWithAxis
The render object (null permitted).public abstract void drawValueLine(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, RectangleEdge edge, RenderShapeCollection shapeCollection)
g2
- Graphics2D
The graphics device (null not permitted).dataArea
- Rectangle2D
The area within which the data should be drawn (null not permitted).edge
- RectangleEdge
The axis position (null not permitted).shapeCollection
- RenderShapeCollection
Collects information about the render (null not permitted).public abstract double valueToJava2D(java.awt.geom.Rectangle2D dataArea, RectangleEdge edge, double value, boolean forceInDataArea)
dataArea
- Rectangle2D
The area within which the data should be drawn (null not permitted).edge
- RectangleEdge
The axis position (null not permitted).value
- double
The data value.forceInDataArea
- boolean
Whether or not the return value force in the region dataArea.
public abstract double valueToJava2D(java.awt.geom.Rectangle2D dataArea, RectangleEdge edge, double value, boolean forceInDataArea, boolean expandAxisRange)
dataArea
- Rectangle2D
The area within which the data should be drawn (null not permitted).edge
- RectangleEdge
The axis position (null not permitted).value
- double
The data value.forceInDataArea
- boolean
Whether or not the return value force in the region dataArea.expandAxisRange
- boolean
Whether or not expand the range of axis.
public abstract NumberRange getDatasetRange()
public void addValueMarker(Layer layer, ValueMarker marker)
layer
- Layer
The layer (foreground or background) (null not permitted).marker
- ValueMarker
The marker (null not permitted).public java.util.Collection getValueMarkers(Layer layer)
layer
-
The layer (null not permitted).
public boolean removeValueMarker(Layer layer, ValueMarker marker)
AxisChangeEvent
to all registered listeners.
layer
- Layer
The layer (foreground or background) (null not permitted).marker
- ValueMarker
The marker (null not permitted).
public void clearValueMarkers(Layer layer)
AxisChangeEvent
to all registered listeners.
layer
- Layer
The layer (foreground or background) (null not permitted).public void addIntervalValueMarker(Layer layer, IntervalValueMarker marker)
layer
- Layer
The layer (foreground or background) (null not permitted).marker
- IntervalValueMarker
The marker (null not permitted).public java.util.Collection getIntervalValueMarkers(Layer layer)
layer
-
The layer (null not permitted).
public boolean removeValueMarker(Layer layer, IntervalValueMarker marker)
AxisChangeEvent
to all registered listeners.
layer
- Layer
The layer (foreground or background) (null not permitted).marker
- IntervalValueMarker
The marker (null not permitted).
public void clearIntervalValueMarkers(Layer layer)
AxisChangeEvent
to all registered listeners.
layer
- Layer
The layer (foreground or background) (null not permitted).public void markerChanged(MarkerChangeEvent event)
markerChanged
in interface IMarkerChangeListener
event
-
The marker change event.public boolean equals(java.lang.Object obj)
equals
in class AbstractAxis
obj
- the object (null permitted).
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractAxis
java.lang.CloneNotSupportedException
- if some component of the axis does
not support cloning.public int hashCode()
hashCode
in class AbstractAxis
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |