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

ThumbnailViewer Class Reference

A viewer that displays thumbnails (small versions of larger images). More...

Inheritance diagram for ThumbnailViewer::

CanvasViewer CanvasInspectionUser CanvasEditUser List of all members.

Public Methods

 ThumbnailViewer ()
 Constructor. More...

 ThumbnailViewer (int width, int height, boolean fixedSize)
 Constructor. More...

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

void setDoZoomOnAdd (boolean doZoom)
 if (doZoom) the thumbnail will adjust its zoom factor to make the object's visualization match the sizes of the viewer, otherwise the thumbnail will assume the sizes of the object are already adjusted to match the size of the viewer (so it does nothing) This will only affect future calls to addObject! More...


Detailed Description

A viewer that displays thumbnails (small versions of larger images).

Will only display objects derived from CanvasImage (?).


Constructor & Destructor Documentation

ThumbnailViewer::ThumbnailViewer   [inline]
 

Constructor.

00031 {
00032     doInit(64, 64, false);
00033 }

ThumbnailViewer::ThumbnailViewer int    width,
int    height,
boolean    fixedSize
[inline]
 

Constructor.

00039 {
00040     doInit(width, height, fixedSize);
00041 }


Member Function Documentation

int ThumbnailViewer::addObject CanvasObject    obj [inline]
 

Overrides CanvasViewer interface.

Add a CanvasImage (?) to the viewer. Works correct only in case all images on the canvas have the same size (since it adjusts the zoom factor of the canvas).

Reimplemented from CanvasViewer.

00050 {
00051     double objWidth  = obj.getWidth();
00052     double objHeight = obj.getHeight();
00053     double width = _visualizer.getViewportSize().width;
00054     double height = _visualizer.getViewportSize().height;
00055     double scale = Math.min(width / objWidth, height / objHeight);
00056     if (obj instanceof CanvasHxImage)
00057         ((CanvasHxImage) obj).setResolution(scale);
00058     int result = _visualizer.addObject(obj);
00059     if (_doZoom)
00060         doZoom(scale);
00061     return result;
00062 }

void ThumbnailViewer::setDoZoomOnAdd boolean    doZoom [inline]
 

if (doZoom) the thumbnail will adjust its zoom factor to make the object's visualization match the sizes of the viewer, otherwise the thumbnail will assume the sizes of the object are already adjusted to match the size of the viewer (so it does nothing) This will only affect future calls to addObject!

00072 {
00073     _doZoom = doZoom;
00074 }


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