jfig.canvas
Class ViewerTrafo

java.lang.Object
  extended byjfig.canvas.FigTrafo2D
      extended byjfig.canvas.ViewerTrafo
All Implemented Interfaces:
java.lang.Cloneable

public final class ViewerTrafo
extends FigTrafo2D

simple subclass of FigTrafo2D with additional zoom optnions.


Field Summary
(package private) static double[] factors
           
(package private) static double[] offsets
           
 
Fields inherited from class jfig.canvas.FigTrafo2D
anchor, COARSE_GRID, COARSE_SNAP, d_zoom_factor, debug, DOTS_PER_INCH, DOTS_PER_MM, DOTS_PER_XMM, dpi, DPI, FACTOR, FINE_GRID, FINE_SNAP, gridMode, MAX_ZOOM_FACTOR, MEDIUM_GRID, MEDIUM_SNAP, MIN_ZOOM_FACTOR, NO_GRID, NO_SNAP, p, snapDelta, snapMode, TEN_GRID, TEN_SNAP, timestamp, units, UNITS_INCHES, UNITS_MM, UNITS_STRING, UNITS_XMM, zoom_factor, zoom_factor75
 
Constructor Summary
ViewerTrafo()
          minimal constructor.
 
Method Summary
 double getGridSpacingValue()
          return the spacing (in world coordinates) of two grid points.
 void set_zoom_region(int wx, int wy, int wx2, int wy2, int width, int height)
          set_zoom_region_snapped(): set the viewport to the given region.
 void set_zoom(double zoom)
          change the zoom factor.
 
Methods inherited from class jfig.canvas.FigTrafo2D
doChangeUnits, get_units_string, get_units, getAnchor, getClone, getGridMode, getMaxZoomFactor, getMinZoomFactor, getScreenCoords, getSnap, getSnapRelative, getTimestamp, getUnits, getValueInUnits, getWorldCoords, getWorldCoords, getWorldCoordsSnapped, getWorldCoordsSnapped, getZoom, getZoomFactor_MultipleOfTwo, getZoomFactor, insideSnap, message, screen_to_wc_snapped, screen_to_wc_snapped, screen_to_wc_x, screen_to_wc_y, screen_to_wc, screen_to_wc, set_zoom_region_ooooolllllldddd, setAnchor, setGridMode, setSnapAbsolute, setSnapRelative, setUnits, wc_to_screen_x, wc_to_screen_y, wc_to_screen, wc_to_screen, wc_to_screen, wc_to_screen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

offsets

static final double[] offsets

factors

static final double[] factors
Constructor Detail

ViewerTrafo

public ViewerTrafo()
minimal constructor. Allocates the anchor and the temporary point p.

Method Detail

getGridSpacingValue

public double getGridSpacingValue()
Description copied from class: FigTrafo2D
return the spacing (in world coordinates) of two grid points.

Overrides:
getGridSpacingValue in class FigTrafo2D

set_zoom

public void set_zoom(double zoom)
change the zoom factor.

Overrides:
set_zoom in class FigTrafo2D
Parameters:
zoom - The new zoom factor. Currently only positive integers are allowed.

set_zoom_region

public void set_zoom_region(int wx,
                            int wy,
                            int wx2,
                            int wy2,
                            int width,
                            int height)
set_zoom_region_snapped(): set the viewport to the given region.

Actually, this method tries to fit the specified region as far as possible into the current window size, while limiting the zoom-factors to multiples of sqrt(2).

anchor'(

Overrides:
set_zoom_region in class FigTrafo2D
Parameters:
wx - the top left corner (x)
wy - the top left corner (y)
wx2 - the bottom right corner (x)
wy2 - (y)
width - the current window size (width)
height - (height)