Package it.tidalwave.image.render
Class DragPanningController
- java.lang.Object
-
- it.tidalwave.image.render.DragPanningController
-
public class DragPanningController extends java.lang.Object
This class activated panning-by-dragging, that is the capability of moving the photo in the viewport by dragging with the mouse.- Author:
- Fabrizio Giudici
-
-
Constructor Summary
Constructors Constructor Description DragPanningController(EditableImageRenderer imageRenderer)
Creates a new instance of this class, attached to the given renderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
centerImage()
Centers the image on the screen, keeping the current scale.boolean
isEnabled()
Returns true if the controller is enabled.void
setEnabled(boolean enabled)
Enables or disables this controller.
-
-
-
Constructor Detail
-
DragPanningController
public DragPanningController(EditableImageRenderer imageRenderer)
Creates a new instance of this class, attached to the given renderer. This controller must be activated withsetEnabled(true)
in order to be used.- Parameters:
imageRenderer
- the image renderer
-
-
Method Detail
-
setEnabled
public void setEnabled(boolean enabled)
Enables or disables this controller. As this class attaches some listeners to the image renderer component, it's advisable to disable it when it's not needed, in order to facilitate garbage collection.- Parameters:
enabled
- true if must be enabled, false otherwise
-
isEnabled
public boolean isEnabled()
Returns true if the controller is enabled.- Returns:
- true if enabled
-
centerImage
public void centerImage()
Centers the image on the screen, keeping the current scale.
-
-