public abstract class Axis
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Axis.Double |
static class |
Axis.Float |
static class |
Axis.Integer |
Modifier and Type | Field and Description |
---|---|
static java.awt.Color |
DEFAULT_AXIS_COLOR |
static java.lang.String |
DEFAULT_DUMMY_LABEL |
static java.awt.Font |
DEFAULT_FONT |
static java.awt.Color |
DEFAULT_LABEL_COLOR |
static int |
DEFAULT_LABEL_TO_MARKER_DISTANCE |
static boolean |
DEFAULT_LABEL_VERTICAL |
static java.awt.Color |
DEFAULT_MARKER_COLOR |
static int |
DEFAULT_MARKER_HEIGHT |
Modifier | Constructor and Description |
---|---|
protected |
Axis()
Creates a horizontal axis
|
protected |
Axis(boolean vertical)
Creates an axis with the specified orientation (
true for vertical) |
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getAxisColor() |
java.lang.String |
getDummyLabel() |
abstract java.lang.String |
getLabel(int marker) |
java.awt.Color |
getLabelColor() |
java.awt.Font |
getLabelFont() |
int |
getLabelStepSize() |
int |
getLabelToMarkerDistance() |
java.awt.Color |
getMarkerColor() |
int |
getMarkerCount() |
int |
getMarkerHeight() |
double |
getMarkerLocation(int index)
Returns the relative location of the marker at position
index . |
double |
getMarkerStepSize() |
double |
getMaxValue() |
double |
getMinValue() |
double |
getRange() |
int |
getRequiredHeight(java.awt.Graphics g) |
int |
getRequiredWidth(java.awt.Graphics g) |
boolean |
isLabelVertical() |
boolean |
isPaintLabels() |
boolean |
isVertical() |
void |
paint(java.awt.Graphics graphics,
java.awt.Rectangle area) |
void |
setAxisColor(java.awt.Color axisColor) |
void |
setDummyLabel(java.lang.String dummyLabel) |
void |
setLabelColor(java.awt.Color labelColor) |
void |
setLabelFont(java.awt.Font labelFont) |
void |
setLabelStepSize(int labelStepSize) |
void |
setLabelToMarkerDistance(int labelToMarkerDistance) |
void |
setLabelVertical(boolean labelVertical) |
void |
setMarkerColor(java.awt.Color markerColor) |
void |
setMarkerHeight(int markerHeight) |
protected void |
setMarkerStepSize0(double markerStepSize) |
protected void |
setMaxValue0(double maxValue) |
protected void |
setMinValue0(double minValue) |
void |
setPaintLabels(boolean paintLabels) |
int |
translate(double value,
int range) |
double |
translate(int value,
int range) |
public static final int DEFAULT_LABEL_TO_MARKER_DISTANCE
public static final int DEFAULT_MARKER_HEIGHT
public static final java.lang.String DEFAULT_DUMMY_LABEL
public static final java.awt.Font DEFAULT_FONT
public static final java.awt.Color DEFAULT_AXIS_COLOR
public static final java.awt.Color DEFAULT_MARKER_COLOR
public static final java.awt.Color DEFAULT_LABEL_COLOR
public static final boolean DEFAULT_LABEL_VERTICAL
protected Axis()
protected Axis(boolean vertical)
true
for vertical)vertical
- public boolean isPaintLabels()
public void setPaintLabels(boolean paintLabels)
paintLabels
- the paintLabels to setpublic java.awt.Font getLabelFont()
public void setLabelFont(java.awt.Font labelFont)
labelFont
- the labelFont to setpublic int getMarkerHeight()
public int getLabelToMarkerDistance()
public java.lang.String getDummyLabel()
public void setMarkerHeight(int markerHeight)
markerHeight
- the markerHeight to setpublic void setLabelToMarkerDistance(int labelToMarkerDistance)
labelToMarkerDistance
- the labelToMarkerDistance to setpublic void setDummyLabel(java.lang.String dummyLabel)
dummyLabel
- the dummyLabel to setpublic java.awt.Color getAxisColor()
public java.awt.Color getMarkerColor()
public java.awt.Color getLabelColor()
public void setAxisColor(java.awt.Color axisColor)
axisColor
- the axisColor to setpublic void setMarkerColor(java.awt.Color markerColor)
markerColor
- the markerColor to setpublic void setLabelColor(java.awt.Color labelColor)
labelColor
- the labelColor to setpublic double getRange()
public boolean isVertical()
public boolean isLabelVertical()
public double getMinValue()
public double getMaxValue()
public double getMarkerStepSize()
public int getLabelStepSize()
public void setLabelVertical(boolean labelVertical)
labelVertical
- the labelVertical to setpublic void setLabelStepSize(int labelStepSize)
labelStepSize
- the labelStepSize to setpublic int getRequiredWidth(java.awt.Graphics g)
public int getRequiredHeight(java.awt.Graphics g)
public void paint(java.awt.Graphics graphics, java.awt.Rectangle area)
public double getMarkerLocation(int index)
index
.
The first marker (with index 0) is at the left most location in case the
axis is horizontal, and at the bottom most location if it is vertical.
Returned values are in the range 0 to 1, spanning the respective axis of
the paint area with 0 located at the top or left border, depending on axis
orientation.marker
- public int getMarkerCount()
public double translate(int value, int range)
public int translate(double value, int range)
public abstract java.lang.String getLabel(int marker)
protected void setMinValue0(double minValue)
protected void setMaxValue0(double maxValue)
protected void setMarkerStepSize0(double markerStepSize)