Class cam.visuals.contours.ColorContourCanvas
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----cam.visuals.contours.ColorContourCanvas
- public class ColorContourCanvas
- extends Canvas
This class creates a color contour for a two dimensional (rectangular) data set.
The color contour is created by coloring squares of a grid with colors that are
associated with the data set function values. The grid used for the
contour need not match the size of the data set - the data set is bi-linearly
interpolated to get any needed function values.
-
ColorContourCanvas()
-
-
getColorCount()
- Returns the number of colors used in the color table.
-
getMinimumSize()
-
-
getPreferredSize()
-
-
getResolution()
- Returns the number of panels of the color contour grid.
-
paint(Graphics)
-
-
setColorCount(int)
- Sets the number of colors used in the color table.
-
setColorTableEntry(int, double, double, double)
- Sets a specific color table entry.
-
setData(double[], int, int)
- Sets the data to be contoured.
-
setData(double[][])
- Sets the data to be contoured.
-
setDataRange()
- Determines and then sets the data range to be the maximal and minimal values of
contour data.
-
setDataRange(double, double)
- Sets the maximal and minimal values of the data range that will be contoured.
-
setResolution(int)
- Sets the resolution of the color contour plot
-
setupColors()
- Sets up a default color table.
-
setupColorTable(double[], double[], double[])
- Sets up color table with values from the r,g and b arrays.
ColorContourCanvas
public ColorContourCanvas()
setData
public void setData(double inputData[],
int xCount,
int yCount)
- Sets the data to be contoured.
- Parameters:
- inputData - one dimensional array of doubles containing the two dimensional data set
values. It is assumed that the two dimensional data is stored by rows
- xCount - the number of data values in the x direction
- yCount - the number of data values in the y direction
setData
public void setData(double inputData[][])
- Sets the data to be contoured.
- Parameters:
- inputData - two dimensional array of doubles containing the data set
values.
setDataRange
public void setDataRange(double dMin,
double dMax)
- Sets the maximal and minimal values of the data range that will be contoured.
- Parameters:
- dMin - the minimum data set value to be contoured
- dMax - the maximum data set value to be contoured
setResolution
public void setResolution(int PanelCount)
- Sets the resolution of the color contour plot
- Parameters:
- PanelCount - the number of panels in the x and y directions to be used for
the color contour grid.
getResolution
public int getResolution()
- Returns the number of panels of the color contour grid.
setDataRange
public void setDataRange()
- Determines and then sets the data range to be the maximal and minimal values of
contour data.
getPreferredSize
public Dimension getPreferredSize()
- Overrides:
- getPreferredSize in class Component
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class Component
paint
public void paint(Graphics g)
- Overrides:
- paint in class Canvas
setupColorTable
public void setupColorTable(double r[],
double g[],
double b[])
- Sets up color table with values from the r,g and b arrays.
- Parameters:
- r,g,b - double arrays with values in the range [0.0, 1.0] specifying the red,
green and blue components of the colors to be used in the contour.
getColorCount
public int getColorCount()
- Returns the number of colors used in the color table.
setColorCount
public void setColorCount(int cCount)
- Sets the number of colors used in the color table.
setColorTableEntry
public void setColorTableEntry(int index,
double r,
double g,
double b)
- Sets a specific color table entry.
setupColors
public void setupColors()
- Sets up a default color table.