com.partnersoft.v3x.apps.MapBrowser
Class ScalingScheme

java.lang.Object
  extended by com.partnersoft.v3x.apps.MapBrowser.ScalingScheme

public class ScalingScheme
extends java.lang.Object

An object which manages the scaling policy for a map set. For example, most of our sets use prerendered base images, and therefore only have discrete scales to choose from. Others may be continuously scalable.


Constructor Summary
ScalingScheme()
          Creates a simple continuous ScalingScheme.
ScalingScheme(java.util.ArrayList scales, Scale detailScale)
          Creates a discrete ScalingScheme for the given ArrayList of Scales.
 
Method Summary
 Scale getDetailScale()
           
 java.util.ArrayList getScales()
           
 int indexOf(Scale scale)
          Returns the index of the given scale.
 boolean isBottom(Scale scaley)
          Returns true if the scale is the "bottommost" (least coarse) scale available; i.e.
 boolean isContinuous()
           
 boolean isDetail(Scale scaley)
          Returns true if the scale is at or below the "detail" scale.
 boolean isTop(Scale scaley)
          Returns true if the scale is the "topmost" (most coarse) scale available; i.e.
 void mergeScheme(ScalingScheme nother)
          Merges the given ScalingScheme into this one.
 Scale scaleAt(int index)
          Returns the scale at the given index.
 void setDetailScale(Scale newScale)
           
 void setScales(java.util.ArrayList newScales)
           
 Scale zoomIn(Scale scaley)
          Returns the next scale "lower" (finer) than the one given.
 Scale zoomOut(Scale scaley)
          Returns the next scale "higher" (coarser) than the one given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScalingScheme

public ScalingScheme()
Creates a simple continuous ScalingScheme.


ScalingScheme

public ScalingScheme(java.util.ArrayList scales,
                     Scale detailScale)
Creates a discrete ScalingScheme for the given ArrayList of Scales.

Method Detail

isTop

public boolean isTop(Scale scaley)
Returns true if the scale is the "topmost" (most coarse) scale available; i.e. you can't zoom out any more.


isBottom

public boolean isBottom(Scale scaley)
Returns true if the scale is the "bottommost" (least coarse) scale available; i.e. you can't zoom in any more.


isDetail

public boolean isDetail(Scale scaley)
Returns true if the scale is at or below the "detail" scale.


zoomOut

public Scale zoomOut(Scale scaley)
Returns the next scale "higher" (coarser) than the one given.


zoomIn

public Scale zoomIn(Scale scaley)
Returns the next scale "lower" (finer) than the one given.


scaleAt

public Scale scaleAt(int index)
Returns the scale at the given index.


indexOf

public int indexOf(Scale scale)
Returns the index of the given scale.


mergeScheme

public void mergeScheme(ScalingScheme nother)
Merges the given ScalingScheme into this one. Modifies this one as follows: if both are continuous, the result is also continuous. If only one is continuous, the result is discrete and has the same scales as the discrete one. If both are discrete, the result is discrete and has a set of scales equal to the intersection of the two original sets of scales.


isContinuous

public boolean isContinuous()

getScales

public java.util.ArrayList getScales()

setScales

public void setScales(java.util.ArrayList newScales)

getDetailScale

public Scale getDetailScale()

setDetailScale

public void setDetailScale(Scale newScale)