de.erichseifert.gral.plots.axes
Interface AxisRenderer
-
- All Known Implementing Classes:
- AbstractAxisRenderer2D, LinearRenderer2D, LogarithmicRenderer2D
public interface AxisRendererInterface for generic renderers of axes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.util.Map<java.lang.Double,java.lang.String>getCustomTicks()Returns custom ticks with their respective position and label.java.lang.NumbergetIntersection()Returns the intersection point of the axis.LabelgetLabel()Returns the label of the axis.doublegetLabelDistance()Returns the distance from the axis to the label.doublegetMinorTickAlignment()Returns the alignment of minor ticks.java.awt.PaintgetMinorTickColor()Returns the paint used to draw the shapes of minor ticks.doublegetMinorTickLength()Returns the length of minor tick strokes.intgetMinorTicksCount()Returns the count of minor ticks.java.awt.StrokegetMinorTickStroke()Returns the stroke used to draw all minor ticks.PointND<java.lang.Double>getNormal(Axis axis, java.lang.Number value, boolean extrapolate, boolean forceLinear)Returns the normal vector at the position of the specified value.PointND<java.lang.Double>getPosition(Axis axis, java.lang.Number value, boolean extrapolate, boolean forceLinear)Returns the position of the specified value on the axis.DrawablegetRendererComponent(Axis axis)Returns a component that displays the specified axis.java.awt.ShapegetShape()Returns the shape of the axis.java.awt.PaintgetShapeColor()Returns the paint used to draw the axis, its ticks and its labels.java.awt.StrokegetShapeStroke()Returns the stroke which defines the shape of the axis.doublegetTickAlignment()Returns the alignment of major ticks relative to the axis.java.awt.PaintgetTickColor()Returns the paint used to draw the shapes of major ticks.java.awt.FontgetTickFont()Returns the font used to display the text of major ticks.doublegetTickLabelDistance()Returns the distance of labels to their ticks.java.text.FormatgetTickLabelFormat()Returns the format which converts the tick values to labels.doublegetTickLabelRotation()Returns the rotation of the tick labels.doublegetTickLength()Returns the length of major tick strokes.java.util.List<Tick>getTicks(Axis axis)Returns a list of all tick element on the axis.java.lang.NumbergetTickSpacing()Returns the interval for major ticks.java.awt.StrokegetTickStroke()Returns the stroke which is used to draw all major ticks.booleanisMinorTicksVisible()Returns whether minor ticks are drawn.booleanisShapeDirectionSwapped()Returns whether the axis direction is changed.booleanisShapeNormalOrientationClockwise()Returns whether the normal vector of the shape is calculated using clockwise or counterclockwise rotation.booleanisShapeVisible()Returns whether the shape of the axis will be drawn.booleanisTickLabelsOutside()Returns whether the tick labels are drawn outside of the plot.booleanisTickLabelsVisible()Returns whether tick labels will be shown.booleanisTicksAutoSpaced()Returns whether the interval for major and minor ticks is chosen automatically.booleanisTicksVisible()Returns whether major ticks are drawn.voidsetCustomTicks(java.util.Map<java.lang.Double,java.lang.String> positionsAndLabels)Sets custom ticks with their respective position and label.voidsetIntersection(java.lang.Number intersection)Sets the intersection point of the axis.voidsetLabel(Label label)Sets the label of the axis.voidsetLabelDistance(double distance)Sets the distance from the axis to the label.voidsetMinorTickAlignment(double alignment)Sets the alignment of minor ticks.voidsetMinorTickColor(java.awt.Paint ticksMinorColor)Sets the paint used to draw the shapes of minor ticks.voidsetMinorTickLength(double length)Sets the length of minor tick strokes.voidsetMinorTicksCount(int count)Sets the count of minor ticks.voidsetMinorTickStroke(java.awt.Stroke stroke)Sets the stroke used to draw all minor ticks.voidsetMinorTicksVisible(boolean minorTicksVisible)Sets whether minor ticks are drawn.voidsetShape(java.awt.Shape shape)Sets the shape of the axis.voidsetShapeColor(java.awt.Paint color)Sets the paint used to draw the axis, its ticks and its labels.voidsetShapeDirectionSwapped(boolean directionSwapped)Sets whether the axis direction will be changed.voidsetShapeNormalOrientationClockwise(boolean clockwise)Sets whether the normal vector of the shape is calculated using clockwise or counterclockwise rotation.voidsetShapeStroke(java.awt.Stroke stroke)Sets the stroke which defines the shape of the axis.voidsetShapeVisible(boolean shapeVisible)Sets whether the shape of the axis will be drawn.voidsetTickAlignment(double alignment)Sets the alignment of major ticks relative to the axis.voidsetTickColor(java.awt.Paint color)Sets the paint used to draw the shapes of major ticks.voidsetTickFont(java.awt.Font font)Sets the font used to display the text of major ticks.voidsetTickLabelDistance(double distance)Sets the distance of labels to their ticks.voidsetTickLabelFormat(java.text.Format format)Sets the format which converts the tick values to labels.voidsetTickLabelRotation(double angle)Sets the rotation of the tick labels.voidsetTickLabelsOutside(boolean tickLabelsOutside)Sets whether the tick labels are drawn outside of the plot.voidsetTickLabelsVisible(boolean tickLabelsVisible)Sets whether tick labels will be shown.voidsetTickLength(double length)Sets the length of major tick strokes.voidsetTicksAutoSpaced(boolean autoSpaced)Sets whether the interval for major and minor ticks is chosen automatically.voidsetTickSpacing(java.lang.Number spacing)Sets the interval for major ticks.voidsetTickStroke(java.awt.Stroke stroke)Sets the stroke which is used to draw all major ticks.voidsetTicksVisible(boolean ticksVisible)Sets whether major ticks will be drawn.java.lang.NumberviewToWorld(Axis axis, double value, boolean extrapolate)Converts a view (screen) coordinate value to a world (axis) coordinate value.doubleworldToView(Axis axis, java.lang.Number value, boolean extrapolate)Converts a world (axis) coordinate value to a view (screen) coordinate value.
-
-
-
Method Detail
-
getRendererComponent
Drawable getRendererComponent(Axis axis)
Returns a component that displays the specified axis.- Parameters:
axis- axis to be displayed- Returns:
- component displaying the axis
- See Also:
Axis
-
worldToView
double worldToView(Axis axis, java.lang.Number value, boolean extrapolate)
Converts a world (axis) coordinate value to a view (screen) coordinate value. If @code{extrapolate == false}, this method should return 0.0 when value is smaller than @code{axis.getMin()} andgetShapeLength()when value is larger than @code{axis.getMax(}).- Parameters:
axis- Axisvalue- World coordinate value to convertextrapolate- Option to activate extrapolation value that are not on the axis- Returns:
- Screen coordinate value
-
viewToWorld
java.lang.Number viewToWorld(Axis axis, double value, boolean extrapolate)
Converts a view (screen) coordinate value to a world (axis) coordinate value.- Parameters:
axis- Axisvalue- View coordinate value to convertextrapolate- Option to activate extrapolation value that are not on the axis- Returns:
- World coordinate value
-
getTicks
java.util.List<Tick> getTicks(Axis axis)
Returns a list of all tick element on the axis.- Parameters:
axis- Axis- Returns:
- A list of
Tickinstances
-
getPosition
PointND<java.lang.Double> getPosition(Axis axis, java.lang.Number value, boolean extrapolate, boolean forceLinear)
Returns the position of the specified value on the axis. The value is returned in view coordinates.- Parameters:
axis- Axisvalue- World coordinate value to convertextrapolate- Option to activate extrapolation value that are not on the axisforceLinear- Force linear interpolation.- Returns:
- N-dimensional point of the value
-
getNormal
PointND<java.lang.Double> getNormal(Axis axis, java.lang.Number value, boolean extrapolate, boolean forceLinear)
Returns the normal vector at the position of the specified value. The vector is normalized.- Parameters:
axis- Axisvalue- World coordinate value to convertextrapolate- Option to activate extrapolation value that are not on the axisforceLinear- Force linear interpolation.- Returns:
- N-dimensional normal vector at the position
-
getIntersection
java.lang.Number getIntersection()
Returns the intersection point of the axis.- Returns:
- Point at which this axis intersects other axes.
-
setIntersection
void setIntersection(java.lang.Number intersection)
Sets the intersection point of the axis.- Parameters:
intersection- Point at which this axis intersects other axes.
-
getShape
java.awt.Shape getShape()
Returns the shape of the axis.- Returns:
- Shape used for drawing.
-
setShape
void setShape(java.awt.Shape shape)
Sets the shape of the axis.- Parameters:
shape- Shape used for drawing.
-
isShapeVisible
boolean isShapeVisible()
Returns whether the shape of the axis will be drawn. This doesn't influence ticks or labels.- Returns:
trueif the shape should be drawn, false otherwise.
-
setShapeVisible
void setShapeVisible(boolean shapeVisible)
Sets whether the shape of the axis will be drawn. This doesn't influence ticks or labels.- Parameters:
shapeVisible-trueif the shape should be drawn, false otherwise.
-
isShapeNormalOrientationClockwise
boolean isShapeNormalOrientationClockwise()
Returns whether the normal vector of the shape is calculated using clockwise or counterclockwise rotation.- Returns:
trueif the orientation is clockwise,falseif it is counterclockwise.
-
setShapeNormalOrientationClockwise
void setShapeNormalOrientationClockwise(boolean clockwise)
Sets whether the normal vector of the shape is calculated using clockwise or counterclockwise rotation.- Parameters:
clockwise-trueif the orientation is clockwise,falseif it is counterclockwise.
-
getShapeColor
java.awt.Paint getShapeColor()
Returns the paint used to draw the axis, its ticks and its labels.- Returns:
- Paint used for drawing.
-
setShapeColor
void setShapeColor(java.awt.Paint color)
Sets the paint used to draw the axis, its ticks and its labels.- Parameters:
color- Paint used for drawing.
-
getShapeStroke
java.awt.Stroke getShapeStroke()
Returns the stroke which defines the shape of the axis.- Returns:
- Stroke used for drawing the shape.
-
setShapeStroke
void setShapeStroke(java.awt.Stroke stroke)
Sets the stroke which defines the shape of the axis.- Parameters:
stroke- Stroke used for drawing the shape.
-
isShapeDirectionSwapped
boolean isShapeDirectionSwapped()
Returns whether the axis direction is changed.- Returns:
trueif the shape of the axis is inverted,falseotherwise.
-
setShapeDirectionSwapped
void setShapeDirectionSwapped(boolean directionSwapped)
Sets whether the axis direction will be changed.- Parameters:
directionSwapped-trueif the shape of the axis should be inverted,falseotherwise.
-
isTicksVisible
boolean isTicksVisible()
Returns whether major ticks are drawn.- Returns:
trueif major ticks are drawn,falseotherwise.
-
setTicksVisible
void setTicksVisible(boolean ticksVisible)
Sets whether major ticks will be drawn.- Parameters:
ticksVisible-trueif major ticks should be drawn,falseotherwise.
-
getTickSpacing
java.lang.Number getTickSpacing()
Returns the interval for major ticks.- Returns:
- Distance on axis in which major ticks are drawn.
-
setTickSpacing
void setTickSpacing(java.lang.Number spacing)
Sets the interval for major ticks.- Parameters:
spacing- Distance on axis in which major ticks are drawn.
-
isTicksAutoSpaced
boolean isTicksAutoSpaced()
Returns whether the interval for major and minor ticks is chosen automatically.- Returns:
trueif auto-spacing is enabled,falseotherwise.
-
setTicksAutoSpaced
void setTicksAutoSpaced(boolean autoSpaced)
Sets whether the interval for major and minor ticks is chosen automatically.- Parameters:
autoSpaced-trueif auto-spacing is enabled,falseotherwise.
-
getTickLength
double getTickLength()
Returns the length of major tick strokes.- Returns:
- Tick length relative to the font height.
-
setTickLength
void setTickLength(double length)
Sets the length of major tick strokes.- Parameters:
length- Tick length relative to the font height.
-
getTickStroke
java.awt.Stroke getTickStroke()
Returns the stroke which is used to draw all major ticks.- Returns:
- Stroke used for major tick drawing.
-
setTickStroke
void setTickStroke(java.awt.Stroke stroke)
Sets the stroke which is used to draw all major ticks.- Parameters:
stroke- Stroke used for major tick drawing.
-
getTickAlignment
double getTickAlignment()
Returns the alignment of major ticks relative to the axis. 0.0 means outside the plotting area, 0.5 means centered on the axis, 1.0 means inside the plotting area.- Returns:
- Major tick alignment relative to the axis.
-
setTickAlignment
void setTickAlignment(double alignment)
Sets the alignment of major ticks relative to the axis. 0.0 means outside the plotting area, 0.5 means centered on the axis, 1.0 means inside the plotting area.- Parameters:
alignment- Major tick alignment relative to the axis.
-
getTickFont
java.awt.Font getTickFont()
Returns the font used to display the text of major ticks.- Returns:
- Font used for tick labels.
-
setTickFont
void setTickFont(java.awt.Font font)
Sets the font used to display the text of major ticks.- Parameters:
font- Font used for tick labels.
-
getTickColor
java.awt.Paint getTickColor()
Returns the paint used to draw the shapes of major ticks.- Returns:
- Paint used for major tick drawing.
-
setTickColor
void setTickColor(java.awt.Paint color)
Sets the paint used to draw the shapes of major ticks.- Parameters:
color- Paint used for major tick drawing.
-
isTickLabelsVisible
boolean isTickLabelsVisible()
Returns whether tick labels will be shown.- Returns:
trueif tick labels will be drawn,falseotherwise.
-
setTickLabelsVisible
void setTickLabelsVisible(boolean tickLabelsVisible)
Sets whether tick labels will be shown.- Parameters:
tickLabelsVisible-trueif tick labels will be drawn,falseotherwise.
-
getTickLabelFormat
java.text.Format getTickLabelFormat()
Returns the format which converts the tick values to labels.- Returns:
- Format used for tick labels.
-
setTickLabelFormat
void setTickLabelFormat(java.text.Format format)
Sets the format which converts the tick values to labels.- Parameters:
format- Format used for tick labels.
-
getTickLabelDistance
double getTickLabelDistance()
Returns the distance of labels to their ticks.- Returns:
- Label distance relative to the font height.
-
setTickLabelDistance
void setTickLabelDistance(double distance)
Sets the distance of labels to their ticks.- Parameters:
distance- Label distance relative to the font height.
-
isTickLabelsOutside
boolean isTickLabelsOutside()
Returns whether the tick labels are drawn outside of the plot.- Returns:
trueif the labels are drawn outside of the plot,falseotherwise.
-
setTickLabelsOutside
void setTickLabelsOutside(boolean tickLabelsOutside)
Sets whether the tick labels are drawn outside of the plot.- Parameters:
tickLabelsOutside-trueif the labels are drawn outside of the plot,falseotherwise.
-
getTickLabelRotation
double getTickLabelRotation()
Returns the rotation of the tick labels.- Returns:
- Tick label rotation in degrees.
-
setTickLabelRotation
void setTickLabelRotation(double angle)
Sets the rotation of the tick labels.- Parameters:
angle- Tick label rotation in degrees.
-
isMinorTicksVisible
boolean isMinorTicksVisible()
Returns whether minor ticks are drawn.- Returns:
trueif minor ticks are drawn,falseotherwise.
-
setMinorTicksVisible
void setMinorTicksVisible(boolean minorTicksVisible)
Sets whether minor ticks are drawn.- Parameters:
minorTicksVisible-trueif minor ticks are drawn,falseotherwise.
-
getMinorTicksCount
int getMinorTicksCount()
Returns the count of minor ticks.- Returns:
- Number of minor ticks between two major ticks.
-
setMinorTicksCount
void setMinorTicksCount(int count)
Sets the count of minor ticks.- Parameters:
count- Number of minor ticks between two major ticks.
-
getMinorTickLength
double getMinorTickLength()
Returns the length of minor tick strokes.- Returns:
- Tick length relative to font height.
-
setMinorTickLength
void setMinorTickLength(double length)
Sets the length of minor tick strokes.- Parameters:
length- Tick length relative to font height.
-
getMinorTickStroke
java.awt.Stroke getMinorTickStroke()
Returns the stroke used to draw all minor ticks.- Returns:
- Stroke used for minor tick drawing.
-
setMinorTickStroke
void setMinorTickStroke(java.awt.Stroke stroke)
Sets the stroke used to draw all minor ticks.- Parameters:
stroke- Stroke used for minor tick drawing.
-
getMinorTickAlignment
double getMinorTickAlignment()
Returns the alignment of minor ticks. 0.0 means outside the plotting area, 0.5 means centered on the axis, 1.0 means inside the plotting area.- Returns:
- Minor tick alignment relative to the axis.
-
setMinorTickAlignment
void setMinorTickAlignment(double alignment)
Sets the alignment of minor ticks. 0.0 means outside the plotting area, 0.5 means centered on the axis, 1.0 means inside the plotting area.- Parameters:
alignment- Minor tick alignment relative to the axis.
-
getMinorTickColor
java.awt.Paint getMinorTickColor()
Returns the paint used to draw the shapes of minor ticks.- Returns:
- Paint used for minor tick drawing.
-
setMinorTickColor
void setMinorTickColor(java.awt.Paint ticksMinorColor)
Sets the paint used to draw the shapes of minor ticks.- Parameters:
ticksMinorColor- Paint used for minor tick drawing.
-
getCustomTicks
java.util.Map<java.lang.Double,java.lang.String> getCustomTicks()
Returns custom ticks with their respective position and label.- Returns:
- A map of custom tick positions and labels.
-
setCustomTicks
void setCustomTicks(java.util.Map<java.lang.Double,java.lang.String> positionsAndLabels)
Sets custom ticks with their respective position and label.- Parameters:
positionsAndLabels- A map of custom tick positions and labels.
-
getLabel
Label getLabel()
Returns the label of the axis.- Returns:
- Axis label.
-
setLabel
void setLabel(Label label)
Sets the label of the axis.- Parameters:
label- Axis label.
-
getLabelDistance
double getLabelDistance()
Returns the distance from the axis to the label.- Returns:
- Distance relative to font height.
-
setLabelDistance
void setLabelDistance(double distance)
Sets the distance from the axis to the label.- Parameters:
distance- Distance relative to font height.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG