net.refractions.udig.project.ui
Class BoundsStrategy

java.lang.Object
  extended by net.refractions.udig.project.ui.BoundsStrategy

public class BoundsStrategy
extends java.lang.Object

A strategy for determining the bounds of the map to display... Because the aspect ration of the final image is likely not the same as the viewport. Or a particualr scale is required This is used by ApplicationGIS.drawMap(net.refractions.udig.project.ui.ApplicationGIS.DrawMapParameter)

Author:
jesse
See Also:
ApplicationGIS.drawMap(net.refractions.udig.project.ui.ApplicationGIS.DrawMapParameter)

Field Summary
protected  ReferencedEnvelope boundsToDisplay
           
protected  double scaleDenominator
           
 
Constructor Summary
protected BoundsStrategy()
          For extenders
  BoundsStrategy(double scaleDenominator)
          Create a new instance that zooms to the given scale denominator with the center of the map staying unchanged.
 
Method Summary
 void setBounds(ViewportModel model, ReferencedEnvelope currentBounds)
          Sets the bounds on the viewport model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scaleDenominator

protected double scaleDenominator

boundsToDisplay

protected ReferencedEnvelope boundsToDisplay
Constructor Detail

BoundsStrategy

protected BoundsStrategy()
For extenders


BoundsStrategy

public BoundsStrategy(double scaleDenominator)
Create a new instance that zooms to the given scale denominator with the center of the map staying unchanged.

Parameters:
scaleDenominator -
Method Detail

setBounds

public void setBounds(ViewportModel model,
                      ReferencedEnvelope currentBounds)
Sets the bounds on the viewport model. This may be overridden. This implementation will set the model to boundsToDisplay if it is non-null otherwise will use the scale denominator. Or if the scaleDenominator is <1 it will zoom to the model's current bounds.

Parameters:
model - the viewport model to set the bounds on.
currentBounds - the bounds of the original map