Package bdv

Interface TransformEventHandler

  • All Known Implementing Classes:
    TransformEventHandler2D, TransformEventHandler3D

    public interface TransformEventHandler
    Change a transformation in response to user input (mouse events, key events, etc.) The TransformEventHandler receives notifications about changes of the canvas size (it may react for example by changing the scale of the transformation accordingly).
    Author:
    Tobias Pietzsch
    • Method Detail

      • setCanvasSize

        void setCanvasSize​(int width,
                           int height,
                           boolean updateTransform)
        This is called, when the screen size of the canvas (the component displaying the image and generating mouse events) changes. This can be used to determine screen coordinates to keep fixed while zooming or rotating with the keyboard, e.g., set these to (width/2, height/2). It can also be used to update the current source-to-screen transform, e.g., to change the zoom along with the canvas size.
        Parameters:
        width - the new canvas width.
        height - the new canvas height.
        updateTransform - whether the current source-to-screen transform should be updated. This will be false for the initial update of a new TransformEventHandler and true on subsequent calls.