|
|||||||||
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
com.ijchart.xychart.axis.value.NumberValueAxis
public class NumberValueAxis
Title: IJChart
Description: a chart library for the Java(tm) platform.
The class for axes that display value data, where values are measured using the double primitive.Copyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
static INumberTickUnit |
DEFAULT_NUMBER_TICK_UNIT
The default INumberTickUnit for generate axis tick units. |
protected java.lang.String[] |
numberTicks
The number ticks. |
protected java.lang.String[] |
tickLabels
The formated tick labels. |
protected INumberTickUnit |
tickUnit
The INumberTickUnit for generate axis tick units. |
protected double[] |
valueTicks
The number ticks. |
Fields inherited from class com.ijchart.xychart.axis.value.AbstractValueAxis |
---|
DEFAULT_AXIS_TICK_INCLUDE_ZERO, DEFAULT_CROSSHAIR_PAINT, DEFAULT_CROSSHAIR_STROKE, DEFAULT_GRID_BAND_ALTERNATE_PAINT, DEFAULT_GRID_BAND_PAINT, DEFAULT_GRID_BAND_VISIBLE, DEFAULT_INVERTED, DEFAULT_VALUE_LINE_VISIBLE, DEFAULT_VALUE_PAINT, INVALID_COORDINATE_VALUE |
Constructor Summary | |
---|---|
NumberValueAxis(IMatrixDataset dataset)
Constructs an axis using a dataset. |
|
NumberValueAxis(java.lang.String label,
IMatrixDataset dataset)
Constructs an axis using label and a dataset. |
Method Summary | |
---|---|
protected void |
calculateLabels(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D axisArea,
RectangleEdge edge)
Calculate the |
java.lang.Object |
clone()
Creates a clone of the axis. |
protected double |
convertNumberTick(java.lang.String tick)
Convert String tick to number. |
protected IChartShape |
createChartShape(java.awt.geom.Rectangle2D tickLabelDrawRect,
java.lang.String tickLabel)
Create a RectangleTextChartShape object. |
protected IChartShape |
createValueLineShape(double x1,
double y1,
double x2,
double y2)
Create a value line shape. |
void |
drawGridLine(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
RectangleEdge axisEdge,
RenderShapeCollection shapeCollection,
java.awt.Stroke stroke,
java.awt.Paint paint)
Draw the grid line,only call after IAxis.draw(). |
protected double |
drawTickLabel(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D axisArea,
RectangleEdge edge,
AxisShapeCollection shapeCollection,
double cursor)
Draws tick mark labels in a specified area and edge. |
protected double |
drawTickLabelReally(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D axisArea,
RectangleEdge edge,
AxisShapeCollection shapeCollection,
double cursor,
java.lang.String[] labels)
The really method for draw tick labels. |
protected double |
drawTickMark(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D axisArea,
RectangleEdge edge,
AxisShapeCollection shapeCollection,
double cursor)
Draws tick marks in a specified area and edge. |
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 this axis for equality with an arbitrary object. |
double |
estimateAxisWidth(RectangleEdge edge,
java.lang.String maxLengthLabel)
Calculate the width of axis. |
NumberRange |
getDatasetRange()
Returns the value range of a dataset. |
protected java.lang.String[] |
getFormatedTickLabels(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D maxAxisArea,
RectangleEdge edge)
Returns the formated tick labels. |
protected double |
getLabelMaxDrawWidth(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
RectangleEdge edge,
java.lang.String[] formatedLabels)
Calculation width of painting coordinate axis labels required by the maximum width and not more than maximumCategoryLabelWidthRatio determined by the parameters of the entire region of the chart width or height |
protected java.lang.String[] |
getNumberLabels(int labelCount)
Calculate the number labels. |
java.lang.String[] |
getNumberTicks()
Return the number ticks. |
protected java.lang.String[] |
getTickLabels(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D axisArea,
RectangleEdge edge)
Returns the tick mark labels. |
protected int |
getTickMarkCount()
Returns the tick mark count. |
NumberRange |
getTickRange()
Returns the value range of a dataset. |
INumberTickUnit |
getTickUnit()
Returns the INumberTickUnit for generate axis tick units. |
java.util.TimeZone |
getTimeZone()
Returns the time zone. |
NumberRange |
getUserDefineDatasetRange()
Returns the dataset range of user defined. |
NumberRange |
getZoomDatasetRange()
Returns the dataset range for zoom chart. |
int |
hashCode()
Returns a hash code for this object. |
protected boolean |
isLogTickUnit()
Whether or not tickUnit is LogTickUnit. |
protected boolean |
isOffsetValueLine()
Returns whether or not offset axis. |
protected boolean |
isRangeIncludeZero()
Returns whether or not include zero of the dataset. |
void |
setTickUnit(INumberTickUnit tickUnit)
The INumberTickUnit for generate axis tick units and notifies registered listeners
that the axis has changed. |
void |
setTimeZone(java.util.TimeZone timeZone)
Sets the time zone and sends a AxisChangeEvent to all registered listeners. |
void |
setUserDefineDatasetRange(double lower,
double upper)
Sets the dataset range of user defined and notifies registered listeners that the axis has changed. |
void |
setUserDefineDatasetRange(NumberRange range)
Sets the dataset range of user defined and notifies registered listeners that the axis has changed. |
void |
setZoomDatasetRange(NumberRange datasetRange)
Sets the dataset range for zoom chart and sends a RenderChangeEvent to all registered listeners. |
java.lang.String |
toString()
Returns a string representation of the object. |
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. |
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 INumberTickUnit DEFAULT_NUMBER_TICK_UNIT
INumberTickUnit
for generate axis tick units.
protected INumberTickUnit tickUnit
INumberTickUnit
for generate axis tick units.
protected java.lang.String[] tickLabels
protected java.lang.String[] numberTicks
protected double[] valueTicks
Constructor Detail |
---|
public NumberValueAxis(IMatrixDataset dataset)
dataset
- IMatrixDataset
The two dimension matrix dataset (null not permitted).public NumberValueAxis(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 INumberTickUnit getTickUnit()
INumberTickUnit
for generate axis tick units.
INumberTickUnit
for generate axis tick units.public void setTickUnit(INumberTickUnit tickUnit)
INumberTickUnit
for generate axis tick units and notifies registered listeners
that the axis has changed.
tickUnit
- INumberTickUnit
The INumberTickUnit
for generate axis tick units (null not permitted).public java.util.TimeZone getTimeZone()
public void setTimeZone(java.util.TimeZone timeZone)
AxisChangeEvent
to all registered listeners.
timeZone
- TimeZone
The time zone.public java.lang.String[] getNumberTicks()
public NumberRange getUserDefineDatasetRange()
public void setUserDefineDatasetRange(double lower, double upper)
lower
- double
The lower bound of the range.upper
- double
The upper bound of the range.public void setUserDefineDatasetRange(NumberRange range)
range
- NumberRange
The dataset range (null permitted).public NumberRange getZoomDatasetRange()
public void setZoomDatasetRange(NumberRange datasetRange)
RenderChangeEvent
to all registered listeners.
datasetRange
- NumberRange
The dataset range for zoom chart.public double estimateAxisWidth(RectangleEdge edge, java.lang.String maxLengthLabel)
edge
- RectangleEdge
The axis position.maxLengthLabel
- String
The maximum length tick label.
protected double drawTickMark(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D axisArea, RectangleEdge edge, AxisShapeCollection shapeCollection, double cursor)
drawTickMark
in class AbstractAxis
g2
- Graphics2D
The graphics device (null not permitted).axisArea
- Rectangle2D
The axis draw area.edge
- RectangleEdge
The axis position.shapeCollection
- AxisShapeCollection
Collects information about the axis (null permitted).cursor
-
The cursor location.
protected int getTickMarkCount()
protected double drawTickLabel(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Rectangle2D axisArea, RectangleEdge edge, AxisShapeCollection shapeCollection, double cursor)
drawTickLabel
in class AbstractAxis
g2
- Graphics2D
The graphics device (null not permitted).plotArea
- Rectangle2D
The area within which the plot should be drawn.axisArea
- Rectangle2D
The axis draw area.edge
- RectangleEdge
The axis position.shapeCollection
- AxisShapeCollection
Collects information about the axis (null permitted).cursor
-
The cursor location.
protected double drawTickLabelReally(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Rectangle2D axisArea, RectangleEdge edge, AxisShapeCollection shapeCollection, double cursor, java.lang.String[] labels)
g2
- Graphics2D
The graphics device (null not permitted).plotArea
- Rectangle2D
The area within which the plot should be drawn.axisArea
- Rectangle2D
The axis draw area.edge
- RectangleEdge
The axis position.shapeCollection
- AxisShapeCollection
Collects information about the axis (null permitted).cursor
-
The cursor location.labels
- String[]
The labels array.
protected java.lang.String[] getTickLabels(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D axisArea, RectangleEdge edge)
g2
- Graphics2D
The graphics device (null not permitted).axisArea
- Rectangle2D
The axis draw area (null not permitted).edge
- RectangleEdge
The axis position (null not permitted).
public void drawValueLine(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, RectangleEdge edge, RenderShapeCollection shapeCollection)
drawValueLine
in class AbstractValueAxis
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).protected IChartShape createValueLineShape(double x1, double y1, double x2, double y2)
x1
- double
The first point's x coordinate.y1
- double
The first point's y coordinate.x2
- double
The second point's x coordinate.y2
- double
The second point's y coordinate.
protected double getLabelMaxDrawWidth(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, RectangleEdge edge, java.lang.String[] formatedLabels)
g2
- Graphics2D
The graphics device (null not permitted).plotArea
- Rectangle2D
The area within which the plot should be drawn.edge
- RectangleEdge
The axis position.formatedLabels
- String[]
The formatted tick label values.
protected java.lang.String[] getFormatedTickLabels(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D maxAxisArea, RectangleEdge edge)
getFormatedTickLabels
in class AbstractAxis
g2
- Graphics2D
The graphics device (null not permitted).maxAxisArea
- Rectangle2D
The maximum area within which the axis should be drawn (null not permitted).edge
- RectangleEdge
The axis position (null not permitted).
protected void calculateLabels(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D axisArea, RectangleEdge edge)
g2
- Graphics2DaxisArea
- Rectangle2Dedge
- RectangleEdgeprotected java.lang.String[] getNumberLabels(int labelCount)
labelCount
- int
The number of labels
public NumberRange getDatasetRange()
getDatasetRange
in class AbstractValueAxis
public NumberRange getTickRange()
protected IChartShape createChartShape(java.awt.geom.Rectangle2D tickLabelDrawRect, java.lang.String tickLabel)
tickLabelDrawRect
- Rectangle2D
The tick label bound.tickLabel
- String
The tick label.
IChartShape
.public void drawGridLine(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, RectangleEdge axisEdge, RenderShapeCollection shapeCollection, java.awt.Stroke stroke, java.awt.Paint paint)
drawGridLine
in class AbstractAxis
g2
- Graphics2D
The graphics device (null not permitted).dataArea
- Rectangle2D
The area within which the data should be drawn (null not permitted).axisEdge
- RectangleEdge
The axis position (null not permitted).shapeCollection
- RenderShapeCollection
Collects information about the render (null not permitted).stroke
- Stroke
The grid line stroke.paint
- Paint
The grid line paint (null not permitted).public double valueToJava2D(java.awt.geom.Rectangle2D dataArea, RectangleEdge edge, double value, boolean forceInDataArea)
valueToJava2D
in class AbstractValueAxis
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 double valueToJava2D(java.awt.geom.Rectangle2D dataArea, RectangleEdge edge, double value, boolean forceInDataArea, boolean expandAxisRange)
valueToJava2D
in class AbstractValueAxis
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.
protected boolean isRangeIncludeZero()
protected boolean isOffsetValueLine()
protected boolean isLogTickUnit()
protected double convertNumberTick(java.lang.String tick)
tick
- String
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractValueAxis
java.lang.CloneNotSupportedException
- if some component of the axis does
not support cloning.public boolean equals(java.lang.Object obj)
equals
in class AbstractValueAxis
obj
-
The object (null permitted).
public int hashCode()
hashCode
in class AbstractValueAxis
public java.lang.String toString()
toString
in class AbstractValueAxis
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |