com.blogspot.applications4android.comicreader.zoom
Class PanZoomControl

java.lang.Object
  extended by com.blogspot.applications4android.comicreader.zoom.PanZoomControl

public class PanZoomControl
extends java.lang.Object

Main class for controlling the physics of the pan-zoom-view


Field Summary
static float DAMPING_RATIO
          damping ratio of the spring
static float FRICTION_FACTOR
          friction factor for the dynamics
static float MAX_ZOOM
          maximum possible zoom
static float MIN_ZOOM
          minimum possible zoom
static float STIFFNESS
          stiffness for dynamics
 
Constructor Summary
PanZoomControl(PanZoomView pzv)
          Constructor
 
Method Summary
 boolean isMinimumZoom()
          Checks whether the current zoom is minimum or not
 void pan(float dx, float dy)
          Pan the current image
 void resetState()
          Resets the view to the original state
 void startFling(float velx, float vely)
          Starts the fling action
 void stopFling()
          Stops the previously started fling action
 void updateState()
          Update the state of the controller
 void zoom(float z, int z_mode)
          Apply zoom onto the image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_ZOOM

public static final float MIN_ZOOM
minimum possible zoom

See Also:
Constant Field Values

MAX_ZOOM

public static final float MAX_ZOOM
maximum possible zoom

See Also:
Constant Field Values

FRICTION_FACTOR

public static final float FRICTION_FACTOR
friction factor for the dynamics

See Also:
Constant Field Values

DAMPING_RATIO

public static final float DAMPING_RATIO
damping ratio of the spring

See Also:
Constant Field Values

STIFFNESS

public static final float STIFFNESS
stiffness for dynamics

See Also:
Constant Field Values
Constructor Detail

PanZoomControl

public PanZoomControl(PanZoomView pzv)
Constructor

Method Detail

updateState

public void updateState()
Update the state of the controller


resetState

public void resetState()
Resets the view to the original state


isMinimumZoom

public boolean isMinimumZoom()
Checks whether the current zoom is minimum or not

Returns:
true if it is minimum, else false

zoom

public void zoom(float z,
                 int z_mode)
Apply zoom onto the image

Parameters:
z - zoom-factor to apply
mode - zoom-in or zoom-out?

pan

public void pan(float dx,
                float dy)
Pan the current image

Parameters:
dx - pan-amount along X-axis
dy - pan-amount along Y-axis

startFling

public void startFling(float velx,
                       float vely)
Starts the fling action

Parameters:
velx - velocity along X-axis
vely - velocity along Y-axis

stopFling

public void stopFling()
Stops the previously started fling action