org.eesgmbh.gimv.client.presenter
Class ZoomBoxPresenter

java.lang.Object
  extended by org.eesgmbh.gimv.client.presenter.ZoomBoxPresenter

public class ZoomBoxPresenter
extends Object

This presenter enables to zoom the image by mouse dragging on the viewport, thus creating some kind of bounding box.

The image will be zoomed to the selection made with the bounding box.
Currently only zooming in is supported.

The passed in view is the actual visual representation of the bounding box.

This presenter must be activated or deactivated with a StateChangeEvent. The reason behind the mandatory activation is, that dragging can both mean zooming or moving the image. Only this presenter or the DragImageControl can be active at the same time.

Registers with the HandlerManager to receive the following events

Fires the following events


Constructor Summary
ZoomBoxPresenter(HandlerManager handlerManager, GenericWidgetView view)
          Instantiates the presenter.
 
Method Summary
 void setFireLoadImageDataEvent(boolean fireLoadImageDataEvent)
          Defines, whether a LoadImageDataEvent is fired.
 void setMinimalDragOffsetInPixel(int minimalDragOffsetInPixel)
          Specifies the minimal width and height of the zoom area.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZoomBoxPresenter

public ZoomBoxPresenter(HandlerManager handlerManager,
                        GenericWidgetView view)
Instantiates the presenter.

Parameters:
handlerManager - A HandlerManager
view - An implementation of GenericWidgetView. This is the visual representation of the bounding box.
Method Detail

setMinimalDragOffsetInPixel

public void setMinimalDragOffsetInPixel(int minimalDragOffsetInPixel)
Specifies the minimal width and height of the zoom area. If the dragging width or height is below that, no SetDomainBoundsEvent or LoadImageDataEvent will be fired. The presenter simply has no effect in this case.

This is to ensure, that the image does not get rendered with extremly small domain bounds, just because the user accidently clicked on the viewport.

The default value is 15 pixels.

Parameters:
minimalDragOffsetInPixel -

setFireLoadImageDataEvent

public void setFireLoadImageDataEvent(boolean fireLoadImageDataEvent)

Defines, whether a LoadImageDataEvent is fired.

Default is true.

Parameters:
fireLoadImageDataEvent - fire it, or not


Copyright © 2010 - EES GmbH