java.lang.Object
org.jfree.chart3d.axis.AbstractAxis3D
org.jfree.chart3d.axis.AbstractValueAxis3D
org.jfree.chart3d.axis.NumberAxis3D
- All Implemented Interfaces:
Serializable,EventListener,Axis3D,ValueAxis3D,ChartElement,MarkerChangeListener
A numerical axis for use with 3D plots (implements
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.
ValueAxis3D).
In a CategoryPlot3D the value axis (the vertical one) is numerical,
and in an XYZPlot all the axes (x, y and z) are numerical - for
all these cases an instance of this class can be used.
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.
- See Also:
-
Field Summary
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
ConstructorsConstructorDescriptionNumberAxis3D(String label) Creates a new axis with the specified label and default attributes.NumberAxis3D(String label, Range range) Creates a new axis with the specified label and range. -
Method Summary
Modifier and TypeMethodDescriptionprotected RangeadjustedDataRange(Range range) Adjusts the range by adding the lower and upper margins and taking into account also theautoRangeStickyZeroflag.voiddraw(Graphics2D g2, Point2D pt0, Point2D pt1, Point2D opposingPt, List<TickData> tickData, RenderingInfo info, boolean hinting) Draws the axis to the supplied graphics target (g2, with the specified starting and ending points for the line.booleanTests this instance for equality with an arbitrary object.generateTickData(double tickUnit) Generates a list of tick data items for the specified tick unit.booleanReturns the flag that determines whether or not the auto range mechanism should force zero to be included in the range.booleanReturns the flag that controls the behaviour of the auto range mechanism when zero falls into the axis margins.Returns the tick label formatter.Returns the tick selector, an object that is responsible for choosing standard tick units 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 tick size that is appropriate for drawing the axis frompt0topt1.voidsetAutoRangeIncludeZero(boolean include) Sets the flag that controls whether or not the auto range mechanism should force zero to be included in the axis range, and sends anAxis3DChangeEventto all registered listeners.voidsetAutoRangeStickyZero(boolean sticky) Sets the flag that controls the behaviour of the auto range mechanism when zero falls into the axis margins.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) Converts a data value to world coordinates, taking into account the current axis range (assumes the world axis is zero-based and has the specified length).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, setRange, setRange, setTickLabelFactor, setTickLabelOffset, setTickLabelOrientation, setTickMarkLength, setTickMarkPaint, setTickMarkStroke, setUpperMargin, updateRangeMethods 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, setRange, setRange, 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
-
Constructor Details
-
NumberAxis3D
Creates a new axis with the specified label and default attributes.- Parameters:
label- the axis label (nullpermitted).
-
NumberAxis3D
Creates a new axis with the specified label and range.- Parameters:
label- the axis label (nullpermitted).range- the range (nullnot permitted).
-
-
Method Details
-
getAutoRangeIncludesZero
Returns the flag that determines whether or not the auto range mechanism should force zero to be included in the range. The default value isfalse.- Returns:
- A boolean.
-
setAutoRangeIncludeZero
Sets the flag that controls whether or not the auto range mechanism should force zero to be included in the axis range, and sends anAxis3DChangeEventto all registered listeners.- Parameters:
include- the new flag value.
-
getAutoRangeStickyZero
Returns the flag that controls the behaviour of the auto range mechanism when zero falls into the axis margins. The default value istrue.- Returns:
- A boolean.
- See Also:
-
setAutoRangeStickyZero
Sets the flag that controls the behaviour of the auto range mechanism when zero falls into the axis margins. Iftrue, when zero is in the axis margin the axis range is truncated at zero. Iffalse, there is no special treatment.- Parameters:
sticky- the new flag value.
-
getTickSelector
Returns the tick selector, an object that is responsible for choosing standard tick units for the axis. The default value is a default instance ofNumberTickSelector.- Returns:
- The tick selector.
- See Also:
-
setTickSelector
Sets the tick selector and sends anAxis3DChangeEventto all registered listeners.- Parameters:
selector- the selector (nullpermitted).- See Also:
-
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.00").- 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).
-
adjustedDataRange
Adjusts the range by adding the lower and upper margins and taking into account also theautoRangeStickyZeroflag.- Specified by:
adjustedDataRangein classAbstractValueAxis3D- Parameters:
range- the range (nullnot permitted).- Returns:
- The adjusted range.
-
draw
public void draw(Graphics2D g2, Point2D pt0, Point2D pt1, Point2D opposingPt, List<TickData> tickData, RenderingInfo info, boolean hinting) Draws the axis to the supplied graphics target (g2, with the specified starting and ending points for the line. This method is used internally, you should not need to call it directly.- Specified by:
drawin interfaceAxis3D- Specified by:
drawin classAbstractAxis3D- Parameters:
g2- the graphics target (nullnot permitted).pt0- the starting point (nullnot permitted).pt1- the ending point (nullnot permitted).opposingPt- an opposing point (to determine which side of the axis line the labels should appear,nullnot permitted).tickData- tick details (nullnot permitted).info- an object to be populated with rendering info (nullpermitted).hinting- perform element hinting?
-
translateToWorld
Converts a data value to world coordinates, taking into account the current axis range (assumes the world axis is zero-based and has the specified length).- Specified by:
translateToWorldin interfaceAxis3D- Parameters:
value- the data value (in axis units).length- the length of the (zero based) world axis.- Returns:
- A world coordinate.
-
selectTick
Selects a tick size that is appropriate for drawing the axis frompt0topt1.- Specified by:
selectTickin interfaceValueAxis3D- Parameters:
g2- the graphics target (nullnot permitted).pt0- the starting point for the axis.pt1- the ending point for the axis.opposingPt- a point on the opposite side of the line from where the labels should be drawn.- Returns:
- The tick size.
-
generateTickData
Generates a list of tick data items for the specified tick unit. This data will be passed to the 3D engine and will be updated with a 2D projection that can later be used to write the axis tick labels in the appropriate places.
IftickUnitisDouble.NaN, then tick data is generated for just the bounds of the axis.- Specified by:
generateTickDatain interfaceValueAxis3D- Parameters:
tickUnit- the tick unit.- Returns:
- A list of tick data (never
null).
-
equals
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractValueAxis3D- Parameters:
obj- the object to test against (nullpermitted).- Returns:
- A boolean.
-
hashCode
Returns a hash code for this instance.- Overrides:
hashCodein classAbstractAxis3D- Returns:
- A hash code.
-