|
|||||||||
| 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
com.approximatrix.charting.model.threedimensional.ColorDotPlotDataModel
public class ColorDotPlotDataModel
A Dot Plot data model that stores Z-values directly as Color objects for plotting. The class also defines the data image as 500x500 by default. If using this class, the data image size should always be set appropriately.
| Field Summary | |
|---|---|
protected java.awt.Color[] |
c
The color values for plotting |
private static int |
DEFAULT_HEIGHT
The default data image height |
private static int |
DEFAULT_WIDTH
The default data image width |
private int |
h
The actual data image height |
private int |
w
The actual data image width |
protected double[] |
x
The x data values |
protected double[] |
y
The y data values |
| Fields inherited from class com.approximatrix.charting.model.threedimensional.AbstractDotPlotDataModel |
|---|
constraints, dataImage, maxX, maxY, minX, minY |
| Fields inherited from class com.approximatrix.charting.model.AbstractChartDataModel |
|---|
autoscale, listener, manualscale, maxcolumn, maxvalue, mincolumn, minvalue |
| Constructor Summary | |
|---|---|
ColorDotPlotDataModel()
Default constructor |
|
ColorDotPlotDataModel(double[] x,
double[] y,
java.awt.Color[] color)
Constructor that accepts coordinate data as (double,double,Color). |
|
ColorDotPlotDataModel(int[] x,
int[] y,
java.awt.Color[] color)
Constructor that accepts coordinate data as (int,int,Color). |
|
| Method Summary | |
|---|---|
protected void |
buildImage()
Constructs the data image based on the data. |
java.lang.Object |
getColumnValueAt(int col)
Returns a specified X column value |
java.lang.Object |
getColumnValueAt(int set,
int col)
Returns a specified X column value |
int |
getDataSetLength(int set)
Returns the data set length. |
int |
getDataSetNumber()
This model will only ever have a single data set. |
protected double |
getFirstColumnValue()
Returns the smallest X value |
protected double |
getLastColumnValue()
Returns the largest X value |
protected java.util.TreeSet |
getOrderedValues(int axis)
Returns null as this model does not provide ordered values |
java.lang.Number |
getValueAt(int set,
int index)
Returns the Color value at a given index. |
private void |
initialize()
Initializes the model by scanning the data for the largest and smallest values, then assigning the appropriate constaints. |
void |
setResolution(int w,
int h)
Sets the resolution of the data image storing the pre-rendered data. |
void |
setValueAt(double x,
double y,
java.awt.Color value)
Sets a Color at a given data-space coordinate |
void |
setValueAt(int x,
int y,
java.awt.Color value)
Sets a Color at a given data-space coordinate |
| Methods inherited from class com.approximatrix.charting.model.threedimensional.AbstractDotPlotDataModel |
|---|
getChartDataModelConstraints, getImage, getModelMaximumX, getModelMaximumY, getModelMinimumX, getModelMinimumY, getViewableImage, getXIndex, getXIndices, getYIndex, getYIndices, initializeImage, isColumnNumeric, scanRanges, setChartDataModelConstraints |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int DEFAULT_WIDTH
private static final int DEFAULT_HEIGHT
private int w
private int h
protected double[] x
protected double[] y
protected java.awt.Color[] c
| Constructor Detail |
|---|
public ColorDotPlotDataModel()
public ColorDotPlotDataModel(int[] x,
int[] y,
java.awt.Color[] color)
x - the array of x data pointsy - the array of y data pointscolor - the array of Color objects representing z data
public ColorDotPlotDataModel(double[] x,
double[] y,
java.awt.Color[] color)
throws java.lang.NullPointerException
x - the array of x data pointsy - the array of y data pointscolor - the array of Color objects representing z data
java.lang.NullPointerException| Method Detail |
|---|
private void initialize()
public void setResolution(int w,
int h)
w - the width of the data imageh - the height of the data imageprotected void buildImage()
buildImage in class AbstractDotPlotDataModelprotected double getFirstColumnValue()
getFirstColumnValue in class AbstractChartDataModelprotected double getLastColumnValue()
getLastColumnValue in class AbstractChartDataModelprotected java.util.TreeSet getOrderedValues(int axis)
getOrderedValues in class AbstractChartDataModelpublic java.lang.Object getColumnValueAt(int col)
col - the column index
public java.lang.Object getColumnValueAt(int set,
int col)
set - must be zero - this model only supports a single seriesthe -
public int getDataSetLength(int set)
throws java.lang.IndexOutOfBoundsException
set - must be zero - this model only supports a single series
java.lang.IndexOutOfBoundsExceptionpublic int getDataSetNumber()
public java.lang.Number getValueAt(int set,
int index)
throws java.lang.IndexOutOfBoundsException
set - the DataSet indexindex - the value index in the DataSet
java.lang.IndexOutOfBoundsException
public void setValueAt(int x,
int y,
java.awt.Color value)
x - the data space x coordinatey - the data space y coordinatevalue - the desired color
public void setValueAt(double x,
double y,
java.awt.Color value)
x - the data space x coordinatey - the data space y coordinatevalue - the desired color
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||