|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.graphics.chart.AxisAttributes
com.davisor.graphics.chart.ChartAxis
ChartAxis represents one chart coordinate axis that is a member of
a group of ChartAxes. In particular, each axis knows which
axes group it belongs to, and can revert back to the group for
example for default attribute values.
A chart axis extends the set of user configurable attributes defined by its superclass with the following attributes:
null
Please note, that the axis dimension names are case
sensitive, and therefore for example a dimension name "X" will
not be interpreted as a physical dimension. For more
information about axis dimension, please see ChartAxes.getAxis(int) method.
Orientation around several axes is also possible, with each axis contributing one orientation angle. When meaningfull, axis orientation angles should be applied in their dimension index order, starting from the X -axis (dimension zero).
Use getAngle() and setAngle(float) to access the
axis angle attribute.
Type. In particular, actual
data may be later laid along this axis by calling the computeValues(com.davisor.data.DataValue[]) method.
If the operation is successfull, the given value range string
attributes, if any, are converted to DataValue objects.
These objects can then be used to carry out various data value
computation operations in data type specific way.
Use getStringValue(int) and setStringValue(int, java.lang.String) to access the
generic axis value range attributes, and getDataValue(int) and
setDataValue(int, com.davisor.data.DataValue, boolean) to access the data values derived from them.
Use getTitleText() and setTitleText(java.lang.String) to access the
axis title attribute.Use getUnitTitle() and setUnitTitle(java.lang.String) to access the axis unit title attribute.
Axes are linked with combine(com.davisor.graphics.chart.ChartAxis) method. Please see the
documentation of that method for more information about how to link
axes together.
The linking mechanism complicates the processing and access of certain axis attributes that are derived from axis limit and step values. In particular, in order to keep the derived values up-to-date, a notification of any change in shared limit and step values must reach all the axes sharing them. In order to do this, all axes maintain a status indicator that tells when the derived values were last updated. Each time when an axis derived value is then requested, a check is made to see if axis status is up-to-date, and if it is not, the derived values are recomputed before returning their values.
computeValues(com.davisor.data.DataValue[]) method will be
called once. At the end of that method call, the original minimum,
maximum, and step attribute string values will be replaced with
string representations of the values the chart axis value resolver
finally ended up with. These string values are later used in
particular when axis label size requirements are estimated.
Chart axis objects are mutable, stateful objects that are modified in many other ways too during chart construction. In particular, a chart axis object carries the following transient attributes, derived from the chart data:
Axis minimum and maximum values define the axis value range. The step value defines the value change that represents one major value step along the axis. The number of steps tells into how many major value steps the axis is divided. Finally, the position tells where other axes should cross this axis, relative to current axis value range. Typically this coincides with axis zero value position, but not always.
min max
: axis value range :
-----------+------------------+-----------> axis values
: step : step : step : step values
... <0 ... 0 ... 0<1 ... 1 ... >1 ... axis position
The attributes derived from chart data may be accessed only after
the axis minimum and maximum data values have been determined and
applied to the axis with a call of the computeValues
method. Calling that method also resolves any proposed minimum and
maximum values that the axis might have been given earlier.
computeValues(com.davisor.data.DataValue[]),
ChartAxes,
Serialized Form| Field Summary | |
static double |
IMAXSTEPS
Inverted maximum number of steps (1/MAXSTEPS). |
static int |
LIMITS
Number of step value indexes. |
protected java.lang.Float |
M_angle
Rotation around axis (degrees). |
protected java.lang.String |
M_dim
Axis dimension. |
protected java.util.ArrayList |
M_markers
Marker lines. |
protected java.lang.String[] |
M_stringValue
Explicitly set string data values, if any (MIN,MAX,STEP). |
protected java.lang.String |
M_titleText
Axis title text string (may be null). |
protected java.lang.String |
M_unitTitle
Axis unit title text. |
static int |
MAX
Maximum value index. |
static int |
MAXSTEPS
Maximum number of steps on an axis (1000). |
static int |
MIN
Minimum value index. |
static int |
STEP
Step value index. |
| Fields inherited from class com.davisor.graphics.chart.AxisAttributes |
AFTER_KEYWORD, AFTER_VALUE, BEFORE_KEYWORD, BEFORE_VALUE, M_gap, M_gridLines, M_labelFormat, M_labelOffset, M_labelRotation, M_level, M_markerOffset, M_opposite, M_positionStringValue, M_render, M_reversed, M_silent, M_tic, M_titleOffset, M_titleRotation, MAX_KEYWORD, MAX_VALUE, MIN_KEYWORD, MIN_VALUE |
| Constructor Summary | |
ChartAxis(ChartAxis ca)
Deep copy constructor. |
|
ChartAxis(java.lang.String dim)
Creates a new axis. |
|
ChartAxis(java.lang.String dim,
AxisRenderAttributes render,
java.lang.String labelFormat,
java.lang.Number gap,
java.awt.Shape tic,
java.lang.Integer level,
java.lang.Boolean gridLines,
java.lang.String titleText,
java.lang.Float titleRotation,
java.lang.Float titleOffset,
java.lang.Float markerOffset,
java.lang.String unitTitle,
java.lang.Float labelRotation,
java.lang.Float labelOffset,
java.lang.Boolean opposite,
java.lang.Boolean reversed,
java.lang.Boolean silent,
java.lang.String position,
java.lang.Number angle,
java.lang.String min,
java.lang.String max,
java.lang.String step)
Creates a new fully configured axis. |
|
| Method Summary | |
void |
addMarker(AxisMarker marker)
Adds a marker to this axis. |
int |
bumpValue(boolean min,
int steps)
Bumps axis minimum or maximum values given number of steps away from each other. |
float |
bumpValue(float length,
float before,
float after)
Bumps axis minimum and maximum values a number of steps away from each other. |
protected void |
changeStep(DataValue newStep)
Changes current step value if not previously explicitly set to a specific value. |
void |
combine(ChartAxis axis)
Combines given axis with this if possible. |
protected void |
computeDerivedValues()
Computes axis derived values, and bring axis state up to date. |
protected void |
computePosition()
Computes axis position relative to current axis minimum and maximum values. |
protected void |
computeSample()
Computes and sets limit value sample. |
protected void |
computeSteps()
Computes the number of steps between current minimum and maximum values, and current step value. |
void |
computeValues(DataValue[] limitValue)
Computes axis minimum, maximum, step, and position values. |
com.davisor.core.Dupable |
dup()
Duplicates this object. |
boolean |
equals(java.lang.Object object)
Tests if this axis equals to given axis. |
java.lang.Number |
getAngle()
Gets the axis angle. |
ChartAxes |
getAxes()
Gets the axes group that this axis belongs to. |
Type |
getDataType(int valueIndex)
Gets the axis value data type. |
DataValue |
getDataValue(int valueIndex)
Gets the axis value. |
float |
getDefaultPosition()
Gets axis default position value. |
java.lang.String |
getDim()
Gets axis dimension identifier. |
java.lang.Number |
getGap()
Gets the axis gap. |
java.lang.String |
getLabelFormat()
Gets axis label type specification. |
java.lang.Number |
getLabelOffset()
Gets the axis label offset. |
float |
getLabelOffset(float defaultOffset)
Gets the axis label offset. |
float |
getLabelRotation()
Gets label rotation in degrees. |
java.lang.Float |
getMarkerOffset()
Gets the axis marker offset. |
float |
getMarkerOffset(float defaultOffset)
Gets the axis marker offset. |
java.util.ArrayList |
getMarkers()
Returns reference to the markers list (may be NULL). |
float |
getPosition()
Gets the axis position value, as computed by computePosition().
|
java.lang.String |
getPositionStringValue()
Gets axis position. |
AxisRenderAttributes |
getRender()
Gets the axis render attributes. |
float |
getSteps()
Gets an estimate of the the number of axis steps. |
java.lang.String |
getStringValue(int valueIndex)
Gets the axis value. |
java.awt.Shape |
getTic()
Gets the axis tic mark. |
float[] |
getTitleBounds(java.awt.Font defaultFont)
Compute title bounds from current title font, text, and rotation. |
java.lang.Float |
getTitleOffset()
Gets the axis title offset. |
float |
getTitleOffset(float defaultOffset)
Gets the axis title offset. |
float |
getTitleRotation()
Gets title rotation in degrees. |
java.lang.String |
getTitleText()
Gets axis title text. |
java.lang.String |
getUnitTitle()
Gets the axis unit title text. |
java.lang.Boolean |
hasGridLines()
Tests if grid lines perpendicular to the axis are enabled. |
int |
hashCode()
Gets axis hash code. |
boolean |
hasStringValue(int valueIndex)
Tests if the axis value has been set. |
java.lang.Boolean |
isOpposite()
Gets the axis side. |
boolean |
isPositionSpecial()
Tests if the position returned by getPosition() is special.
|
java.lang.Boolean |
isReversed()
Gets the axis direction. |
boolean |
isShared()
Tests if this axis shares it's data value with another axis. |
java.lang.Boolean |
isSilent()
Tests axis silency. |
void |
reduceSteps(float steps)
Reduces the number of axis steps down to given number of steps. |
float |
reduceSteps(float availableSize,
float idealSize)
Reduces the number of axis steps if possible and usefull. |
protected void |
round()
Rounds limit values to the current step value. |
void |
setAngle(float angle)
Sets axis angle in degrees. |
void |
setAngle(java.lang.Number angle)
Sets axis angle in degrees. |
void |
setAxes(ChartAxes axes)
Sets the axes group that this axis belongs to. |
void |
setDataValue(int valueIndex,
DataValue dataValue,
boolean exact)
Sets an axis data value. |
void |
setDefaultPosition(float defaultPosition)
Sets axis default position value. |
void |
setDim(java.lang.String dim)
Sets axis dimension identifier. |
void |
setRender(AxisRenderAttributes render)
Sets the axis render attributes. |
void |
setStringValue(int valueIndex,
java.lang.String stringValue)
Sets the axis value. |
void |
setTitleText(java.lang.String titleText)
Sets the axis title text. |
void |
setUnitTitle(java.lang.String unitTitle)
Sets the axis unit title text. |
java.lang.String |
toString()
Gets axis XML representation. |
protected boolean |
wasSet(int valueIndex)
Tests if given axis value has been explicitly set. |
protected void |
wasSet(int valueIndex,
boolean wasSet)
Sets if given axis value has been explicitly set. |
| Methods inherited from class com.davisor.graphics.chart.AxisAttributes |
getLevel, isOppositeDefault, isReversedDefault, isSilentDefault, setGap, setGap, setGridLines, setGridLines, setLabelFormat, setLabelOffset, setLabelOffset, setLabelRotation, setLabelRotation, setLevel, setMarkerOffset, setMarkerOffset, setOpposite, setOpposite, setPositionStringValue, setReversed, setReversed, setSilent, setSilent, setTic, setTitleOffset, setTitleOffset, setTitleRotation, setTitleRotation |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int MIN
public static final int MAX
public static final int STEP
public static final int LIMITS
public static final int MAXSTEPS
public static final double IMAXSTEPS
protected java.lang.Float M_angle
protected java.lang.String M_dim
protected java.util.ArrayList M_markers
protected java.lang.String[] M_stringValue
protected java.lang.String M_titleText
protected java.lang.String M_unitTitle
| Constructor Detail |
public ChartAxis(java.lang.String dim)
Please note, that the dimension identifiers are case sensitive, and therefore for example a dimension name "X" is not the same is dimension name "x".
dim - the dimension this axis representssetDim(java.lang.String),
ChartAxes.getAxis(int)public ChartAxis(ChartAxis ca)
dup(),
setAxes(com.davisor.graphics.chart.ChartAxes)
public ChartAxis(java.lang.String dim,
AxisRenderAttributes render,
java.lang.String labelFormat,
java.lang.Number gap,
java.awt.Shape tic,
java.lang.Integer level,
java.lang.Boolean gridLines,
java.lang.String titleText,
java.lang.Float titleRotation,
java.lang.Float titleOffset,
java.lang.Float markerOffset,
java.lang.String unitTitle,
java.lang.Float labelRotation,
java.lang.Float labelOffset,
java.lang.Boolean opposite,
java.lang.Boolean reversed,
java.lang.Boolean silent,
java.lang.String position,
java.lang.Number angle,
java.lang.String min,
java.lang.String max,
java.lang.String step)
throws com.davisor.core.InvalidKeyException
Please note, that the dimension identifiers are case sensitive, and therefore for example a dimension name "X" is not the same is dimension name "x".
dim - axis dimensionrender - render attributes (may be null)labelFormat - axis label type specification (may be null)gap - gap (percents, may be null)tic - tic mark shape (may be null)level - tic mark recursion levelgridLines - enable or disable grid lines (may be null)titleText - title text (may be null)titleRotation - title rotation (degrees,may be null)titleOffset - axis title offset (may be null)markerOffset - axis marker offset (may be null)unitTitle - axis unit text (may be null)labelRotation - axis label rotation (degrees,may be null)labelOffset - axis label offset (may be null)opposite - axis side (may be null)reversed - axis growth direction (may be null)silent - suppress axis labels (may be null)position - axis position (may be null)angle - rotation around axis (degrees, may be null)min - axis scale minimum value (may be null)max - axis scale maximum value (may be null)step - axis scale step value (may be null)setDim(java.lang.String),
ChartAxes.getAxis(int)| Method Detail |
public java.lang.Number getGap()
null is returned.
getGap in class AxisAttributesAxisAttributes.getGap(),
AxisAttributes.setGap(float)public java.lang.Number getLabelOffset()
null is returned.
If this axis shares label offset with another axis, the offset value is fetched from the other axis instance.
getLabelOffset in class AxisAttributesgetLabelOffset(float)public float getLabelOffset(float defaultOffset)
If this axis shares label offset with another axis, the offset value is fetched from the other axis instance.
getLabelOffset in class AxisAttributesdefaultOffset - default offset to be used if the offset has
not been setgetLabelOffset()public float getLabelRotation()
Use Units to convert the angle value to other angle
units.
getLabelRotation in class AxisAttributesAxisAttributes.setLabelRotation(float),
AxisAttributes.setLabelRotation(Number),
Unitspublic java.lang.String getPositionStringValue()
null is
returned.
getPositionStringValue in class AxisAttributesAxisAttributes.setPositionStringValue(java.lang.String)public AxisRenderAttributes getRender()
null is returned.
If this axis and the axis group it belongs to have both a set of render attributes, the attributes in axis attribute set default to axis group attributes.
getRender in class AxisAttributessetRender(com.davisor.graphics.chart.AxisRenderAttributes),
AxisAttributes.getRender(),
AxisAttributes.setRender(com.davisor.graphics.chart.AxisRenderAttributes),
AxisAttributes.getRender(),
ChartFactorypublic java.lang.String getLabelFormat()
null is returned.
getLabelFormat in class AxisAttributesAxisAttributes.getLabelFormat(),
AxisAttributes.setLabelFormat(java.lang.String)public java.lang.Float getMarkerOffset()
null is returned.
If this axis shares marker offset with another axis, the offset value is fetched from the other axis instance.
getMarkerOffset in class AxisAttributesgetMarkerOffset(float)public float getMarkerOffset(float defaultOffset)
If this axis shares marker offset with another axis, the offset value is fetched from the other axis instance.
getMarkerOffset in class AxisAttributesdefaultOffset - default offset to be used if the offset has
not been setgetMarkerOffset()public java.awt.Shape getTic()
null is returned.
getTic in class AxisAttributesAxisAttributes.getTic(),
AxisAttributes.setTic(java.awt.Shape)public java.lang.Float getTitleOffset()
null is returned.
If this axis shares title offset with another axis, the offset value is fetched from the other axis instance.
getTitleOffset in class AxisAttributesgetTitleOffset(float)public float getTitleOffset(float defaultOffset)
If this axis shares title offset with another axis, the offset value is fetched from the other axis instance.
getTitleOffset in class AxisAttributesdefaultOffset - default offset to be used if the offset has
not been setgetTitleOffset()public float getTitleRotation()
Use Units to convert the angle value to other angle
units.
getTitleRotation in class AxisAttributesAxisAttributes.setTitleRotation(float),
AxisAttributes.setTitleRotation(Number),
Unitspublic java.lang.Boolean hasGridLines()
null is returned.
hasGridLines in class AxisAttributesAxisAttributes.setGridLines(Boolean)public java.lang.Boolean isOpposite()
null is returned.
isOpposite in class AxisAttributesAxisAttributes.isOpposite(),
AxisAttributes.setOpposite(boolean),
AxisAttributes.setOpposite(Boolean)public java.lang.Boolean isReversed()
null is returned.
isReversed in class AxisAttributesAxisAttributes.isReversed(),
AxisAttributes.setReversed(boolean),
AxisAttributes.setReversed(Boolean)public java.lang.Boolean isSilent()
null is
returned.
isSilent in class AxisAttributesAxisAttributes.isSilent(),
AxisAttributes.setSilent(boolean),
AxisAttributes.setSilent(Boolean)public void setRender(AxisRenderAttributes render)
setRender in class AxisAttributesgetRender(),
AxisAttributes.setRender(com.davisor.graphics.chart.AxisRenderAttributes)public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupabledup in class AxisAttributespublic boolean equals(java.lang.Object object)
equals in class AxisAttributespublic int hashCode()
hashCode in class AxisAttributespublic java.lang.String toString()
toString in class AxisAttributesAxisAttributes.toString(),
Strings.toXML(String,Object)protected void changeStep(DataValue newStep)
newStep - a new step value to replace the oldgetDataValue(int),
round(),
setDataValue(int, com.davisor.data.DataValue, boolean)protected void computeDerivedValues()
Axis derived values are the number of steps, axis position, and
format sample. Number of steps is computed with computeSteps(), position with computePosition(). Format
sample is computed by multiplying current step value by three.
Axis steps and position are stored in internal variables, from
where they can be accessed with getSteps() and getPosition(), respectively. Axis format sample value is stored
in axis minimum and maximum value types, assuming they are
instances of FormatType that supports the concept of
format samples. If they do no, sample value is ignored.
computePosition(),
computeSample(),
computeSteps(),
getDataValue(int),
getPosition(),
getSteps(),
FormatType.setSample(java.lang.Object)protected void computeSample()
SimpleNumberType.createFormatter().
computeDerivedValues(),
computeValues(com.davisor.data.DataValue[])protected void computeSteps()
ChartAxis.MAXSTEPS). The result may however
be negative, indicating that current axis maximum value is
smaller than current minimum value.
The number of steps is resolved by deinterpolating the value
min+step against the value range axis minimum and
maximum value span. This result may become zero for example if
axis minimum and maximum values are equal. In this case a warning
message is printed to system error channel, and the number of
steps is set to 1.0.
The number of steps mat exceed the maximum allowed number of
steps for example if axis step value magnitude is too small
compared to the value range axis minimum and maximum values
span. In this case a warning message is printed to system error
channel, and the number of steps is set to equal to
MAXSTEPS or -1.0 * MAXSTEPS, depending
on steps value sign.
computeDerivedValues(),
computePosition(),
getSteps(),
DataValue.deinterpolate(com.davisor.data.DataValue, com.davisor.data.DataValue)protected void computePosition()
Position values outside the range [0,1] indicate special axis position: a value below zero indicates a position as far below axis minimum value as possible in given context. Likewise, a value above one indicates a position as far above axis maximum value as possible. In axis rendering for example, this indicates that an axis should be drawn at the edge of plotting area, even if the axis would fall outside the valid value range.
The crossing position can be controlled in several ways. First,
if axis position string member variable contains
values "min" or "max", the position
will be at axis minimum or maximum end,
respectively. "before" or "after" will
place the position before or after the axis minimum or maximum
end. Any other value will be interpreted as a data value that
identifies a point along the axis. A null position
value (the default) places crossing axes at the axis specific
default value, typically zero (see setDefaultPosition(float)).
If after the above evaluation the position value would fall
outside the range [0,1], the position becomes special. The actual
position value is then cropped back to the range [0,1], but the
special status is remembered, and it can later be checked with
the isPositionSpecial() method.
If axis value range does not include zero, the crossing axes are
placed to the axis end nearer to the zero value. If axis
direction is reversed (see AxisAttributes.isReversedDefault()), the zero
position is mirrored, too.
computeDerivedValues(),
computeSteps(),
getPosition(),
isPositionSpecial(),
setDefaultPosition(float)
protected void round()
throws InvalidDataException
Basic limit value rounding is done with limit value data type
specific DataValue.ceil(DataValue) and DataValue.floor(DataValue) methods.
InvalidDataException - if rounding failsprotected boolean wasSet(int valueIndex)
If this axis shares a data range with another axis, the status is queried from the other axis instance.
valueIndex - one of MIN, MAX, or STEPwasSet(int,boolean)
protected void wasSet(int valueIndex,
boolean wasSet)
If this axis shares a data range with another axis, the status is set for the other axis instance.
valueIndex - one of MIN, MAX, or STEPwasSet - indicator that axis value has been explicitly set or notwasSet(int)public void addMarker(AxisMarker marker)
marker - the marker to be addedgetMarkers()
public int bumpValue(boolean min,
int steps)
Successfull bumping will increase the current number of steps. Axis position will also be recomputed.
min - if true, bump minimum value, otherwise bump
maximum valuesteps - the number of steps to bump
bumpValue(float,float,float),
computePosition()
public float bumpValue(float length,
float before,
float after)
The number of steps to bump axis with is computed from a length
value that describes an abstract distance between current minimum
and maximum values, and the length values that describe how much
of the new length is to be allocated for new steps. In
particular, if length is chosen to be 100 units,
before and after tell how
many percents the new steps will take from the total new length after
new steps have been added.
For example, if the axis currently has 8 steps, and length and the overflow aguments values are set to 100, 10, and 10, one new step will be added on either end, resulting 10 steps in total. The one new step on either side then represents 10% of all steps, as requested.
After both sides have been bumped, axis unit step is recomputed, if not explicitly set earlier. The number of axis steps is also updated, if neccessary.
Argument values are expecteed to be non-negative values. The
value of before and after
must be less than length value.
length - length of the area between minimum and maximum valuesbefore - length of the area extending beyond minimum limit valueafter - length of the area extending beyond maximum limit value
bumpValue(boolean,int),
computePosition()
public void combine(ChartAxis axis)
throws com.davisor.core.MismatchException
Combination, if successfull, will replace the current limit and step values of this axis, and make the other axis to refer to this one as the primary source for limit and step value information. Any changes to the new shared limit and step values will thereafter affect both of these axes.
It is also possible to share limit and step values among more than two axes. In particular, if this axis already shares limit and step values with some other axes, all value sharing operations will target those already shared values, and therefore affect all the axes already sharing their limit and step values. An axis may however only belong to only one group of axes sharing ther limit and step values.
axis - axis to combine this axis with (may be null)
com.davisor.core.MismatchException - if the two axes can not be combined
public void computeValues(DataValue[] limitValue)
throws InvalidDataException
The given limit value objects are made private members to this axis object. The limit value objects should therefore not be referenced from the outside after this method returns.
The data types of the given data values are also modified by this method, by applying axis type specifications to them. The resulting types are then used to interpret the axis minimum, maximum and step value strings. The same types may also be used later to compose axis data value labels.
When axis steps is resolved, the resulting step data value is normalized by substracting data type specific zero value from it. This allows step value to be entered like any other data value, using the same format than axis minimum and maximum values.
It is worth noting that badly chosen limit and step values may
result in a very large number of steps. To avoid such mistakes,
the axis has an inbuilt maximum number of steps that is given with
MAXSTEPS. See the class description for the value
of the maximum number of steps.
After calling this method, axis steps and position values can be
retrieved by the getSteps() and getPosition()
methods, respectively.
limitValue - axis minimum and maximum data
values, with [ChartAxis.MIN,ChartAxis.MAX] as index
InvalidDataException - if value computation failscomputeSample(),
getPosition(),
getSteps(),
AxisFactory.resolveLimits(com.davisor.graphics.chart.ChartDataSummary)public java.lang.Number getAngle()
setAngle(float),
setAngle(Number)public ChartAxes getAxes()
setAxes(com.davisor.graphics.chart.ChartAxes)
public Type getDataType(int valueIndex)
throws InvalidDataException
null value indicates
that the value has not been set.
If axis current state does not match current target state, the current state is brough up-to-date before returning the (updated) value.
valueIndex - one of MIN, MAX, or STEP
InvalidDataException - if type retrieval failsgetStringValue(int),
hasStringValue(int),
setDataValue(int, com.davisor.data.DataValue, boolean),
setStringValue(int, java.lang.String)public DataValue getDataValue(int valueIndex)
null value indicates that the
value has not been set.
If this axis shares a data range with another axis, the data value is fetched from the other axis instance.
valueIndex - one of MIN, MAX, or STEPgetStringValue(int),
hasStringValue(int),
setDataValue(int, com.davisor.data.DataValue, boolean),
setStringValue(int, java.lang.String)public float getDefaultPosition()
computeValues(com.davisor.data.DataValue[]),
getPosition(),
setDefaultPosition(float)public java.lang.String getDim()
setDim(java.lang.String)public java.util.ArrayList getMarkers()
addMarker(com.davisor.graphics.chart.AxisMarker)public float getPosition()
computePosition().
Axis position is always returned without taking axis current reverse status into account. Instead, it is the responsibility of the caller to take appropriate actions if the axis is reversed (for example, use '1 - position').
If axis current state does not match current target state, the current state is brough up-to-date before returning the (updated) value.
computeDerivedValues(),
getSteps(),
isPositionSpecial()public float getSteps()
If axis current state does not match current target state, the current state is brough up-to-date before returning the (updated) value.
computeDerivedValues(),
getPosition()public java.lang.String getStringValue(int valueIndex)
null value indicates that the
value has not been set.
If this axis shares a data range with another axis, the string value is fetched from the other axis instance.
valueIndex - one of MIN, MAX, or STEPgetDataValue(int),
hasStringValue(int),
setDataValue(int, com.davisor.data.DataValue, boolean),
setStringValue(int, java.lang.String)public float[] getTitleBounds(java.awt.Font defaultFont)
defaultFont - title default font
public java.lang.String getTitleText()
setTitleText(java.lang.String)public java.lang.String getUnitTitle()
setUnitTitle(java.lang.String)public boolean hasStringValue(int valueIndex)
valueIndex - one of MIN, MAX, or STEPgetStringValue(int),
setStringValue(int, java.lang.String)public boolean isPositionSpecial()
getPosition() is special.
If it is, a position value 'zero' indicates that the position should
actually extend as far before the minimum value as possible in given
context. Likewise, a position value 'one' indicates that the position
should axterd as far after the maximum value as possible.
getPosition(),
computePosition()public boolean isShared()
ChartAxes.isShared(int)public void reduceSteps(float steps)
If any of the old limit or step values are have been set to exact values, none of them are changed. Instead, axis grid lines are turned off.
steps - number of steps to constrain axis value range tosetDataValue(int, com.davisor.data.DataValue, boolean),
DataValue.unit(com.davisor.data.DataValue, double)
public float reduceSteps(float availableSize,
float idealSize)
DataValue.unit(com.davisor.data.DataValue, double) method, and
installed with changeStep(com.davisor.data.DataValue) method. An estimate of the new
ideal size assumed to be proportional with the number of steps
reduced is returned.
availableSize - available sizeidealSize - ideal size
idealSize if not, less otherwise)changeStep(com.davisor.data.DataValue),
DataValue.unit(com.davisor.data.DataValue, double)public void setAngle(float angle)
The axis angle is typically used to define a sheare three-dimensional look for the charts. Other chart type specific uses are also possible, like with pie charts where the axis angle can be used to turn the pie around its center axis.
Use Units to convert the angle value to other angle
units.
getAngle(),
setAngle(Number),
Unitspublic void setAngle(java.lang.Number angle)
The axis angle is typically used to define a sheare three-dimensional look for the charts. Other chart type specific uses are also possible, like with pie charts where the axis angle can be used to turn the pie around its center axis.
Use Units to convert the angle value to other angle
units.
angle - new angle value (may be null)getAngle(),
setAngle(float),
Unitspublic void setAxes(ChartAxes axes)
An axis that has been attached to an axes group takes it's default attribute values from that group. Furthermore, axis render attributes default to corresponding axis group render attributes.
axes - axes group that provides default values for this axisgetAxes(),
RenderAttributes.setDefaults(com.davisor.graphics.RenderAttributes)
public void setDataValue(int valueIndex,
DataValue dataValue,
boolean exact)
null value indicates that
the value has not been set.
The new value may be treated as an exact or an approximate value. If the value is exact, later computations and optimizations may not alter the value even at the risk of unresolvable constrain conflicts. If the value is only approximate, automatic constrain resolvers are permitted to adjust it later.
If this axis shares a data range with another axis, the data value is assigned to the shared axis instance.
Changing an axis data value affects a number of axis internal values that are derived from it. And if axis data values are shared among other axes, a change in data values will affect them all, too. This may potentially require a great number of derived value updates.
To balance and reduce a number of updates requires, derived value recomputing does not place immediately. Instead, axis current target state is changed to mark the need for derived value update operations. Actual recomputing is then deferred until a derived value is really needed.
valueIndex - one of MIN, MAX, or STEPdataValue - value to be setexact - tells if value must not be computationally changedgetDataValue(int),
getStringValue(int),
hasStringValue(int),
setStringValue(int, java.lang.String)public void setDefaultPosition(float defaultPosition)
This parameter is not typically controlled directly by users, but
by different chart factories that may want to apply different
default axis value policies. For example, bar factory element
axis default position is BEFORE_VALUE, as the
typical default value MIN_VALUE would place the
value axis at the middle of the first bar.
defaultPosition - new axis position default valuecomputeValues(com.davisor.data.DataValue[]),
getDefaultPosition(),
getPosition(),
BarFactory.createContext(com.davisor.graphics.chart.ChartData, com.davisor.graphics.chart.ChartAttributes, com.davisor.graphics.chart.ChartAxes, short)public void setDim(java.lang.String dim)
Please note that if this axis is a member of an axis group, setting axis dimension may create an inconsistency between the dimensions the axis group and the axis itself have for the axis.
Please note also, that the dimension identifiers are case sensitive, and therefore for example a dimension name "X" is not the same is dimension name "x".
dim - axis new dimension identifier (may be null)getDim(),
ChartAxes.getAxis(int)
public void setStringValue(int valueIndex,
java.lang.String stringValue)
null value indicates that the
value has not been set. An value invalid for the type of data
dislayed along the axis will be ignored.
If this axis shares a data range with another axis, the string value is assigned to the shared axis instance.
valueIndex - one of MIN, MAX, or STEPstringValue - value to be setgetDataValue(int),
getStringValue(int),