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 doubleThe default value for the smallest value attribute.Fields inherited from class org.jfree.chart3d.axis.AbstractValueAxis3D
rangeFields 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 RangeadjustedDataRange(Range range) Adjusts the range by adding the lower and upper margins on the logarithmic range.final doublecalculateLog(double value) Calculates the log of the givenvalue, using the current base.final doublecalculateValue(double log) Calculates the value from a given log value.voiddraw(Graphics2D g2, Point2D startPt, Point2D endPt, Point2D opposingPt, List<TickData> tickData, RenderingInfo info, boolean hinting) Draws the axis.booleanTests 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).doublegetBase()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.doubleReturns the smallest positive data value that will be represented on the axis.Returns the tick label formatter.Returns the tick selector for the axis.doubleReturns the tick size to be used when the tick selector isnull.inthashCode()Returns a hash code for this instance.doubleselectTick(Graphics2D g2, Point2D pt0, Point2D pt1, Point2D opposingPt) Selects a standard tick unit on the logarithmic range.voidsetBase(double base) Sets the logarithmic base value and sends anAxis3DChangeEventto all registered listeners.voidsetBaseFormatter(NumberFormat formatter) Sets the formatter for the log base value and sends anAxis3DChangeEventto all registered listeners.voidsetBaseSymbol(String symbol) Sets the base symbol and sends anAxis3DChangeEventto all registered listeners.voidsetRange(double min, double max) Sets the range for the axis.voidSets the range for the axis.voidsetSmallestValue(double smallestValue) Sets the smallest positive data value that will be represented on the axis and sends anAxis3DChangeEventto all registered listeners.voidsetTickLabelFormatter(Format formatter) Sets the formatter for the tick labels and sends anAxis3DChangeEventto all registered listeners.voidsetTickSelector(TickSelector selector) Sets the tick selector and sends anAxis3DChangeEventto all registered listeners.voidsetTickSize(double tickSize) Sets the tick size and sends anAxis3DChangeEventto all registered listeners.doubletranslateToWorld(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 voidupdateRange(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, setUpperMarginMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.chart3d.axis.Axis3D
addChangeListener, getLabelColor, getLabelFont, getRange, getTickLabelColor, getTickLabelFont, isInverted, isVisible, removeChangeListener, setInverted, setLabelColor, setLabelFont, setTickLabelColor, setTickLabelFont, setVisibleMethods inherited from interface org.jfree.chart3d.ChartElement
receiveMethods 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 (nullpermitted).
-
-
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 anAxis3DChangeEventto 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 anAxis3DChangeEventto 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 (nullpermitted).
-
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 anAxis3DChangeEventto all registered listeners.- Parameters:
formatter- the formatter (nullnot 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.0up to this value.- Returns:
- The smallest value.
-
setSmallestValue
Sets the smallest positive data value that will be represented on the axis and sends anAxis3DChangeEventto 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 anAxis3DChangeEventto all registered listeners.- Parameters:
selector- the selector (nullpermitted).
-
getTickSize
Returns the tick size to be used when the tick selector isnull.- Returns:
- The tick size.
-
setTickSize
Sets the tick size and sends anAxis3DChangeEventto 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 anAxis3DChangeEventto all registered listeners.- Parameters:
formatter- the formatter (nullnot 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:
setRangein interfaceAxis3D- Overrides:
setRangein classAbstractValueAxis3D- Parameters:
range- the range (nulnot 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:
setRangein interfaceAxis3D- Overrides:
setRangein classAbstractValueAxis3D- Parameters:
min- the lower bound for the range.max- the upper bound for the range.
-
updateRange
Description copied from class:AbstractValueAxis3DUpdates the axis range (used by the auto-range calculation) without notifying listeners.- Overrides:
updateRangein 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:
translateToWorldin 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:
drawin interfaceAxis3D- Specified by:
drawin classAbstractAxis3D- Parameters:
g2- the graphics target (nullnot 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 (nullpermitted).hinting- perform element hinting?
-
adjustedDataRange
Adjusts the range by adding the lower and upper margins on the logarithmic range.- Specified by:
adjustedDataRangein classAbstractValueAxis3D- Parameters:
range- the range (nulnot permitted).- Returns:
- The adjusted range.
-
selectTick
Selects a standard tick unit on the logarithmic range.- Specified by:
selectTickin interfaceValueAxis3D- Parameters:
g2- the graphics target (nullnot 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:
generateTickDatain interfaceValueAxis3D- Parameters:
tickUnit- the tick unit.- Returns:
- A list of tick data items.
-
hashCode
Description copied from class:AbstractAxis3DReturns a hash code for this instance.- Overrides:
hashCodein classAbstractAxis3D- Returns:
- A hash code.
-
equals
Description copied from class:AbstractAxis3DTests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractValueAxis3D- Parameters:
obj- the object to test against (nullpermitted).- Returns:
- A boolean.
-