Package org.jzy3d.plot3d.primitives.axis
Class AxisLabelProcessor
java.lang.Object
org.jzy3d.plot3d.primitives.axis.AxisLabelProcessor
A helper class to process axis labels.
- Author:
- martin
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
axisLabel
(int dimension) Return the axis label for the given direction.protected Coord2d
axisLabelOffset
(IPainter painter, AxisRenderingInfo info, Coord3d labelPosition, int margin) Offset for oblique labels.protected Coord2d
axisLabelOffsetVertical
(IPainter painter, AxisRenderingInfo info, Coord3d labelPosition, int margin) Computes the offset to apply to a vertical Z label to avoid covering the tick labels in the case of a 3D chart.protected Coord3d
axisLabelPosition
(int direction, float tickLength, Coord3d pos, Coord3d dir) Compute the axis label position according to the tick position (on the axis segment) and a direction for the tick.protected Coord3d
axisLabelPosition_2D
(int direction, Coord3d pos) 2D case : processed in 2D according to pixel margins, font size, and a pixel to world dimension ratio returned by the viewprotected Coord3d
axisLabelPosition_3D
(int direction, float tickLength, Coord3d pos, Coord3d dir) 3D case : process a shift from the center of the axis to annotate based on the tick length (hence distance between tick text and axis) and a distance factor of the axis label w.r.t. the tick lengthprotected float
axisLabelRotation
(IPainter painter, int direction, Coord3d[] axisSegment) Compute axis label rotation according to settings and direction of the axis segment.protected void
drawAxisLabel
(IPainter painter, int direction, Color color, BoundingBox3d ticksTxtBounds, Coord3d position, String label, float rotation, Coord2d offset) protected TextAlign
getAxisLabelTextAlign
(int direction) Return an axis label alignment suitable for the type of chart : 3D, 2D XY, 2D XZ, 2D YZ
-
Field Details
-
axis
-
layout
-
-
Constructor Details
-
AxisLabelProcessor
-
-
Method Details
-
drawAxisLabel
-
getAxisLabelTextAlign
Return an axis label alignment suitable for the type of chart : 3D, 2D XY, 2D XZ, 2D YZ -
axisLabelOffsetVertical
protected Coord2d axisLabelOffsetVertical(IPainter painter, AxisRenderingInfo info, Coord3d labelPosition, int margin) Computes the offset to apply to a vertical Z label to avoid covering the tick labels in the case of a 3D chart. Retrieves pixel scale in view to adapt margin.- Parameters:
painter
-info
-labelPosition
-margin
-offset2D
-
-
axisLabelOffset
protected Coord2d axisLabelOffset(IPainter painter, AxisRenderingInfo info, Coord3d labelPosition, int margin) Offset for oblique labels.- Parameters:
painter
-info
-labelPosition
-margin
-- Returns:
-
axisLabelRotation
Compute axis label rotation according to settings and direction of the axis segment. -
axisLabel
Return the axis label for the given direction. -
axisLabelPosition
Compute the axis label position according to the tick position (on the axis segment) and a direction for the tick. This is quite intricated withView.computeCamera3D_RenderingSphere(org.jzy3d.plot3d.rendering.view.Camera, org.jzy3d.plot3d.rendering.view.ViewportConfiguration, org.jzy3d.maths.BoundingBox3d)
andView.computeCamera2D_RenderingSquare(org.jzy3d.plot3d.rendering.view.Camera, org.jzy3d.plot3d.rendering.view.ViewportConfiguration, org.jzy3d.maths.BoundingBox3d)
which will perform the actual camera configuration to ensure enough white space around the scene to draw the axis and tick labels -
axisLabelPosition_2D
2D case : processed in 2D according to pixel margins, font size, and a pixel to world dimension ratio returned by the view -
axisLabelPosition_3D
3D case : process a shift from the center of the axis to annotate based on the tick length (hence distance between tick text and axis) and a distance factor of the axis label w.r.t. the tick length
-