Horus Doc || Java GUI Reference || Doxygen's quick Index  

CanvasHxHistogram3d Class Reference

Extension of CanvasImage to display 3D HxHistograms (C++ histogram). More...

Inheritance diagram for CanvasHxHistogram3d::

CanvasImage CanvasObject List of all members.

Public Methods

 CanvasHxHistogram3d (String histName)
 Constructor. More...

 CanvasHxHistogram3d (String histName, double elevation, double alpha, double threshold)
 Constructor. More...

void draw (Graphics g)
 Draw CanvasObject on 'g', using internal CCS values. More...

void setPixel (int x, int y, Color c)
BufferedImage getSubImage (int x, int y, int w, int h)
String[] getPixelStrings (int x, int y, int w, int h)
String histName ()
double getElevation ()
void setElevation (double elevation)
double getAlpha ()
void setAlpha (double alpha)
double getThreshold ()
void setThreshold (double threshold)
int getDimSize (int dim)
double getBin (int bin)
double getMax ()

Detailed Description

Extension of CanvasImage to display 3D HxHistograms (C++ histogram).


Constructor & Destructor Documentation

CanvasHxHistogram3d::CanvasHxHistogram3d String    histName [inline]
 

Constructor.

00028 {
00029     super(Converter.ICS_ORIGIN, Converter.ICS_ORIGIN, 0., 0.);
00030     doInit(histName, 30.0, -30.0, 0.0);
00031 }

CanvasHxHistogram3d::CanvasHxHistogram3d String    histName,
double    elevation,
double    alpha,
double    threshold
[inline]
 

Constructor.

00038 {
00039     super(Converter.ICS_ORIGIN, Converter.ICS_ORIGIN, 0., 0.);
00040     doInit(histName, elevation, alpha, threshold);
00041 }


Member Function Documentation

void CanvasHxHistogram3d::draw Graphics    g [inline, virtual]
 

Draw CanvasObject on 'g', using internal CCS values.

Reimplemented from CanvasObject.

00045 {
00046     setupDrawMode(g);
00047     if (!getTransformOK())
00048         transformICStoCCS();
00049     g.drawImage(_bufIm, getX1Ccs(), getY1Ccs(), getWidthCcs(), getHeightCcs(), null);
00050 }

void CanvasHxHistogram3d::setPixel int    x,
int    y,
Color    c
[inline, virtual]
 

Reimplemented from CanvasImage.

00065 {
00066     // ignore
00067 }

BufferedImage CanvasHxHistogram3d::getSubImage int    x,
int    y,
int    w,
int    h
[inline, virtual]
 

Reimplemented from CanvasImage.

00071 {
00072     return _bufIm.getSubimage(x, y, w, h);
00073 }

String [] CanvasHxHistogram3d::getPixelStrings int    x,
int    y,
int    w,
int    h
[inline, virtual]
 

Reimplemented from CanvasImage.

00077 {
00078     String[] strs = new String[w*h];
00079     int imWidth = _bufIm.getWidth();
00080     int imHeight = _bufIm.getHeight();
00081     for (int i=0; i<w; i++) {
00082         for (int j=0; j<h; j++) {
00083             if (x+i < 0 || y+j < 0 || x+i >= imWidth || y+j >= imHeight) {
00084                 strs[i+j*w] = new String("");
00085             } else {
00086                 int pix = _bufIm.getRGB(x+i, y+j);
00087                 Color c = new Color(pix);
00088                 strs[i+j*w] = HX.colorToString(c);
00089             }
00090         }
00091     }
00092     return strs;
00093 }

String CanvasHxHistogram3d::histName   [inline]
 

00097 {
00098     return _name;
00099 }

double CanvasHxHistogram3d::getElevation   [inline]
 

00103 {
00104     return _elevation;
00105 }

void CanvasHxHistogram3d::setElevation double    elevation [inline]
 

00109 {
00110     if (elevation != _elevation) {
00111         updatePixels(elevation, _alpha, _threshold);
00112     }
00113 }

double CanvasHxHistogram3d::getAlpha   [inline]
 

00117 {
00118     return _alpha;
00119 }

void CanvasHxHistogram3d::setAlpha double    alpha [inline]
 

00123 {
00124     if (alpha != _alpha) {
00125         updatePixels(_elevation, alpha, _threshold);
00126     }
00127 }

double CanvasHxHistogram3d::getThreshold   [inline]
 

00131 {
00132     return _threshold;
00133 }

void CanvasHxHistogram3d::setThreshold double    threshold [inline]
 

00137 {
00138     if (threshold != _threshold) {
00139         updatePixels(_elevation, _alpha, threshold);
00140     }
00141 }

int CanvasHxHistogram3d::getDimSize int    dim [inline]
 

00145 {
00146     String[] args = new String[1];
00147     args[0] = new String("int " + java.lang.String.valueOf(dim));
00148     String result = _mediator.callMethod("HxHistogram",
00149                                          _name, "dimensionSize", "", args);
00150     return new Integer(result).intValue();
00151 }

double CanvasHxHistogram3d::getBin int    bin [inline]
 

00155 {
00156     String[] args = new String[1];
00157     args[0] = new String("int " + java.lang.String.valueOf(bin));
00158     String result = _mediator.callMethod("HxHistogram",
00159                                          _name, "get", "", args);
00160     return new Double(result).doubleValue();
00161 }

double CanvasHxHistogram3d::getMax   [inline]
 

00165 {
00166     String[] args = new String[0];
00167     String result = _mediator.callMethod("HxHistogram",
00168                                          _name, "maxVal", "", args);
00169     return new Double(result).doubleValue();
00170 }


The documentation for this class was generated from the following file:
Generated on Tue Feb 3 14:19:39 2004 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001