org.graffiti.plugin.view
Class ViewportAdapter

java.lang.Object
  extended by org.graffiti.plugin.view.Viewport
      extended by org.graffiti.plugin.view.ViewportAdapter
All Implemented Interfaces:
Zoomable

public class ViewportAdapter
extends Viewport

Wraps a Zoomable as a Viewport.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner

Constructor Summary
ViewportAdapter(Zoomable zoomable)
           
 
Method Summary
 double getZoom()
          Returns the zoom factor.
 AffineTransform getZoomTransform()
          Returns the AffineTransform representing the current zoom.
 void setZoom(double factor)
          Sets the scale factor.
 
Methods inherited from class org.graffiti.plugin.view.Viewport
getDisplayBounds, getlogicalDisplayBounds, getLogicalElementsBounds, getRotation, getTranslation, getZoomRotationTransform, inverseTransform, setRotation, setSimultanously, setTranslation, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewportAdapter

public ViewportAdapter(Zoomable zoomable)
Method Detail

getZoomTransform

public AffineTransform getZoomTransform()
Description copied from interface: Zoomable
Returns the AffineTransform representing the current zoom.

Returns:
the AffineTransform representing the current zoom.

setZoom

public void setZoom(double factor)
Description copied from interface: Zoomable
Sets the scale factor. Should call ViewportEventDispatcher.onViewportChange(Viewport) on the ZoomEventDispatcher returned by MainFrame.getViewportEventDispatcher(). Do not call setZoom from within an implementation of ViewportListener.onViewportChange(Viewport), as it may cause a deadlock. An actual change of the zoom is not guaranteed. The Zoomable may arbitrarily restrict the values.

Parameters:
factor - the zoom factor to set. Smaller values yield in the display of a greater area with fewer details ("a view from greater distance"). 1.0 is the default value. Must be a finite value greater than 0.0.

getZoom

public double getZoom()
Description copied from class: Viewport
Returns the zoom factor.

Specified by:
getZoom in interface Zoomable
Overrides:
getZoom in class Viewport
Returns:
the zoom factor. Smaller values yield in the display of a greater area with fewer details ("a view from greater distance"). 1.0 is the default value. Must be a finite value greater than 0.0.


Generated at 2012-05-30 11:00:36 PM CEST