visad.util
Class BarGraph

java.lang.Object
  extended by visad.util.BarGraph

public class BarGraph
extends Object

BarGraph provides methods for plotting colored bar graphs in 2D or 3D.


Field Summary
protected static RealType BAR_B
           
protected static RealType BAR_G
           
protected static RealType BAR_R
           
protected static RealType BAR_X
           
protected static RealType BAR_Y
           
protected static RealType BAR_Z
           
protected static FunctionType BOX_2D
           
protected static FunctionType BOX_3D
           
 
Constructor Summary
BarGraph()
           
 
Method Summary
static float[][] extractColors(Color[] c)
          Converts java.awt.Color objects to floating point RGB values.
static void main(String[] argv)
          Run 'java visad.util.BarGraph' to test bar graphing.
static FlatField makeBarGraph2D(float[] heights, float spacing, Color[] colors)
          Constructs a 2D bar graph.
static FlatField makeBarGraph2D(FunctionType type, float[] heights, float spacing, Color[] colors)
          Constructs a 2D bar graph.
static FlatField makeBarGraph3D(float[][] heights, float spacing, Color[][] colors)
          Constructs a 3D bar graph.
static FlatField makeBarGraph3D(FunctionType type, float[][] heights, float spacing, Color[][] colors)
          Constructs a 3D bar graph.
static FlatField makeBoxes2D(float[] x1, float[] y1, float[] x2, float[] y2, Color[] c)
           
static FlatField makeBoxes2D(float[] x1, float[] y1, float[] x2, float[] y2, float[] r, float[] g, float[] b)
           
static FlatField makeBoxes2D(FunctionType type, float[] x1, float[] y1, float[] x2, float[] y2, Color[] c)
           
static FlatField makeBoxes2D(FunctionType type, float[] x1, float[] y1, float[] x2, float[] y2, float[] r, float[] g, float[] b)
           
static FlatField makeBoxes3D(float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, Color[] c)
           
static FlatField makeBoxes3D(float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, float[] r, float[] g, float[] b)
           
static FlatField makeBoxes3D(FunctionType type, float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, Color[] c)
           
static FlatField makeBoxes3D(FunctionType type, float[] x1, float[] y1, float[] z1, float[] x2, float[] y2, float[] z2, float[] r, float[] g, float[] b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BAR_X

protected static final RealType BAR_X

BAR_Y

protected static final RealType BAR_Y

BAR_Z

protected static final RealType BAR_Z

BAR_R

protected static final RealType BAR_R

BAR_G

protected static final RealType BAR_G

BAR_B

protected static final RealType BAR_B

BOX_2D

protected static final FunctionType BOX_2D

BOX_3D

protected static final FunctionType BOX_3D
Constructor Detail

BarGraph

public BarGraph()
Method Detail

makeBarGraph2D

public static FlatField makeBarGraph2D(float[] heights,
                                       float spacing,
                                       Color[] colors)
                                throws VisADException,
                                       RemoteException
Constructs a 2D bar graph.

Parameters:
heights - Height of each bar
spacing - Spacing between bars (at least 0, and less than 1)
colors - Color of each bar
Throws:
VisADException
RemoteException

makeBarGraph2D

public static FlatField makeBarGraph2D(FunctionType type,
                                       float[] heights,
                                       float spacing,
                                       Color[] colors)
                                throws VisADException,
                                       RemoteException
Constructs a 2D bar graph.

Parameters:
type - MathType to use, of the form ((X, Y) -> (R, G, B))
heights - Height of each bar
spacing - Spacing between bars (at least 0, and less than 1)
colors - Color of each bar
Throws:
VisADException
RemoteException

makeBoxes2D

public static FlatField makeBoxes2D(float[] x1,
                                    float[] y1,
                                    float[] x2,
                                    float[] y2,
                                    Color[] c)
                             throws VisADException,
                                    RemoteException
Throws:
VisADException
RemoteException

makeBoxes2D

public static FlatField makeBoxes2D(float[] x1,
                                    float[] y1,
                                    float[] x2,
                                    float[] y2,
                                    float[] r,
                                    float[] g,
                                    float[] b)
                             throws VisADException,
                                    RemoteException
Throws:
VisADException
RemoteException

makeBoxes2D

public static FlatField makeBoxes2D(FunctionType type,
                                    float[] x1,
                                    float[] y1,
                                    float[] x2,
                                    float[] y2,
                                    Color[] c)
                             throws VisADException,
                                    RemoteException
Throws:
VisADException
RemoteException

makeBoxes2D

public static FlatField makeBoxes2D(FunctionType type,
                                    float[] x1,
                                    float[] y1,
                                    float[] x2,
                                    float[] y2,
                                    float[] r,
                                    float[] g,
                                    float[] b)
                             throws VisADException,
                                    RemoteException
Throws:
VisADException
RemoteException

makeBarGraph3D

public static FlatField makeBarGraph3D(float[][] heights,
                                       float spacing,
                                       Color[][] colors)
                                throws VisADException,
                                       RemoteException
Constructs a 3D bar graph.

Parameters:
heights - Height of each bar (dimensioned cols X rows)
spacing - Spacing between bars (at least 0, and less than 1)
colors - Color of each bar (dimensioned cols X rows)
Throws:
VisADException
RemoteException

makeBarGraph3D

public static FlatField makeBarGraph3D(FunctionType type,
                                       float[][] heights,
                                       float spacing,
                                       Color[][] colors)
                                throws VisADException,
                                       RemoteException
Constructs a 3D bar graph.

Parameters:
type - MathType to use, of the form ((X, Y, Z) -> (R, G, B))
heights - Height of each bar (dimensioned cols X rows)
spacing - Spacing between bars (at least 0, and less than 1)
colors - Color of each bar (dimensioned cols X rows)
Throws:
VisADException
RemoteException

makeBoxes3D

public static FlatField makeBoxes3D(float[] x1,
                                    float[] y1,
                                    float[] z1,
                                    float[] x2,
                                    float[] y2,
                                    float[] z2,
                                    Color[] c)
                             throws VisADException,
                                    RemoteException
Throws:
VisADException
RemoteException

makeBoxes3D

public static FlatField makeBoxes3D(float[] x1,
                                    float[] y1,
                                    float[] z1,
                                    float[] x2,
                                    float[] y2,
                                    float[] z2,
                                    float[] r,
                                    float[] g,
                                    float[] b)
                             throws VisADException,
                                    RemoteException
Throws:
VisADException
RemoteException

makeBoxes3D

public static FlatField makeBoxes3D(FunctionType type,
                                    float[] x1,
                                    float[] y1,
                                    float[] z1,
                                    float[] x2,
                                    float[] y2,
                                    float[] z2,
                                    Color[] c)
                             throws VisADException,
                                    RemoteException
Throws:
VisADException
RemoteException

makeBoxes3D

public static FlatField makeBoxes3D(FunctionType type,
                                    float[] x1,
                                    float[] y1,
                                    float[] z1,
                                    float[] x2,
                                    float[] y2,
                                    float[] z2,
                                    float[] r,
                                    float[] g,
                                    float[] b)
                             throws VisADException,
                                    RemoteException
Throws:
VisADException
RemoteException

extractColors

public static float[][] extractColors(Color[] c)
Converts java.awt.Color objects to floating point RGB values.


main

public static void main(String[] argv)
                 throws VisADException,
                        RemoteException
Run 'java visad.util.BarGraph' to test bar graphing.

Throws:
VisADException
RemoteException