java.lang.Object | ||||
↳ | org.jfree.chart.axis.Axis | |||
↳ | org.jfree.chart.axis.ValueAxis | |||
↳ | org.jfree.chart.axis.NumberAxis | |||
↳ | org.jfree.chart.axis.CyclicNumberAxis |
This class extends NumberAxis and handles cycling. Traditional representation of data in the range x0..x1
|-------------------------| x0 x1Here, the range bounds are at the axis extremities. With cyclic axis, however, the time is split in "cycles", or "time frames", or the same duration : the period. A cycle axis cannot by definition handle a larger interval than the period :
x1 - x0 >= period. Thus, at most a full period can be represented with such an axis. The cycle bound is the number between x0 and x1 which marks the beginning of new time frame:
|---------------------|----------------------------| x0 cb x1 <---previous cycle---><-------current cycle-------->It is actually a multiple of the period, plus optionally a start offset:
cb = n * period + offsetThus, by definition, two consecutive cycle bounds period apart, which is precisely why it is called a period. The visual representation of a cyclic axis is like that:
|----------------------------|---------------------| cb x1|x0 cb <-------current cycle--------><---previous cycle--->The cycle bound is at the axis ends, then current cycle is shown, then the last cycle. When using dynamic data, the visual effect is the current cycle erases the last cycle as x grows. Then, the next cycle bound is reached, and the process starts over, erasing the previous cycle. A Cyclic item renderer is provided to do exactly this.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CyclicNumberAxis.CycleBoundTick | A special Number tick that also hold information about the cycle bound mapping for this tick. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DEFAULT_ADVANCE_LINE_PAINT | The default axis line paint. | ||||||||||
DEFAULT_ADVANCE_LINE_STROKE | The default axis line stroke. | ||||||||||
advanceLinePaint | The advance line paint. | ||||||||||
advanceLineStroke | The advance line stroke. | ||||||||||
advanceLineVisible | A flag that controls whether or not the advance line is visible. | ||||||||||
boundMappedToLastCycle | ??. | ||||||||||
offset | The offset. | ||||||||||
period | The period. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a CycleNumberAxis with the given period.
| |||||||||||
Creates a CycleNumberAxis with the given period and offset.
| |||||||||||
Creates a named CycleNumberAxis with the given period.
| |||||||||||
Creates a named CycleNumberAxis with the given period and offset.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Centers the range about the given value.
| |||||||||||
Draws the axis.
| |||||||||||
Tests the axis for equality with another object.
| |||||||||||
The advance line is the line drawn at the limit of the current cycle,
when erasing the previous cycle.
| |||||||||||
The advance line is the line drawn at the limit of the current cycle,
when erasing the previous cycle.
| |||||||||||
The cycle bound is defined as the higest value x such that
"offset + period * i = x", with i and integer and x <
range.getUpperBound() This is the value which is at both ends of the
axis : x...up|low...x
The values from x to up are the valued in the current cycle.
| |||||||||||
The cycle bound is a multiple of the period, plus optionally a start
offset.
| |||||||||||
The cycle bound is a multiple of the period, plus optionally a start
offset.
| |||||||||||
The advance line is the line drawn at the limit of the current cycle,
when erasing the previous cycle.
| |||||||||||
The cycle bound can be associated either with the current or with the
last cycle.
| |||||||||||
Converts a coordinate from Java 2D space to data space.
| |||||||||||
Reserve some space on each axis side because we draw a centered label at
each extremity.
| |||||||||||
The advance line is the line drawn at the limit of the current cycle,
when erasing the previous cycle.
| |||||||||||
The advance line is the line drawn at the limit of the current cycle,
when erasing the previous cycle.
| |||||||||||
The advance line is the line drawn at the limit of the current cycle,
when erasing the previous cycle.
| |||||||||||
This function is nearly useless since the auto range is fixed for this
class to the period.
| |||||||||||
The cycle bound can be associated either with the current or with the
last cycle.
| |||||||||||
The auto range is fixed for this class to the period by default.
| |||||||||||
The cycle bound is a multiple of the period, plus optionally a start
offset.
| |||||||||||
The cycle bound is a multiple of the period, plus optionally a start
offset.
| |||||||||||
Sets a new axis range.
| |||||||||||
Translates a value from data space to Java 2D space.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Calculates the anchor point for a tick.
| |||||||||||
Draws the tick marks and labels.
| |||||||||||
Builds a list of ticks for the axis.
| |||||||||||
Builds a list of ticks for the axis.
| |||||||||||
Selects a tick unit when the axis is displayed horizontally.
| |||||||||||
Selects a tick unit when the axis is displayed vertically.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
A flag that controls whether or not the advance line is visible.
??.
The offset.
The period.
Creates a CycleNumberAxis with the given period.
period | the period. |
---|
Creates a CycleNumberAxis with the given period and offset.
period | the period. |
---|---|
offset | the offset. |
Creates a named CycleNumberAxis with the given period.
period | the period. |
---|---|
label | the label. |
Creates a named CycleNumberAxis with the given period and offset.
period | the period. |
---|---|
offset | the offset. |
label | the label. |
Centers the range about the given value.
value | the data value. |
---|
Draws the axis.
g2 | the graphics device (null not permitted). |
---|---|
cursor | the cursor position. |
plotArea | the plot area (null not permitted). |
dataArea | the data area (null not permitted). |
edge | the edge (null not permitted). |
plotState | collects information about the plot
(null permitted). |
null
).
Tests the axis for equality with another object.
obj | the object to test against. |
---|
The advance line is the line drawn at the limit of the current cycle, when erasing the previous cycle.
null
).
The advance line is the line drawn at the limit of the current cycle, when erasing the previous cycle.
null
).
The cycle bound is defined as the higest value x such that "offset + period * i = x", with i and integer and x < range.getUpperBound() This is the value which is at both ends of the axis : x...up|low...x The values from x to up are the valued in the current cycle. The values from low to x are the valued in the previous cycle.
The cycle bound is a multiple of the period, plus optionally a start offset.
cb = n * period + offset
The cycle bound is a multiple of the period, plus optionally a start offset.
cb = n * period + offset
The advance line is the line drawn at the limit of the current cycle, when erasing the previous cycle.
The cycle bound can be associated either with the current or with the
last cycle. It's up to the user's choice to decide which, as this is
just a convention. By default, the cycle bound is mapped to the current
cycle.
Note that this has no effect on visual appearance, as the cycle bound is
mapped successively for both axis ends. Use this function for correct
results in translateValueToJava2D.
true
if the cycle bound is mapped to the last
cycle, false
if it is bound to the current cycle
(default)
Converts a coordinate from Java 2D space to data space.
java2DValue | the coordinate in Java2D space. |
---|---|
dataArea | the data area. |
edge | the edge. |
Reserve some space on each axis side because we draw a centered label at each extremity.
g2 | the graphics device. |
---|---|
plot | the plot. |
plotArea | the plot area. |
edge | the edge. |
space | the space already reserved. |
The advance line is the line drawn at the limit of the current cycle, when erasing the previous cycle.
paint | the paint (null not permitted).
|
---|
The advance line is the line drawn at the limit of the current cycle, when erasing the previous cycle.
stroke | the stroke (null not permitted).
|
---|
The advance line is the line drawn at the limit of the current cycle, when erasing the previous cycle.
visible | the flag. |
---|
This function is nearly useless since the auto range is fixed for this class to the period. The period is extended if necessary to fit the minimum size.
size | the size. |
---|---|
notify | notify? |
The cycle bound can be associated either with the current or with the
last cycle. It's up to the user's choice to decide which, as this is
just a convention. By default, the cycle bound is mapped to the current
cycle.
Note that this has no effect on visual appearance, as the cycle bound is
mapped successively for both axis ends. Use this function for correct
results in valueToJava2D.
boundMappedToLastCycle | Set it to true to map the cycle bound to the last cycle. |
---|
The auto range is fixed for this class to the period by default. This function will thus set a new period.
length | the length. |
---|
The cycle bound is a multiple of the period, plus optionally a start offset.
cb = n * period + offset
offset | The offset to set. |
---|
The cycle bound is a multiple of the period, plus optionally a start offset.
cb = n * period + offset
period | The period to set. |
---|
Sets a new axis range. The period is extended to fit the range size, if necessary.
range | the range. |
---|---|
turnOffAutoRange | switch off the auto range. |
notify | notify? |
Translates a value from data space to Java 2D space.
value | the data value. |
---|---|
dataArea | the data area. |
edge | the edge. |
Calculates the anchor point for a tick.
tick | the tick. |
---|---|
cursor | the cursor. |
dataArea | the data area. |
edge | the side on which the axis is displayed. |
Draws the tick marks and labels.
g2 | the graphics device. |
---|---|
cursor | the cursor. |
plotArea | the plot area. |
dataArea | the area inside the axes. |
edge | the side on which the axis is displayed. |
Builds a list of ticks for the axis. This method is called when the axis is at the top or bottom of the chart (so the axis is "horizontal").
g2 | the graphics device. |
---|---|
dataArea | the data area. |
edge | the edge. |
Builds a list of ticks for the axis. This method is called when the axis is at the left or right of the chart (so the axis is "vertical").
g2 | the graphics device. |
---|---|
dataArea | the data area. |
edge | the edge. |
Selects a tick unit when the axis is displayed horizontally.
g2 | the graphics device. |
---|---|
drawArea | the drawing area. |
dataArea | the data area. |
edge | the side of the rectangle on which the axis is displayed. |
Selects a tick unit when the axis is displayed vertically.
g2 | the graphics device. |
---|---|
drawArea | the drawing area. |
dataArea | the data area. |
edge | the side of the rectangle on which the axis is displayed. |