java.lang.Object
org.jfree.chart3d.axis.AbstractAxis3D
org.jfree.chart3d.axis.AbstractValueAxis3D
org.jfree.chart3d.axis.LogAxis3D
- All Implemented Interfaces:
Serializable
,EventListener
,Axis3D
,ValueAxis3D
,ChartElement
,MarkerChangeListener
A numerical axis with a logarithmic scale.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- Since:
- 1.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
The default value for the smallest value attribute.Fields inherited from class org.jfree.chart3d.axis.AbstractValueAxis3D
range
Fields inherited from class org.jfree.chart3d.axis.AbstractAxis3D
DEFAULT_LABEL_COLOR, DEFAULT_LABEL_FONT, DEFAULT_LABEL_OFFSET, DEFAULT_LINE_COLOR, DEFAULT_LINE_STROKE, DEFAULT_TICK_LABEL_COLOR, DEFAULT_TICK_LABEL_FONT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Range
adjustedDataRange
(Range range) Adjusts the range by adding the lower and upper margins on the logarithmic range.final double
calculateLog
(double value) Calculates the log of the givenvalue
, using the current base.final double
calculateValue
(double log) Calculates the value from a given log value.void
draw
(Graphics2D g2, Point2D startPt, Point2D endPt, Point2D opposingPt, List<TickData> tickData, RenderingInfo info, boolean hinting) Draws the axis.boolean
Tests this instance for equality with an arbitrary object.generateTickData
(double tickUnit) Generates tick data for the axis, assuming the specified tick unit (a log increment in this case).double
getBase()
Returns the logarithmic base value.Returns the formatter used for the log base value when it is displayed in tick labels.Returns the base symbol, used in tick labels for the axis.double
Returns the smallest positive data value that will be represented on the axis.Returns the tick label formatter.Returns the tick selector for the axis.double
Returns the tick size to be used when the tick selector isnull
.int
hashCode()
Returns a hash code for this instance.double
selectTick
(Graphics2D g2, Point2D pt0, Point2D pt1, Point2D opposingPt) Selects a standard tick unit on the logarithmic range.void
setBase
(double base) Sets the logarithmic base value and sends anAxis3DChangeEvent
to all registered listeners.void
setBaseFormatter
(NumberFormat formatter) Sets the formatter for the log base value and sends anAxis3DChangeEvent
to all registered listeners.void
setBaseSymbol
(String symbol) Sets the base symbol and sends anAxis3DChangeEvent
to all registered listeners.void
setRange
(double min, double max) Sets the range for the axis.void
Sets the range for the axis.void
setSmallestValue
(double smallestValue) Sets the smallest positive data value that will be represented on the axis and sends anAxis3DChangeEvent
to all registered listeners.void
setTickLabelFormatter
(Format formatter) Sets the formatter for the tick labels and sends anAxis3DChangeEvent
to all registered listeners.void
setTickSelector
(TickSelector selector) Sets the tick selector and sends anAxis3DChangeEvent
to all registered listeners.void
setTickSize
(double tickSize) Sets the tick size and sends anAxis3DChangeEvent
to all registered listeners.double
translateToWorld
(double value, double length) Translates a data value to a world coordinate, assuming that the axis begins at the origin and has the specified length.protected void
updateRange
(Range range) Updates the axis range (used by the auto-range calculation) without notifying listeners.Methods inherited from class org.jfree.chart3d.axis.AbstractValueAxis3D
axisStr, configureAsValueAxis, configureAsXAxis, configureAsYAxis, configureAsZAxis, generateMarkerData, getConfiguredType, getDefaultAutoRange, getLowerMargin, getMarker, getMarkers, getMinAutoRangeLength, getRange, getTickLabelFactor, getTickLabelOffset, getTickLabelOrientation, getTickMarkLength, getTickMarkPaint, getTickMarkStroke, getUpperMargin, isAutoAdjustRange, isInverted, receive, setAutoAdjustRange, setDefaultAutoRange, setInverted, setLowerMargin, setMarker, setMinAutoRangeLength, setTickLabelFactor, setTickLabelOffset, setTickLabelOrientation, setTickMarkLength, setTickMarkPaint, setTickMarkStroke, setUpperMargin
Methods inherited from class org.jfree.chart3d.axis.AbstractAxis3D
addChangeListener, drawAxisLabel, fireChangeEvent, getLabel, getLabelColor, getLabelFont, getLabelOffset, getLineColor, getLineStroke, getTickLabelColor, getTickLabelFont, getTickLabelsVisible, isVisible, markerChanged, notifyListeners, removeChangeListener, setLabel, setLabelColor, setLabelFont, setLabelOffset, setLineColor, setLineStroke, setTickLabelColor, setTickLabelFont, setTickLabelsVisible, setVisible
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.chart3d.axis.Axis3D
addChangeListener, getLabelColor, getLabelFont, getRange, getTickLabelColor, getTickLabelFont, isInverted, isVisible, removeChangeListener, setInverted, setLabelColor, setLabelFont, setTickLabelColor, setTickLabelFont, setVisible
Methods inherited from interface org.jfree.chart3d.ChartElement
receive
Methods inherited from interface org.jfree.chart3d.axis.ValueAxis3D
configureAsValueAxis, configureAsXAxis, configureAsYAxis, configureAsZAxis, generateMarkerData, getConfiguredType, getMarker
-
Field Details
-
DEFAULT_SMALLEST_VALUE
The default value for the smallest value attribute.- See Also:
-
-
Constructor Details
-
LogAxis3D
Creates a new log axis with a default base of 10.- Parameters:
label
- the axis label (null
permitted).
-
-
Method Details
-
getBase
Returns the logarithmic base value. The default value is10
.- Returns:
- The logarithmic base value.
-
setBase
Sets the logarithmic base value and sends anAxis3DChangeEvent
to all registered listeners.- Parameters:
base
- the base value.
-
getBaseSymbol
Returns the base symbol, used in tick labels for the axis. A typical value would be "e" when using a natural logarithm scale. If this isnull
, the tick labels will display the numerical base value. The default value isnull
.- Returns:
- The base symbol (possibly
null
).
-
setBaseSymbol
Sets the base symbol and sends anAxis3DChangeEvent
to all registered listeners. If you set this tonull
, the tick labels will display a numerical representation of the base value.- Parameters:
symbol
- the base symbol (null
permitted).
-
getBaseFormatter
Returns the formatter used for the log base value when it is displayed in tick labels. The default value isNumberFormat("0")
.- Returns:
- The base formatter (never
null
).
-
setBaseFormatter
Sets the formatter for the log base value and sends anAxis3DChangeEvent
to all registered listeners.- Parameters:
formatter
- the formatter (null
not permitted).
-
getSmallestValue
Returns the smallest positive data value that will be represented on the axis. This will be used as the lower bound for the axis if the data range contains any value from0.0
up to this value.- Returns:
- The smallest value.
-
setSmallestValue
Sets the smallest positive data value that will be represented on the axis and sends anAxis3DChangeEvent
to all registered listeners.- Parameters:
smallestValue
- the value (must be positive).
-
getTickSelector
Returns the tick selector for the axis.- Returns:
- The tick selector (possibly
null
).
-
setTickSelector
Sets the tick selector and sends anAxis3DChangeEvent
to all registered listeners.- Parameters:
selector
- the selector (null
permitted).
-
getTickSize
Returns the tick size to be used when the tick selector isnull
.- Returns:
- The tick size.
-
setTickSize
Sets the tick size and sends anAxis3DChangeEvent
to all registered listeners.- Parameters:
tickSize
- the new tick size.
-
getTickLabelFormatter
Returns the tick label formatter. The default value isDecimalFormat("0.0")
.- Returns:
- The tick label formatter (never
null
).
-
setTickLabelFormatter
Sets the formatter for the tick labels and sends anAxis3DChangeEvent
to all registered listeners.- Parameters:
formatter
- the formatter (null
not permitted).
-
setRange
Sets the range for the axis. This method is overridden to check that the range does not contain negative values, and to update the log values for the range.- Specified by:
setRange
in interfaceAxis3D
- Overrides:
setRange
in classAbstractValueAxis3D
- Parameters:
range
- the range (nul
not permitted).
-
setRange
Sets the range for the axis. This method is overridden to check that the range does not contain negative values, and to update the log values for the range.- Specified by:
setRange
in interfaceAxis3D
- Overrides:
setRange
in classAbstractValueAxis3D
- Parameters:
min
- the lower bound for the range.max
- the upper bound for the range.
-
updateRange
Description copied from class:AbstractValueAxis3D
Updates the axis range (used by the auto-range calculation) without notifying listeners.- Overrides:
updateRange
in classAbstractValueAxis3D
- Parameters:
range
- the new range.
-
calculateLog
Calculates the log of the givenvalue
, using the current base.- Parameters:
value
- the value (negatives not permitted).- Returns:
- The log of the given value.
- See Also:
-
calculateValue
Calculates the value from a given log value.- Parameters:
log
- the log value.- Returns:
- The value with the given log.
- See Also:
-
translateToWorld
Translates a data value to a world coordinate, assuming that the axis begins at the origin and has the specified length.- Specified by:
translateToWorld
in interfaceAxis3D
- Parameters:
value
- the data value.length
- the axis length in world coordinates.- Returns:
- The world coordinate of this data value on the axis.
-
draw
public void draw(Graphics2D g2, Point2D startPt, Point2D endPt, Point2D opposingPt, List<TickData> tickData, RenderingInfo info, boolean hinting) Draws the axis.- Specified by:
draw
in interfaceAxis3D
- Specified by:
draw
in classAbstractAxis3D
- Parameters:
g2
- the graphics target (null
not permitted).startPt
- the starting point.endPt
- the ending point.opposingPt
- an opposing point (labels will be on the other side of the line).tickData
- the tick data (including anchor points calculated by the 3D engine).info
- an object to be populated with rendering info (null
permitted).hinting
- perform element hinting?
-
adjustedDataRange
Adjusts the range by adding the lower and upper margins on the logarithmic range.- Specified by:
adjustedDataRange
in classAbstractValueAxis3D
- Parameters:
range
- the range (nul
not permitted).- Returns:
- The adjusted range.
-
selectTick
Selects a standard tick unit on the logarithmic range.- Specified by:
selectTick
in interfaceValueAxis3D
- Parameters:
g2
- the graphics target (null
not permitted).pt0
- the starting point.pt1
- the ending point.opposingPt
- an opposing point.- Returns:
- The tick unit (log increment).
-
generateTickData
Generates tick data for the axis, assuming the specified tick unit (a log increment in this case). If the tick unit is Double.NaN then ticks will be added for the bounds of the axis only.- Specified by:
generateTickData
in interfaceValueAxis3D
- Parameters:
tickUnit
- the tick unit.- Returns:
- A list of tick data items.
-
hashCode
Description copied from class:AbstractAxis3D
Returns a hash code for this instance.- Overrides:
hashCode
in classAbstractAxis3D
- Returns:
- A hash code.
-
equals
Description copied from class:AbstractAxis3D
Tests this instance for equality with an arbitrary object.- Overrides:
equals
in classAbstractValueAxis3D
- Parameters:
obj
- the object to test against (null
permitted).- Returns:
- A boolean.
-