|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjas.plot.AxisType
jas.plot.StringAxis
public final class StringAxis
This class simply displays a given array of strings. Use for a histogram with a string partition, or if there are very specific labels (numeric or other) you want on the axis. This class displays strings in two formats, represented by two static constants:
CENTER_TEXT_IN_DIVISION
: a tick mark and label will be centered in a divisionTEXT_BESIDE_DIVISION
: a tick mark and label will be on either side of a divisionUse the method setLabelPlacementStyle(int)
to change the setting.
Labels are displayed in the order as they appear in the array given to the method
setLabels(String[])
from left to right on a horizontal axis and from bottom to top
on a vertical axis.
CENTER_TEXT_IN_DIVISION
,
TEXT_BESIDE_DIVISION
,
setLabelPlacementStyle(int)
,
setLabels(String[])
,
Serialized FormField Summary | |
---|---|
static int |
CENTER_TEXT_IN_DIVISION
Represents a display style where a tick and label are centered in a division. |
static int |
TEXT_BESIDE_DIVISION
Represents a display style where a tick and label are on either side of a division. |
Fields inherited from class jas.plot.AxisType |
---|
axis |
Constructor Summary | |
---|---|
StringAxis()
Creates a new string axis type object, with labels and ticks centered in a division. |
|
StringAxis(int labelPlacementStyle)
Creates a new string axis type object. |
Method Summary | |
---|---|
double |
binWidth()
|
double |
convert(String s)
|
int |
getLabelPlacementStyle()
Returns the label placement style: either CENTER_TEXT_IN_DIVISION or
TEXT_BESIDE_DIVISION . |
String[] |
getLabels()
Returns the labels used for this axis. |
void |
readExternal(ObjectInput in)
|
void |
setLabelPlacementStyle(int labelPlacementStyle)
Sets the label placement style. |
void |
setLabels(String[] labels)
Sets the labels to display. |
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class jas.plot.AxisType |
---|
getAxis |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CENTER_TEXT_IN_DIVISION
public static final int TEXT_BESIDE_DIVISION
Constructor Detail |
---|
public StringAxis()
CENTER_TEXT_IN_DIVISION
public StringAxis(int labelPlacementStyle)
labelPlacementStyle
- how to place labels (supply either CENTER_TEXT_IN_DIVISION
or
TEXT_BESIDE_DIVISION
)CENTER_TEXT_IN_DIVISION
,
TEXT_BESIDE_DIVISION
Method Detail |
---|
public void setLabelPlacementStyle(int labelPlacementStyle)
CENTER_TEXT_IN_DIVISION
or
TEXT_BESIDE_DIVISION
.
CENTER_TEXT_IN_DIVISION
,
TEXT_BESIDE_DIVISION
public int getLabelPlacementStyle()
CENTER_TEXT_IN_DIVISION
or
TEXT_BESIDE_DIVISION
.
CENTER_TEXT_IN_DIVISION
,
TEXT_BESIDE_DIVISION
public void setLabels(String[] labels)
public String[] getLabels()
public double convert(String s)
convert
in interface StringCoordinateTransformation
public double binWidth()
binWidth
in interface StringCoordinateTransformation
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |