|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eesgmbh.gimv.client.presenter.OverviewPresenter
public class OverviewPresenter
This presenter can be used to display and manipulate the currently shown bounds of the main image within larger bounds.
E.g. it can show the currently displayed map section within a larger map as a rectangle. The rectangle can be moved as a whole or only a single bound can be changed.
The overview presenter must be instantiated with a different handler manager than the
one used to process events for the main image. This handler manager will connect the
presenter with its own Viewport to receive notifications of drag operations.
If the user changes the overview with this presenter, the resulting change will be
propagated to all registered dependant handler managers with a SetDomainBoundsEvent. If you
got a single main image with one overview, the only dependant handler manager is the one of the
main image.
After instantiating the presenter, it must be configured with handles. These handles represent
the visual representation of the overview and are configured to alter a certain set of bounds
(see addHandle(GenericWidgetView, Bound...).
Registers with the HandlerManager to receive the following events
ViewportDragInProgressEvent (mandatory, received from the overview's viewport)
ViewportDragFinishedEvent (mandatory, received from the overview's viewport, will fire a SetDomainBoundsEvent
and LoadImageDataEvent on all dependant handler managers afterwards)
SetDomainBoundsEvent (mandatory, the total domain bounds of the overview)
SetOverviewDomainBoundsEvent (mandatory, the actual portion of the total bounds highlighted by the presenter)
SetViewportPixelBoundsEvent (mandatory, the dimensions of the overview's viewport)
SetMaxDomainBoundsEvent (optional, if not received, there will be no restriction)
Fires the following events on all dependant handler managers
SetDomainBoundsEvent (the new domain bounds after a drag finished)
LoadImageDataEvent (after a drag finished)
| Constructor Summary | |
|---|---|
OverviewPresenter(GenericWidgetView overviewWidgetView,
HandlerManager handlerManager,
HandlerManager dependantHandlerManager)
Instantiates the overview presenter. |
|
| Method Summary | |
|---|---|
void |
addDependantHandlerManager(HandlerManager handlerManager)
Adds HandlerManager who will receive a SetDomainBoundsEvent and (optionally) a LoadImageDataEvent
after a drag on the overviewWidget finished. |
void |
addHandle(GenericWidgetView handleView,
Bound... bounds)
Adds a view as a dragging handle. |
void |
setFireLoadImageDataEvent(boolean fireLoadImageDataEvent)
Defines, whether a LoadImageDataEvent is fired. |
void |
setHorizontallyLocked(boolean horizontallyLocked)
If set to true the overview widget's left and right pixel bounds are locked. |
void |
setMinClippingHeight(int minHeight)
The minimum height the overview can be resized to. |
void |
setMinClippingWidth(int minWidth)
The minimum width the overview can be resized to. |
void |
setOverviewLeftOffset(int overviewLeftOffsetInPixels)
Sets the amount of pixels for the vertical offset of the overview widget. |
void |
setOverviewTopOffset(int overviewTopOffsetInPixels)
Sets the amount of pixels for the vertical offset of the overview widget. |
void |
setPreserveAspectRatio(boolean preserveAspectRatio)
Specifies whether the overview should keep its aspect ratio when it is being resized or not. |
void |
setVerticallyLocked(boolean verticallyLocked)
If set to true the overview widget's top and bottom pixel bounds are locked. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OverviewPresenter(GenericWidgetView overviewWidgetView,
HandlerManager handlerManager,
HandlerManager dependantHandlerManager)
overviewWidgetView - The UI for displaying the selected portionhandlerManager - A HandlerManagerdependantHandlerManager - A HandlerManager who will receive a SetDomainBoundsEvent and
(optionally) a LoadImageDataEvent after a drag on the overviewWidget finished.
The bounds are the current domain bounds of the overview (the portion selected).| Method Detail |
|---|
public void addHandle(GenericWidgetView handleView,
Bound... bounds)
Bound enums specify which bound of the
overview will change as a result of dragging the handle. This will both be reflected in the
placement and dimensions of the overview on the UI and also on the domain bounds change of the components
registerd as dependant handler managers.
A handle with the LEFT bound changes the left bound. Dragging this handle will change
the left bound of the overview bound and leave all other bounds unchanged. The width of the overview changes accordingly
When two bounds are specified, e. g. LEFT and RIGHT, dragging the handle will result
in the view moving horizontally, preserving it's width, but changing both left and right by the same amount.
handleView - the view to be added as a dragging handlebounds - bounds which the handle will changepublic void setPreserveAspectRatio(boolean preserveAspectRatio)
false
preserveAspectRatio - true to preserve the aspect ratio, false not topublic void setMinClippingWidth(int minWidth)
minWidth - minimum width, in pixelspublic void setMinClippingHeight(int minHeight)
Default: 0 pixels
minHeight - minimum height, in pixelspublic void setHorizontallyLocked(boolean horizontallyLocked)
preserveAspectRatioDefault: false
horizontallyLocked - public void setVerticallyLocked(boolean verticallyLocked)
preserveAspectRatioDefault: false
verticallyLocked - public void setOverviewTopOffset(int overviewTopOffsetInPixels)
Default: 0 pixels
overviewTopOffsetInPixels - offset in pixelspublic void setOverviewLeftOffset(int overviewLeftOffsetInPixels)
Default: 0 pixels
overviewLeftOffsetInPixels - offset in pixelspublic void setFireLoadImageDataEvent(boolean fireLoadImageDataEvent)
Defines, whether a LoadImageDataEvent is fired.
Default is true.
fireLoadImageDataEvent - fire it, or notpublic void addDependantHandlerManager(HandlerManager handlerManager)
HandlerManager who will receive a SetDomainBoundsEvent and (optionally) a LoadImageDataEvent
after a drag on the overviewWidget finished.
handlerManager - A HandlerManager instance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||