org.eesgmbh.gimv.client.presenter
Class BoundsShiftPresenter

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

public class BoundsShiftPresenter
extends Object

This presenter changes the bounds of the currently displayed image. The passed in View must have a method to register a ClickHandler.
The underlying widget could just be an Image that shows an arrow and will shift the image towards a configured direction.
The only BoundsShiftPresenter.View implementation shipped with the framework is BoundsShiftViewImpl.

After instantiating the presenter, the direction and amount of shift is specified with either configureAbsoluteShift(double, double) or configureProportionalShift(double, double). The presenter won't do anything if the shift is not configured.

By default the image gets immediately repositioned on the client side, prior to requesting a new image to be rendered (see setFireChangeImagePixelBoundsEvent(boolean)).

Registers with the HandlerManager to receive the following events

Fires the following events


Nested Class Summary
static interface BoundsShiftPresenter.View
          The View interface for BoundsShiftPresenter
 
Constructor Summary
BoundsShiftPresenter(HandlerManager handlerManager, BoundsShiftPresenter.View view)
          Instantiates the presenter.
 
Method Summary
 void configureAbsoluteShift(double horizontalShift, double verticalShift)
          Configures the presenter to shift the domain bounds by an absolute value.
 void configureProportionalShift(double horizontalShift, double verticalShift)
          Configures the presenter to shift the domain bounds by an absolute value.
 void setFireChangeImagePixelBoundsEvent(boolean fireChangeImagePixelBoundsEvent)
          Specify whether the image gets immediately repositioned prior to loading the newly rendered one.
 void setFireLoadImageDataEvent(boolean fireLoadImageDataEvent)
          Specify whether a LoadImageDataEvent is fired.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundsShiftPresenter

public BoundsShiftPresenter(HandlerManager handlerManager,
                            BoundsShiftPresenter.View view)
Instantiates the presenter.

Parameters:
handlerManager - A HandlerManager
view - A BoundsShiftPresenter.View implementation
Method Detail

configureAbsoluteShift

public void configureAbsoluteShift(double horizontalShift,
                                   double verticalShift)
Configures the presenter to shift the domain bounds by an absolute value.

For example horizontalShift=100, verticalShift=0 will add 100 to both left and right and kepp top and bottom unchanged, thus shifting the domain bounds to the right.

Parameters:
horizontalShift - An absolute value in the units of the domain bounds (e.g. time or coordinates). Positive, negative or 0.
verticalShift - An absolute value in the units of the domain bounds (e.g. time or coordinates). Positive, negative or 0.

configureProportionalShift

public void configureProportionalShift(double horizontalShift,
                                       double verticalShift)
Configures the presenter to shift the domain bounds by an absolute value.

For example horizontalShift=0, verticalShift=-0.2 will keep left and right unchanged and subtract 20% of the total domain bounds from top and bottom, thus shifting the domain bounds to the top.

Parameters:
horizontalShift - A proportional value (0 to 1 based). Positive, negative or 0.
verticalShift - A proportional value (0 to 1 based). Positive, negative or 0.

setFireChangeImagePixelBoundsEvent

public void setFireChangeImagePixelBoundsEvent(boolean fireChangeImagePixelBoundsEvent)

Specify whether the image gets immediately repositioned prior to loading the newly rendered one.

Default is true.

Parameters:
fireChangeImagePixelBoundsEvent -

setFireLoadImageDataEvent

public void setFireLoadImageDataEvent(boolean fireLoadImageDataEvent)

Specify whether a LoadImageDataEvent is fired.

Default is true.

Parameters:
fireLoadImageDataEvent - fire it, or not


Copyright © 2010 - EES GmbH