Inheritance diagram for ThumbnailViewer::
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... |
Will only display objects derived from CanvasImage (?).
|
00031 { 00032 doInit(64, 64, false); 00033 } |
|
00039 { 00040 doInit(width, height, fixedSize); 00041 } |
|
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 } |
|
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 } |