net.quies.math.plot
Class Axis

java.lang.Object
  extended by net.quies.math.plot.Axis
Direct Known Subclasses:
XAxis, YAxis

public abstract class Axis
extends Object

Represents one axis/dimension.

Since:
1.0
Author:
Pascal S. de Kloe

Method Summary
 float getLabelOffsetX()
          Gets the amount of horizontal space between each index label and their position on the axis.
 float getLabelOffsetY()
          Gets the amount of vertical space between each index label and their position on the axis.
 Paint getLabelPaint()
          Gets the paint of the index labels.
 float getNailLength()
          Gets the lenght of the index nails.
 Stroke getNailStroke()
          Gets the stroke for the index nails.
 Paint getPaint()
          Gets the paint of the axis and the index nails.
 int getPreferredSteps()
          Gets the preferred number of steps on the axis index.
 Stroke getStroke()
          Gets the stroke for the axis.
 BigDecimal getZigZaginess()
          Gets the minimal part of unused space needed to make a zig-zag in the axis.
 void setLabelOffsetX(float offset)
          Sets the amount of horizontal space between each index label and their position on the axis.
 void setLabelOffsetY(float offset)
          Sets the amount of vertical space between each index label and their position on the axis.
 void setLabelPaint(Paint paint)
          Sets the paint of the index labels.
 void setNailLength(float length)
          Sets the lenght of the index nails.
 void setNailStroke(Stroke stroke)
          Sets the stroke for the index nails.
 void setPaint(Paint paint)
          Sets the paint of the axis and the index nails.
 void setPreferredSteps(int steps)
          Sets the preferred number of steps on the axis index.
 void setStroke(Stroke stroke)
          Sets the stroke for the axis.
 void setZigZaginess(BigDecimal unusedPart)
          Sets the minimal part of unused space needed to make a zig-zag in the axis.
 String toString()
          Gets the short description as defined with the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setPaint

public final void setPaint(Paint paint)
Sets the paint of the axis and the index nails. The default is null which means that the foreground color will be used. Changes apply on the next paint.

Since:
1.0

getPaint

public final Paint getPaint()
Gets the paint of the axis and the index nails.

Since:
1.0

setLabelPaint

public final void setLabelPaint(Paint paint)
Sets the paint of the index labels. The default is null which means that the axis paint will be used. Changes apply on the next paint.

Since:
1.0

getLabelPaint

public final Paint getLabelPaint()
Gets the paint of the index labels.

Since:
1.0

setStroke

public final void setStroke(Stroke stroke)
Sets the stroke for the axis. Changes apply on the next paint.

Since:
1.0

getStroke

public final Stroke getStroke()
Gets the stroke for the axis.

Since:
1.0

setNailStroke

public final void setNailStroke(Stroke stroke)
Sets the stroke for the index nails. Changes apply on the next paint.

Since:
1.0

getNailStroke

public final Stroke getNailStroke()
Gets the stroke for the index nails.

Since:
1.0

setNailLength

public final void setNailLength(float length)
Sets the lenght of the index nails. The default is 6. Changes apply on the next render.

Since:
1.0

getNailLength

public final float getNailLength()
Gets the lenght of the index nails.

Since:
1.0

setLabelOffsetX

public final void setLabelOffsetX(float offset)
Sets the amount of horizontal space between each index label and their position on the axis.

Since:
1.0

getLabelOffsetX

public final float getLabelOffsetX()
Gets the amount of horizontal space between each index label and their position on the axis.

Since:
1.0

setLabelOffsetY

public final void setLabelOffsetY(float offset)
Sets the amount of vertical space between each index label and their position on the axis.

Since:
1.0

getLabelOffsetY

public final float getLabelOffsetY()
Gets the amount of vertical space between each index label and their position on the axis.

Since:
1.0

setPreferredSteps

public final void setPreferredSteps(int steps)
Sets the preferred number of steps on the axis index. There are two special cases. Zero will disable any labels and one will minimize the label usage to one at each end that is not connected to another axis. The default is 6. Changes apply on the next render.

Throws:
IllegalArgumentException - if steps is larger than 99.
Since:
1.0

getPreferredSteps

public final int getPreferredSteps()
Gets the preferred number of steps on the axis index.

Since:
1.0

setZigZaginess

public final void setZigZaginess(BigDecimal unusedPart)
Sets the minimal part of unused space needed to make a zig-zag in the axis. This feature is disabled by default. Changes apply on the next render.

Parameters:
unusedPart - use a value within interval [½, 1) or null to disable.
Since:
1.1

getZigZaginess

public final BigDecimal getZigZaginess()
Gets the minimal part of unused space needed to make a zig-zag in the axis.

Since:
1.1

toString

public final String toString()
Gets the short description as defined with the constructor.

Overrides:
toString in class Object