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

Histogram3dViewer Class Reference

A viewer to display 3D histograms. More...

Inheritance diagram for Histogram3dViewer::

CanvasViewer CanvasInspectionUser CanvasEditUser List of all members.

Public Methods

 Histogram3dViewer ()
 Constructor. More...

int addObject (CanvasObject obj)
 Overrides CanvasViewer interface. More...

void actionPerformed (ActionEvent e)
 Implementation of ActionListener. More...


Detailed Description

A viewer to display 3D histograms.

Will accept only instances of CanvasHxHistogram3d to display.


Constructor & Destructor Documentation

Histogram3dViewer::Histogram3dViewer   [inline]
 

Constructor.

00034 {
00035     doInit();
00036 }


Member Function Documentation

int Histogram3dViewer::addObject CanvasObject    obj [inline]
 

Overrides CanvasViewer interface.

Add a CanvasHxHistogram3d (!) to the viewer.

Reimplemented from CanvasViewer.

00043 {
00044     if (obj instanceof CanvasHxHistogram3d) {
00045         _hist = (CanvasHxHistogram3d) obj;
00046         _elevField.setText(java.lang.String.valueOf(_hist.getElevation()));
00047         _alphaField.setText(java.lang.String.valueOf(_hist.getAlpha()));
00048         _thresField.setText(java.lang.String.valueOf(_hist.getThreshold()));
00049         return _visualizer.addObject(obj);
00050     }
00051     ErrorStreamArea.println("Histogram3dViewer: added obj not a 3d histogram");
00052     return -1;
00053 }

void Histogram3dViewer::actionPerformed ActionEvent    e [inline]
 

Implementation of ActionListener.

00060 {
00061     Cursor oldCursor = getCursor();
00062     setCursor(new Cursor(java.awt.Cursor.WAIT_CURSOR));
00063 
00064     if (e.getSource() == _elevField) {
00065         try {
00066             double el = new Double(_elevField.getText()).doubleValue();
00067             if (_hist != null) {
00068                 _hist.setElevation(el);
00069                 doRefresh();
00070             }
00071         } catch (NumberFormatException ex) {
00072             // do nothing
00073         }
00074     }
00075     if (e.getSource() == _alphaField) {
00076         try {
00077             double al = new Double(_alphaField.getText()).doubleValue();
00078             if (_hist != null) {
00079                 _hist.setAlpha(al);
00080                 doRefresh();
00081             }
00082         } catch (NumberFormatException ex) {
00083             // do nothing
00084         }
00085     }
00086     if (e.getSource() == _thresField) {
00087         try {
00088             double th = new Double(_thresField.getText()).doubleValue();
00089             if (_hist != null) {
00090                 _hist.setThreshold(th);
00091                 doRefresh();
00092             }
00093         } catch (NumberFormatException ex) {
00094             // do nothing
00095         }
00096     }
00097     setCursor(oldCursor);
00098 }


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 15:11:19 2003 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001