|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eesgmbh.gimv.client.controls.ViewportDimensionsListenerControl
public class ViewportDimensionsListenerControl
The control listens to the viewport dimensions and will take all necessary steps if the width or the height of the viewport changes.
The control is only of use, if the viewport can change its size dynamically because of a user action. Two likely examples are
viewport size changes due to a browser window resize or because a SplitLayoutPanel is used.
The control listens to the viewport width and height via a Timer. The timer runs repeatedly. The period can be specified
with setListeningInterval(int) but must not be smaller than 50ms (client performance). The default value is 100ms.
Whenever changes are detected a SetViewportPixelBoundsEvent is immediately fired.
Optionally a ChangeImagePixelBoundsEvent is fired, which will cause the displayed image to realign itself with the viewport. This is
turned on by default and can be turned off with setFireSetImagePositionEvent(boolean).
A LoadImageDataEvent is fired after a certain delay. The default is 500ms. This means that (possibly expensive) image rendering is
only triggered after viewport resizing stopped for 500ms. The value can be changed with setLoadImageDataEventFiringDelay(int).
receives no events
Fires the following events
| Constructor Summary | |
|---|---|
ViewportDimensionsListenerControl(Viewport viewport,
HandlerManager handlerManager)
Constructor. |
|
| Method Summary | |
|---|---|
void |
setFireLoadImageDataEvent(boolean fireLoadImageDataEvent)
Specify whether a LoadImageDataEvent is fired. |
void |
setFireSetImagePositionEvent(boolean fireSetImagePositionEvent)
Specify whether the image is immediately repositioned prior to loading the newly rendered one. |
void |
setListeningInterval(int intervalInMillis)
Specifies the listening interval for viewport dimension changes. |
void |
setLoadImageDataEventFiringDelay(int delayInMillis)
Sets the time in milliseconds for how long to defer firing a LoadImageDataEvent. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ViewportDimensionsListenerControl(Viewport viewport,
HandlerManager handlerManager)
viewport - A Viewport instancehandlerManager - A HandlerManager instance| Method Detail |
|---|
public void setListeningInterval(int intervalInMillis)
Default is 100ms
intervalInMillis - listening interval, at least 50mspublic void setLoadImageDataEventFiringDelay(int delayInMillis)
LoadImageDataEvent.
The default value is 500 ms. This means that 500 ms have to pass after the last detetected viewport dimension change until a
LoadImageDataEvent is fired causing the image to be newly rendered.
This helps to reduce server load where image rendering might take place.
delayInMillis - A millisecond value. Pass in 0 (zero) to deactivate delayed firing of LoadImageDataEventpublic void setFireSetImagePositionEvent(boolean fireSetImagePositionEvent)
Default is true.
fireSetImagePositionEvent - public void setFireLoadImageDataEvent(boolean fireLoadImageDataEvent)
LoadImageDataEvent is fired.
Default is true.
fireLoadImageDataEvent - fire it, or not
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||