com.openpcl.viewer.zoom
Class PosZoomLogic

java.lang.Object
  extended by com.openpcl.viewer.zoom.PosZoomLogic

public class PosZoomLogic
extends Object

Zoom logic

Author:
howard 6/13/2006

Field Summary
protected  double mCurrentZoomFactor
           
protected  boolean mIsZoomModeZoomWidth
           
protected  int mZoomArrayIndex
           
static int sNumPixels85Inches
           
static int sPrintDotsPerInch
           
protected static int sZoomArrayIndexMax
           
protected static int sZoomArrayIndexMin
           
protected static double[] sZoomNotchesArray
           
 
Constructor Summary
PosZoomLogic()
          Constructor
 
Method Summary
 void freeUpMemory()
          When the user is done with this rendering session, then free up memory
 double getCurrentZoomFactor()
          Get the current zoom factor.
 boolean isZoomModeZoomWidth()
          Get if zoom mode is zoom width right now.
 void setCurrentZoomFactor(double pZoomFactor)
          Set the current zoom factor
 void setToInitialValues()
          Set to initial values
 void setZoomBasedOnUserWindowWidth(int pNumberOfWidthPixels)
          For Zoom Width, set the current zoom factor from the user's window width number of pixels
 void setZoomModeZoomWidth(boolean pValue)
          Set if zoom mode is zoom width.
 double zoomInOneNotch()
          Zoom in one notch.
 double zoomOutOneNotch()
          Zoom out one notch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sZoomNotchesArray

protected static final double[] sZoomNotchesArray

mZoomArrayIndex

protected int mZoomArrayIndex

mCurrentZoomFactor

protected double mCurrentZoomFactor

mIsZoomModeZoomWidth

protected boolean mIsZoomModeZoomWidth

sZoomArrayIndexMin

protected static final int sZoomArrayIndexMin
See Also:
Constant Field Values

sZoomArrayIndexMax

protected static final int sZoomArrayIndexMax
See Also:
Constant Field Values

sPrintDotsPerInch

public static final int sPrintDotsPerInch
See Also:
Constant Field Values

sNumPixels85Inches

public static final int sNumPixels85Inches
See Also:
Constant Field Values
Constructor Detail

PosZoomLogic

public PosZoomLogic()
Constructor

Method Detail

setToInitialValues

public void setToInitialValues()
Set to initial values


freeUpMemory

public void freeUpMemory()
When the user is done with this rendering session, then free up memory


setZoomModeZoomWidth

public void setZoomModeZoomWidth(boolean pValue)
Set if zoom mode is zoom width. When the user clicks the zoom width icon on the toolbar, this gets called with true. When the user clicks the zoom in our out button then this gets called with false.

Parameters:
pValue -

isZoomModeZoomWidth

public boolean isZoomModeZoomWidth()
Get if zoom mode is zoom width right now. This is determined by the the zoom width button on the toolbar

Returns:
boolean

setCurrentZoomFactor

public void setCurrentZoomFactor(double pZoomFactor)
Set the current zoom factor

Parameters:
pZoomFactor -

setZoomBasedOnUserWindowWidth

public void setZoomBasedOnUserWindowWidth(int pNumberOfWidthPixels)
For Zoom Width, set the current zoom factor from the user's window width number of pixels

Parameters:
pNumberOfWidthPixels -

getCurrentZoomFactor

public double getCurrentZoomFactor()
Get the current zoom factor. 100.0 means zoomed in all the way and the image is really big and you have to scroll around to see up and down, right and left. 10.0 means zoomed out all the way and the image is really small and you can't even read it. If zoom mode is zoom width zoom, then use the current zoom factor. else if not zoom width, then use the double array zoom factors of 10, 15, 20, 25, by 5s up to 100 max

Returns:
double

zoomInOneNotch

public double zoomInOneNotch()
Zoom in one notch. Notches are 10%, 20% by 10s up to 100% the max

Returns:
double

zoomOutOneNotch

public double zoomOutOneNotch()
Zoom out one notch. Notches are 10%, 20% by 10s up to 400% the max

Returns:
double


OpenPCL http://www.openpcl.com