|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eesgmbh.gimv.client.controls.MouseWheelControl
public class MouseWheelControl
Reacts to MouseWheelEvent over the viewport and zooms the image accordingly. The zoom centers on
the current mouse position within the viewport.
The zoom factor which is a percentage value (0 to 1 based) can be set with setZoomFactor(double). The
default value is 0.2.
The control can be configured to preview a zoomed image (meaning rescaled on the client side) by setting
setPreviewZoomByRescalingTheImage(boolean) before it is being fully rendered. This is enabled by default.
By default, a LoadImageDataEvent is only fired after 150ms passed since the last mouse wheel event. This effectively
restricts the number of LoadImageDataEvent, potentially causing expensive rendering on the server side.
The value can be changed with setLoadImageDataEventFiringDelay(int).
Registers with the HandlerManager to receive the following events
ViewportMouseWheelEvent (mandatory, won't do anything otherwise)
SetDomainBoundsEvent (mandatory, won't work otherwise)
SetViewportPixelBoundsEvent (mandatory, won't work otherwise)
SetMaxDomainBoundsEvent (optional, if not received, there will be no restriction)
SetDataAreaPixelBoundsEvent (optional, if the vieport contains an image which contains a data area related to SetDomainBoundsEvent, e.g. axis areas)
Fires the following events
ChangeImagePixelBoundsEvent recomputed after recieving a mouse wheel event, rescales the image to have an immediate preview
SetDomainBoundsEvent recomputed after recieving a mouse wheel event
LoadImageDataEvent fired after firing ChangeImagePixelBoundsEvent
| Constructor Summary | |
|---|---|
MouseWheelControl(HandlerManager handlerManager)
Instantiates the control with the default configuration. |
|
| Method Summary | |
|---|---|
void |
setFireLoadImageDataEvent(boolean fireLoadImageDataEvent)
Defines, whether a LoadImageDataEvent is fired. |
void |
setLoadImageDataEventFiringDelay(int delayInMillis)
Sets the time in milliseconds for how long to defer firing a LoadImageDataEvent. |
void |
setPreviewZoomByRescalingTheImage(boolean previewZoomByRescalingTheImage)
Whether you want to see a preview of the image by simply repositioning and rescaling it before the new image is beeing rendered and displayed. |
void |
setZoomFactor(double zoomFactor)
Sets the zoom factor both for zooming in and out. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MouseWheelControl(HandlerManager handlerManager)
handlerManager - A HandlerManager| Method Detail |
|---|
public void setZoomFactor(double zoomFactor)
zoomFactor - zoom factor must be positive and not zeropublic void setPreviewZoomByRescalingTheImage(boolean previewZoomByRescalingTheImage)
Whether you want to see a preview of the image by simply repositioning and rescaling it before the new image is beeing rendered and displayed. This gives an instant feedback to the user.
Default is true.
previewZoomByRescalingTheImage - public void setFireLoadImageDataEvent(boolean fireLoadImageDataEvent)
Defines, whether a LoadImageDataEvent is fired.
Default is true.
fireLoadImageDataEvent - fire it, or notpublic void setLoadImageDataEventFiringDelay(int delayInMillis)
LoadImageDataEvent.
The default value is 150 ms. This means that 150 ms have to pass after the last wheel event until a
LoadImageDataEvent is fired causing the image to be newly rendered. If multiple wheel events were received during
that period, the new image bounds will be the 'sum' of all wheel events.
This helps to reduce server load where rendering might take place.
delayInMillis - A millisecond value. Pass in 0 (zero) to deactivate delayed firing of LoadImageDataEvent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||