| org.jfree.chart.axis.ValueAxis org.jfree.experimental.chart.axis.LogAxis
LogAxis | public class LogAxis extends ValueAxis (Code) | | A numerical axis that uses a logarithmic scale. The plan is for this class
to replace the
LogarithmicAxis class.
WARNING: THIS CLASS IS NOT PART OF THE STANDARD JFREECHART API AND IS
SUBJECT TO ALTERATION OR REMOVAL. DO NOT RELY ON THIS CLASS FOR
PRODUCTION USE. Please experiment with this code and provide feedback.
|
Constructor Summary | |
public | LogAxis() Creates a new LogAxis with no label. | public | LogAxis(String label) Creates a new LogAxis with the given label. |
Method Summary | |
protected void | autoAdjustRange() Adjusts the axis range to match the data range that the axis is
required to display. | public double | calculateLog(double value) Calculates the log of the given value, using the current base.
Parameters: value - the value. | public double | calculateValue(double log) Calculates the value from a given log.
Parameters: log - the log value (must be > 0.0). | public void | configure() Configures the axis. | public AxisState | draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, PlotRenderingInfo plotState) Draws the axis on a Java 2D graphics device (such as the screen or a
printer).
Parameters: g2 - the graphics device (null not permitted). Parameters: cursor - the cursor location (determines where to draw the axis). Parameters: plotArea - the area within which the axes and plot should be drawn. Parameters: dataArea - the area within which the data should be drawn. Parameters: edge - the axis location (null not permitted). Parameters: plotState - collects information about the plot (null permitted). | public double | getBase() Returns the base for the logarithm calculation. | public int | getMinorTickCount() Returns the number of minor tick marks to display. | public NumberFormat | getNumberFormatOverride() Returns the number format override. | public double | getSmallestValue() Returns the smallest value represented by the axis. | public NumberTickUnit | getTickUnit() Returns the current tick unit. | public double | java2DToValue(double java2DValue, Rectangle2D area, RectangleEdge edge) Converts a Java2D coordinate to an axis value, assuming that the
axis covers the specified edge of the area .
Parameters: java2DValue - the Java2D coordinate. Parameters: area - the area. Parameters: edge - the edge that the axis belongs to. | public List | refreshTicks(Graphics2D g2, AxisState state, Rectangle2D dataArea, RectangleEdge edge) Calculates the positions of the tick labels for the axis, storing the
results in the tick label list (ready for drawing).
Parameters: g2 - the graphics device. Parameters: state - the axis state. Parameters: dataArea - the area in which the plot should be drawn. Parameters: edge - the location of the axis. | protected List | refreshTicksHorizontal(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge) Returns a list of ticks for an axis at the top or bottom of the chart.
Parameters: g2 - the graphics device. Parameters: dataArea - the data area. Parameters: edge - the edge. | protected List | refreshTicksVertical(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge) Returns a list of ticks for an axis at the left or right of the chart.
Parameters: g2 - the graphics device. Parameters: dataArea - the data area. Parameters: edge - the edge. | public void | setBase(double base) Sets the base for the logarithm calculation and sends an
AxisChangeEvent to all registered listeners. | public void | setMinorTickCount(int count) Sets the number of minor tick marks to display. | public void | setNumberFormatOverride(NumberFormat formatter) Sets the number format override. | public void | setSmallestValue(double value) Sets the smallest value represented by the axis. | public void | setTickUnit(NumberTickUnit unit) Sets the tick unit for the axis and sends an
AxisChangeEvent to
all registered listeners. | public void | setTickUnit(NumberTickUnit unit, boolean notify, boolean turnOffAutoSelect) Sets the tick unit for the axis and, if requested, sends an
AxisChangeEvent to all registered listeners. | public double | valueToJava2D(double value, Rectangle2D area, RectangleEdge edge) Converts a value on the axis scale to a Java2D coordinate relative to
the given area , based on the axis running along the
specified edge .
Parameters: value - the data value. Parameters: area - the area. Parameters: edge - the edge. |
LogAxis | public LogAxis()(Code) | | Creates a new LogAxis with no label.
|
LogAxis | public LogAxis(String label)(Code) | | Creates a new LogAxis with the given label.
Parameters: label - the axis label (null permitted). |
autoAdjustRange | protected void autoAdjustRange()(Code) | | Adjusts the axis range to match the data range that the axis is
required to display.
|
calculateLog | public double calculateLog(double value)(Code) | | Calculates the log of the given value, using the current base.
Parameters: value - the value. The log of the given value. See Also: LogAxis.getBase() |
calculateValue | public double calculateValue(double log)(Code) | | Calculates the value from a given log.
Parameters: log - the log value (must be > 0.0). The value with the given log. |
configure | public void configure()(Code) | | Configures the axis. This method is typically called when an axis
is assigned to a new plot.
|
draw | public AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, PlotRenderingInfo plotState)(Code) | | Draws the axis on a Java 2D graphics device (such as the screen or a
printer).
Parameters: g2 - the graphics device (null not permitted). Parameters: cursor - the cursor location (determines where to draw the axis). Parameters: plotArea - the area within which the axes and plot should be drawn. Parameters: dataArea - the area within which the data should be drawn. Parameters: edge - the axis location (null not permitted). Parameters: plotState - collects information about the plot (null permitted). The axis state (never null ). |
getBase | public double getBase()(Code) | | Returns the base for the logarithm calculation.
The base for the logarithm calculation. |
getMinorTickCount | public int getMinorTickCount()(Code) | | Returns the number of minor tick marks to display.
The number of minor tick marks to display. |
getNumberFormatOverride | public NumberFormat getNumberFormatOverride()(Code) | | Returns the number format override. If this is non-null, then it will
be used to format the numbers on the axis.
The number formatter (possibly null ). |
getSmallestValue | public double getSmallestValue()(Code) | | Returns the smallest value represented by the axis.
The smallest value represented by the axis. |
getTickUnit | public NumberTickUnit getTickUnit()(Code) | | Returns the current tick unit.
The current tick unit. |
java2DToValue | public double java2DToValue(double java2DValue, Rectangle2D area, RectangleEdge edge)(Code) | | Converts a Java2D coordinate to an axis value, assuming that the
axis covers the specified edge of the area .
Parameters: java2DValue - the Java2D coordinate. Parameters: area - the area. Parameters: edge - the edge that the axis belongs to. A value along the axis scale. |
refreshTicks | public List refreshTicks(Graphics2D g2, AxisState state, Rectangle2D dataArea, RectangleEdge edge)(Code) | | Calculates the positions of the tick labels for the axis, storing the
results in the tick label list (ready for drawing).
Parameters: g2 - the graphics device. Parameters: state - the axis state. Parameters: dataArea - the area in which the plot should be drawn. Parameters: edge - the location of the axis. A list of ticks. |
refreshTicksHorizontal | protected List refreshTicksHorizontal(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)(Code) | | Returns a list of ticks for an axis at the top or bottom of the chart.
Parameters: g2 - the graphics device. Parameters: dataArea - the data area. Parameters: edge - the edge. A list of ticks. |
refreshTicksVertical | protected List refreshTicksVertical(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)(Code) | | Returns a list of ticks for an axis at the left or right of the chart.
Parameters: g2 - the graphics device. Parameters: dataArea - the data area. Parameters: edge - the edge. A list of ticks. |
setBase | public void setBase(double base)(Code) | | Sets the base for the logarithm calculation and sends an
AxisChangeEvent to all registered listeners.
Parameters: base - the base value (must be > 1.0). |
setMinorTickCount | public void setMinorTickCount(int count)(Code) | | Sets the number of minor tick marks to display.
Parameters: count - the count. |
setNumberFormatOverride | public void setNumberFormatOverride(NumberFormat formatter)(Code) | | Sets the number format override. If this is non-null, then it will be
used to format the numbers on the axis.
Parameters: formatter - the number formatter (null permitted). |
setSmallestValue | public void setSmallestValue(double value)(Code) | | Sets the smallest value represented by the axis.
Parameters: value - the value. |
setTickUnit | public void setTickUnit(NumberTickUnit unit)(Code) | | Sets the tick unit for the axis and sends an
AxisChangeEvent to
all registered listeners. A side effect of calling this method is that
the "auto-select" feature for tick units is switched off (you can
restore it using the
ValueAxis.setAutoTickUnitSelection(boolean) method).
Parameters: unit - the new tick unit (null not permitted). |
setTickUnit | public void setTickUnit(NumberTickUnit unit, boolean notify, boolean turnOffAutoSelect)(Code) | | Sets the tick unit for the axis and, if requested, sends an
AxisChangeEvent to all registered listeners. In addition, an
option is provided to turn off the "auto-select" feature for tick units
(you can restore it using the
ValueAxis.setAutoTickUnitSelection(boolean) method).
Parameters: unit - the new tick unit (null not permitted). Parameters: notify - notify listeners? Parameters: turnOffAutoSelect - turn off the auto-tick selection? |
valueToJava2D | public double valueToJava2D(double value, Rectangle2D area, RectangleEdge edge)(Code) | | Converts a value on the axis scale to a Java2D coordinate relative to
the given area , based on the axis running along the
specified edge .
Parameters: value - the data value. Parameters: area - the area. Parameters: edge - the edge. The Java2D coordinate corresponding to value . |
Methods inherited from org.jfree.chart.axis.ValueAxis | abstract protected void autoAdjustRange()(Code)(Java Doc) protected float[] calculateAnchorPoint(ValueTick tick, double cursor, Rectangle2D dataArea, RectangleEdge edge)(Code)(Java Doc) public void centerRange(double value)(Code)(Java Doc) public Object clone() throws CloneNotSupportedException(Code)(Java Doc) protected void drawAxisLine(Graphics2D g2, double cursor, Rectangle2D dataArea, RectangleEdge edge)(Code)(Java Doc) protected AxisState drawTickMarksAndLabels(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge)(Code)(Java Doc) public boolean equals(Object obj)(Code)(Java Doc) protected double findMaximumTickLabelHeight(List ticks, Graphics2D g2, Rectangle2D drawArea, boolean vertical)(Code)(Java Doc) protected double findMaximumTickLabelWidth(List ticks, Graphics2D g2, Rectangle2D drawArea, boolean vertical)(Code)(Java Doc) public double getAutoRangeMinimumSize()(Code)(Java Doc) protected int getAutoTickIndex()(Code)(Java Doc) public Range getDefaultAutoRange()(Code)(Java Doc) public Shape getDownArrow()(Code)(Java Doc) public double getFixedAutoRange()(Code)(Java Doc) public Shape getLeftArrow()(Code)(Java Doc) public double getLowerBound()(Code)(Java Doc) public double getLowerMargin()(Code)(Java Doc) public Range getRange()(Code)(Java Doc) public Shape getRightArrow()(Code)(Java Doc) public TickUnitSource getStandardTickUnits()(Code)(Java Doc) public Shape getUpArrow()(Code)(Java Doc) public double getUpperBound()(Code)(Java Doc) public double getUpperMargin()(Code)(Java Doc) public boolean isAutoRange()(Code)(Java Doc) public boolean isAutoTickUnitSelection()(Code)(Java Doc) public boolean isInverted()(Code)(Java Doc) public boolean isNegativeArrowVisible()(Code)(Java Doc) public boolean isPositiveArrowVisible()(Code)(Java Doc) public boolean isVerticalTickLabels()(Code)(Java Doc) abstract public double java2DToValue(double java2DValue, Rectangle2D area, RectangleEdge edge)(Code)(Java Doc) public double lengthToJava2D(double length, Rectangle2D area, RectangleEdge edge)(Code)(Java Doc) public AxisSpace reserveSpace(Graphics2D g2, Plot plot, Rectangle2D plotArea, RectangleEdge edge, AxisSpace space)(Code)(Java Doc) public void resizeRange(double percent)(Code)(Java Doc) public void resizeRange(double percent, double anchorValue)(Code)(Java Doc) public void setAutoRange(boolean auto)(Code)(Java Doc) protected void setAutoRange(boolean auto, boolean notify)(Code)(Java Doc) public void setAutoRangeMinimumSize(double size)(Code)(Java Doc) public void setAutoRangeMinimumSize(double size, boolean notify)(Code)(Java Doc) protected void setAutoTickIndex(int index)(Code)(Java Doc) public void setAutoTickUnitSelection(boolean flag)(Code)(Java Doc) public void setAutoTickUnitSelection(boolean flag, boolean notify)(Code)(Java Doc) public void setDefaultAutoRange(Range range)(Code)(Java Doc) public void setDownArrow(Shape arrow)(Code)(Java Doc) public void setFixedAutoRange(double length)(Code)(Java Doc) public void setInverted(boolean flag)(Code)(Java Doc) public void setLeftArrow(Shape arrow)(Code)(Java Doc) public void setLowerBound(double min)(Code)(Java Doc) public void setLowerMargin(double margin)(Code)(Java Doc) public void setNegativeArrowVisible(boolean visible)(Code)(Java Doc) public void setPositiveArrowVisible(boolean visible)(Code)(Java Doc) public void setRange(Range range)(Code)(Java Doc) public void setRange(Range range, boolean turnOffAutoRange, boolean notify)(Code)(Java Doc) public void setRange(double lower, double upper)(Code)(Java Doc) public void setRangeAboutValue(double value, double length)(Code)(Java Doc) public void setRangeWithMargins(Range range)(Code)(Java Doc) public void setRangeWithMargins(Range range, boolean turnOffAutoRange, boolean notify)(Code)(Java Doc) public void setRangeWithMargins(double lower, double upper)(Code)(Java Doc) public void setRightArrow(Shape arrow)(Code)(Java Doc) public void setStandardTickUnits(TickUnitSource source)(Code)(Java Doc) public void setUpArrow(Shape arrow)(Code)(Java Doc) public void setUpperBound(double max)(Code)(Java Doc) public void setUpperMargin(double margin)(Code)(Java Doc) public void setVerticalTickLabels(boolean flag)(Code)(Java Doc) abstract public double valueToJava2D(double value, Rectangle2D area, RectangleEdge edge)(Code)(Java Doc) public void zoomRange(double lowerPercent, double upperPercent)(Code)(Java Doc)
|
|
|