|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.approximatrix.charting.model.AbstractChartDataModel
com.approximatrix.charting.model.threedimensional.AbstractDotPlotDataModel
public abstract class AbstractDotPlotDataModel
Basis for models containing three dimensional scatter data (x,y,z) for use in Dot Plots, where Z values are simply represented by a color scale. This abstract implementation provides some data model necessities, stores the "image" of the data, and handles scanning for the largest observed x,y values.
| Field Summary | |
|---|---|
protected ChartDataModelConstraints |
constraints
The data model constraints |
protected java.awt.image.BufferedImage |
dataImage
Image of the data ready for rendering |
protected double |
maxX
The largest X value |
protected double |
maxY
The largest Y value |
protected double |
minX
The smallest X value |
protected double |
minY
The smallest Y value |
| Fields inherited from class com.approximatrix.charting.model.AbstractChartDataModel |
|---|
autoscale, listener, maxcolumn, maxvalue, mincolumn, minvalue |
| Constructor Summary | |
|---|---|
protected |
AbstractDotPlotDataModel()
Default constructor that enables autoscaling immediately |
| Method Summary | |
|---|---|
protected abstract void |
buildImage()
Constructs image from the data |
ChartDataModelConstraints |
getChartDataModelConstraints(int axis)
Returns the chart data model constraints |
java.awt.image.BufferedImage |
getImage()
Returns the complete image of the data |
private int |
getIndex(double datavalue,
double minval,
double maxval,
int size)
Private conversion method to perform data-space to image-space conversions |
private int[] |
getIndices(double[] datavalue,
double minval,
double maxval,
int size)
Private conversion method to perform data-space to image-space conversions. |
double |
getModelMaximumX()
Returns the largest x value in the data model. |
double |
getModelMaximumY()
Returns the largest y value in the data model. |
double |
getModelMinimumX()
Returns the smallest x value in the data model. |
double |
getModelMinimumY()
Returns the smallest y value in the data model. |
java.awt.Image |
getViewableImage()
Returns a copy of the data image for plotting. |
int |
getXIndex(double datavalue)
Conversion method to determine the data image X-index based on a double X value in data space |
int[] |
getXIndices(double[] datavalue)
Conversion method to determine the data image X-indices based on an array of double X values in data space |
int |
getYIndex(double datavalue)
Conversion method to determine the data image Y-index based on a double Y value in data space |
int[] |
getYIndices(double[] datavalue)
Conversion method to determine the data image Y-indices based on an array of double Y values in data space |
protected void |
initializeImage(int w,
int h)
Initializes the data image to a specified width and height. |
boolean |
isColumnNumeric()
Returns true because this model only uses numeric x-axis |
protected void |
scanRanges(double[] x,
double[] y)
Scans through arrays of x and y data to determine the largest and smallest values encountered and stores them appropriately. |
void |
setChartDataModelConstraints(int axis,
ChartDataModelConstraints constraints)
Assigns the chart data model constraints to this data model. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.awt.image.BufferedImage dataImage
protected double minX
protected double maxX
protected double minY
protected double maxY
protected ChartDataModelConstraints constraints
| Constructor Detail |
|---|
protected AbstractDotPlotDataModel()
| Method Detail |
|---|
public java.awt.image.BufferedImage getImage()
public java.awt.Image getViewableImage()
getViewableImage in interface IntegratedImageModelpublic int getXIndex(double datavalue)
datavalue - a data-space x value
public int getYIndex(double datavalue)
datavalue - a data-space y value
private int getIndex(double datavalue,
double minval,
double maxval,
int size)
datavalue - the data space valueminval - the minimum data-space value along a dimension of interestmaxval - the maximum data-space value along a dimension of interestsize - the image size along a dimension of interest
public int[] getXIndices(double[] datavalue)
datavalue - an array data-space x values
public int[] getYIndices(double[] datavalue)
datavalue - an array data-space y values
private int[] getIndices(double[] datavalue,
double minval,
double maxval,
int size)
throws java.lang.NullPointerException
datavalue - the array data space valuesminval - the minimum data-space value along a dimension of interestmaxval - the maximum data-space value along a dimension of interestsize - the image size along a dimension of interest
java.lang.NullPointerException
protected void scanRanges(double[] x,
double[] y)
x - the array of x data valuesy - the array of y data values
protected void initializeImage(int w,
int h)
w - the width of the data imageh - the height of the data imageprotected abstract void buildImage()
public void setChartDataModelConstraints(int axis,
ChartDataModelConstraints constraints)
setChartDataModelConstraints in interface ChartDataModelaxis - the Axis constantconstraints - the ChartDataModelConstraints objectpublic ChartDataModelConstraints getChartDataModelConstraints(int axis)
getChartDataModelConstraints in interface ChartDataModelaxis - the Axis constant
public double getModelMaximumX()
public double getModelMinimumX()
public double getModelMaximumY()
public double getModelMinimumY()
public boolean isColumnNumeric()
isColumnNumeric in interface ChartDataModelisColumnNumeric in class AbstractChartDataModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||