|
|||||||||||
| 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.ChartAxes
ChartAxes represents a set of ChartAxis that define the
coordinate space of a chart. Each axis in axis set will have a
number of attributes of it's own, and all those attributes will
default to corresponding axes group default attributes, except for
those attributes for which there can be no meaningfull common
axis set wide default values.
Axes group inherits all attributes it is capable of giving a meaningfull
default value for from it's super-class AxisAttributes. An axis
group has also the following attributes of it's own:
setRender(com.davisor.graphics.chart.AxisRenderAttributes),
AxisFactory,
ChartAxis,
Serialized Form| Field Summary | |
static int |
CATEGORY
Category axis index (0). |
static java.lang.String[] |
LOGICALDIMENSIONS
Names for logical dimensions. |
protected java.util.Map |
M_axes
Axes beloning to this axes group, keyed to their 'dim' attribute. |
protected java.lang.String |
M_chartType
The chart type drawn into this axis group. |
protected java.lang.String |
M_dataGroup
The chart data group drawn into this axis group. |
protected java.util.Map |
M_dims
Custom axis dimension mapping. |
protected PlotRenderAttributes |
M_plot
Axis render attributes. |
protected java.lang.String[] |
M_viewport
Viewport shape namespace and id. |
static java.lang.String[] |
PHYSICALDIMENSIONS
Names for dimensions. |
static int |
SERIES
Series axis index (2). |
static int |
VALUE
Value axis index (1). |
static int |
X
X-axis index (0). |
static int |
Y
Y-axis index (1). |
static int |
Z
Z-axis index (2). |
| 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 | |
ChartAxes()
Default constructor. |
|
ChartAxes(AxisRenderAttributes render,
PlotRenderAttributes plot,
java.lang.String type,
java.lang.Number gap,
java.awt.Shape tic,
java.lang.Integer level,
java.lang.Boolean gridLines,
java.lang.Float titleRotation,
java.lang.Float titleOffset,
java.lang.Float markerOffset,
java.lang.Float labelRotation,
java.lang.Float labelOffset,
java.lang.Boolean opposite,
java.lang.Boolean reversed,
java.lang.Boolean silent,
java.lang.String position)
Creates new axes. |
|
ChartAxes(ChartAxes ca)
Deep copy constructor. |
|
| Method Summary | |
void |
addAxis(ChartAxis axis)
Adds an axis to this axis group. |
void |
computeValues(DataValue[][] limitValues)
Computes axis minimum, maximum, step, and zero data values. |
com.davisor.core.Dupable |
dup()
Duplicates this object. |
boolean |
equals(java.lang.Object object)
Test if these axes equal to given axes. |
ChartAxis |
getAxis(int dim)
Gets specific axis. |
java.lang.String |
getChartType()
Gets axes specific chart factory type. |
java.lang.String |
getDataGroup()
Gets axes specific chart data group. |
java.lang.String |
getDim(int dim)
Gets a conseptual dimension associated to given physical dimension. |
PlotRenderAttributes |
getPlot()
Gets axis specific plot render attributes. |
java.awt.Shape |
getViewport()
Returns viewport shape or null.
|
boolean |
isIsometric()
Tests if axes define isometric projection. |
boolean |
isShared(int dim)
Tests if given axis is shared with another axis group. |
ChartAxis |
removeAxis(java.lang.String dim)
Removes the given dimension axis from this group. |
void |
setCategoryAxis(int dim)
This utility method configures this axis group category and value axis conceptual dimensions. |
void |
setChartType(java.lang.String chartType)
Sets axes specific chart factory type. |
void |
setDataGroup(java.lang.String dataGroup)
Sets axes specific chart data group. |
void |
setDim(int dim,
java.lang.String conceptualDim)
Associates a conceptual dimension to given physical dimension. |
void |
setPlot(PlotRenderAttributes plot)
Sets axis specific plot render attributes. |
void |
setRender(AxisRenderAttributes render)
Sets axes render attributes. |
void |
setViewport(java.lang.String namespace,
java.lang.String shapeId)
Sets the viewport using a shape. |
java.lang.String |
toString()
Gets axes XML representation. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int X
public static final int Y
public static final int Z
public static final int CATEGORY
public static final int VALUE
public static final int SERIES
public static final java.lang.String[] PHYSICALDIMENSIONS
public static final java.lang.String[] LOGICALDIMENSIONS
protected java.util.Map M_axes
protected java.util.Map M_dims
protected java.lang.String M_chartType
protected java.lang.String M_dataGroup
protected PlotRenderAttributes M_plot
protected java.lang.String[] M_viewport
| Constructor Detail |
public ChartAxes()
public ChartAxes(ChartAxes ca)
dup()
public ChartAxes(AxisRenderAttributes render,
PlotRenderAttributes plot,
java.lang.String type,
java.lang.Number gap,
java.awt.Shape tic,
java.lang.Integer level,
java.lang.Boolean gridLines,
java.lang.Float titleRotation,
java.lang.Float titleOffset,
java.lang.Float markerOffset,
java.lang.Float labelRotation,
java.lang.Float labelOffset,
java.lang.Boolean opposite,
java.lang.Boolean reversed,
java.lang.Boolean silent,
java.lang.String position)
render - axis render attributes (may be null)plot - axis group specific plot render attributes (may be null)type - label type (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)titleRotation - title rotation (may be null)titleOffset - axis title offset (may be null)markerOffset - axis marker offset (may be null)labelRotation - axis label rotation (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)| Method Detail |
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 java.lang.String toString()
toString in class AxisAttributesAxisAttributes.toString(),
Strings.toXML(String,Object)public boolean isShared(int dim)
If the given argument refers to an axis that does not yet axis,
a new axis for that dimension is created as a side-effect, as describe
in the getAxis(int) method documentation. New axes are however
never shared, so the result for this method in those cases will
always be false.
dim - axis dimensiongetAxis(int),
ChartAxis.isShared()public void addAxis(ChartAxis axis)
ChartAxis.getDim() method. The axis is also joined to this axis
group with a call to axis object ChartAxis.setAxes(com.davisor.graphics.chart.ChartAxes)
method.
If this axis group already contains an axis keyed to the new axis
dimension, the new axis replaces the old axis. If the new axis
dimension is null, the first still unused integer
dimension ("0", "1", ...) is assigned to the new axis.
Please see getAxis(int) for what kind of axis dimension
strings are expected, and setDim(int, java.lang.String) for how to configure
the axis group to support custom dimension values.
axis - new axis (may be null)getAxis(int),
setDim(int, java.lang.String),
removeAxis(java.lang.String)
public void computeValues(DataValue[][] limitValues)
throws InvalidDataException
This method distributes the given limit values to each axis belonging
to this axis group. The axes will then compute their own values with
ChartAxis.computeValues(com.davisor.data.DataValue[]) method.
limitValues - array of axis minimum, maximum, and unit data
values ([x,y,...][min,max,unit])
InvalidDataException - if data limit value computation failsAxisFactory.resolveLimits(com.davisor.graphics.chart.ChartDataSummary),
ChartAxis.computeValues(com.davisor.data.DataValue[]),
ChartFactory.createSummary(com.davisor.graphics.chart.ChartData, com.davisor.graphics.chart.ChartAttributes, com.davisor.graphics.chart.ChartAxes, com.davisor.graphics.chart.PlotRenderAttributes, com.davisor.data.EnumType, int[], boolean, int[])public ChartAxis getAxis(int dim)
The given integer dimension argument is mapped to the different dimension value types as follows:
getDim(int)
If all of the above methods fail to match an axis, a new default axis is created, stored under corresponding integer key, and returned.
dim - axis dimension
addAxis(com.davisor.graphics.chart.ChartAxis),
getDim(int),
removeAxis(java.lang.String)public java.lang.String getChartType()
public java.lang.String getDataGroup()
public java.lang.String getDim(int dim)
setDim(int, java.lang.String) method. If that gives no
result, the following default mapping is attempted:
If none of these methods give any result, null is returned.
dim - physical dimension
getAxis(int),
setDim(int, java.lang.String)public PlotRenderAttributes getPlot()
Chart initializers are expected to arrange default value
dependency relations between axes specific plot attributes and
general ChartAttributes.getPlot() attributes. This allows
chart factories to always use only axes specific plot attributes,
returned by this method, as they can now rely on that any plot
attributes not defined separately for a specific axes will
default back to the global plot attributes, common to all axis
groups. In practice this all means that chart initializers are
expected to apply PlotRenderAttributes.setDefaults(com.davisor.graphics.chart.PlotRenderAttributes) method
to the plot render attributes instance returned by this method at
some point before this object is used for chart generation.
setPlot(com.davisor.graphics.chart.PlotRenderAttributes),
ChartAttributes.getAxes(),
ChartAttributes.getPlot()public java.awt.Shape getViewport()
null.
Viewport shape defines how shape coordinates (especially in map chart)
are translated and scaled into chart image pixels.
setViewport(java.lang.String, java.lang.String)public boolean isIsometric()
public ChartAxis removeAxis(java.lang.String dim)
null
with a call to ChartAxis.setAxes(com.davisor.graphics.chart.ChartAxes) method.
dim - axis dimension (may be null)
addAxis(com.davisor.graphics.chart.ChartAxis),
getAxis(int)public void setCategoryAxis(int dim)
0 or 1, corresponding to
physical axes x or y, respectively.
The given physical axis dimension will then be mapped to
category conceptual axis, and the other X or Y axis
is mapped to value conceptual axis.
For more elaborate custom axis dimension configuration, use
setDim(int, java.lang.String) method.
@param dim physical dimension to be mapped to category dimension (0 or 1)
setDim(int, java.lang.String)public void setChartType(java.lang.String chartType)
public void setDataGroup(java.lang.String dataGroup)
public void setDim(int dim,
java.lang.String conceptualDim)
dim - physical dimensionconceptualDim - conceptual dimensiongetAxis(int),
getDim(int)public void setPlot(PlotRenderAttributes plot)
plot - axis group specific plot render attributes (may be null)getPlot()public void setRender(AxisRenderAttributes render)
If the given render attributes are null, a fresh
copy of the chart factory default render attributes will be
installed.
setRender in class AxisAttributesrender - new render default attributes (may be null)AxisAttributes.getRender()
public void setViewport(java.lang.String namespace,
java.lang.String shapeId)
getViewport().
getViewport()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||