|
ChartCat 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectli.netcat.chart.util.AbstractPart
li.netcat.chart.util.GraphPart
Abstract super class of all parts that paint a graph. This class is the
owner of the GraphLook
and the ChartModel
. As the following figure shows,
several other models are derived from the ChartModel
:
During the construction phase, this GraphPart
crates a new and empty ChartModel
.
It also allocates default implementations of all derived models and connects
them to the ChartModel
. The following list clarifies the purpose of these models:
ChartModel
is the source of all dynamic data. It defines
the number of row and columns as well as its values and other arbitrary text.
LegendModel
provides the data for the legend. The
default implementation uses the names of the columns.
StackModel
calculates the minimum and maximum numeric value
of the graph which depend on the type of stacked values. It also provides the "lead" and "trail"
of all numeric values in the ChartModel
.
NumericScaleModel
calculates the final paint position. It is the
assignment of the NumericScaleModel
to calculate rounded minimum and maximum values so that
the scale does not start at -2.3452 and ends at 4.5433 but uses for example -3 and 5 as lower
and upper bounds. It also provides the number and position of its marks. It finally calculates
the position of an arbitrary value in the scale. Beside the default linear scale, a logarithmic
(or any other) scale can be used to visualize exponential data.
ScaleModel
provides the second dimension of the graph (referred to as discreet scale model).
The default implementation uses the names of the rows.
Field Summary | |
static int |
STACK_STRATEGY_APPEND
Equal to ChartConstants.STACK_STRATEGY_APPEND |
static int |
STACK_STRATEGY_GROUP
Equal to ChartConstants.STACK_STRATEGY_GROUP |
static int |
STACK_TYPE_NOT_STACKED
Equal to ChartConstants.STACK_TYPE_NOT_STACKED |
static int |
STACK_TYPE_STACKED
Equal to ChartConstants.STACK_TYPE_STACKED |
static int |
STACK_TYPE_STACKED_PERCENT
Equal to ChartConstants.STACK_TYPE_STACKED_PERCENT |
Fields inherited from class li.netcat.chart.util.AbstractPart |
BACKGROUND, FOREGROUND, PERSPECTIVE |
Constructor Summary | |
GraphPart(int stackType,
int stackStrategy,
boolean centered)
Constructs a new GraphPart and uses the given parameters to allocate the
default models. |
Method Summary | |
ChartModel |
getChartModel()
Returns the current chart model. |
protected float |
getDiscreetLength()
Utility method for subclasses that returns the length of the discreet scale model. |
ScaleModel |
getDiscreetScaleModel()
Returns the discreet scale model. |
GraphLook |
getGraphLook()
Returns the look of the graph. |
LegendModel |
getLegendModel()
Returns the current legend model. |
protected float |
getNumericLength()
Utility method for subclasses that returns the length of the numeric scale model. |
NumericScaleModel |
getNumericScaleModel()
Returns the numeric scale model. |
StackModel |
getStackModel()
Returns the current installed stack model. |
abstract ValueLocation |
getValueLocation(int rowIndex,
int columnIndex)
Abstract function that calculates a ValueLocation for a given cell. |
void |
setChartModel(ChartModel chartModel)
Sets the chart model that provides all dynamic data. |
protected void |
setDiscreetLength(float length)
Utility method for subclasses to set the length of the discreet scale model. |
void |
setDiscreetScaleModel(ScaleModel discreetScaleModel)
Sets a new instance of the discreet scale model. |
void |
setGraphLook(GraphLook graphLook)
Sets the look of the graph. |
void |
setLegendModel(LegendModel legendModel)
Sets a new legend model. |
protected void |
setNumericLength(float length)
Utility method for subclasses to set the length of the numeric scale model. |
void |
setNumericScaleModel(NumericScaleModel numericScaleModel)
Sets a new instance of the numeric scale model. |
void |
setStackModel(StackModel stackModel)
Sets a new stack model. |
Methods inherited from class li.netcat.chart.util.AbstractPart |
getChart, getPerspective, invalidate, setChart, setPerspective |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface li.netcat.chart.Part |
getLayout |
Field Detail |
public static final int STACK_TYPE_NOT_STACKED
ChartConstants.STACK_TYPE_NOT_STACKED
public static final int STACK_TYPE_STACKED
ChartConstants.STACK_TYPE_STACKED
public static final int STACK_TYPE_STACKED_PERCENT
ChartConstants.STACK_TYPE_STACKED_PERCENT
public static final int STACK_STRATEGY_APPEND
ChartConstants.STACK_STRATEGY_APPEND
public static final int STACK_STRATEGY_GROUP
ChartConstants.STACK_STRATEGY_GROUP
Constructor Detail |
public GraphPart(int stackType, int stackStrategy, boolean centered)
GraphPart
and uses the given parameters to allocate the
default models.
stackType
- The type of the resulting graph. Specify one of
STACK_TYPE_NOT_STACKED
, STACK_TYPE_STACKED
or STACK_TYPE_STACKED_PERCENT
.
This parameter is used to initialize an instance of a DefaultStackModel
.stackStrategy
- The strategy that is used when stacking negative and positive values. Specify one of
STACK_STRATEGY_APPEND
or STACK_STRATEGY_GROUP
.
This parameter is used to initialize an instance of a DefaultStackModel
.centered
- This parameter is used to initialize the ScaleModel
as an instance of RowScaleModel
.Method Detail |
public GraphLook getGraphLook()
null
.public void setGraphLook(GraphLook graphLook)
graphLook
- The look of the graph, not null
.public ChartModel getChartModel()
null
.public void setChartModel(ChartModel chartModel)
chartModel
- The chart model. A value of null
will be replaced by an empty chart model.public StackModel getStackModel()
null
.public void setStackModel(StackModel stackModel)
ChartModel
to the new stack model.
stackModel
- The new StackModel
, not null
.public LegendModel getLegendModel()
null
.public void setLegendModel(LegendModel legendModel)
ChartModel
to the new legend model.
legendModel
- The new legend model, not null
.public ScaleModel getDiscreetScaleModel()
invalidate()
method of this part.
public void setDiscreetScaleModel(ScaleModel discreetScaleModel)
ChartModel
to the new scale model.
discreetScaleModel
- The new discreet scale model, not null
.public NumericScaleModel getNumericScaleModel()
invalidate()
method of this part.
null
.public void setNumericScaleModel(NumericScaleModel numericScaleModel)
ChartModel
to the new scale model.
numericScaleModel
- The new numeric scale model, not null
.public abstract ValueLocation getValueLocation(int rowIndex, int columnIndex)
ValueLocation
for a given cell.
rowIndex
- The index of the row. It must lie in a valid range of the current
stack model.columnIndex
- The index of the column. It must lie in a valid range of the current
stack model.
ValueLocation
for the given cell or null
if not available.protected float getDiscreetLength()
protected void setDiscreetLength(float length)
protected float getNumericLength()
protected void setNumericLength(float length)
|
ChartCat 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |