ilog.views
Class IlvZoomFactorVisibilityFilter

java.lang.Object
  extended by ilog.views.IlvLayerVisibilityFilter
      extended by ilog.views.IlvZoomFactorVisibilityFilter
All Implemented Interfaces:
IlvPersistentObject, Serializable
Direct Known Subclasses:
IlvScaleVisibilityFilter

public class IlvZoomFactorVisibilityFilter
extends IlvLayerVisibilityFilter

Controls the visibility of a layer according to the zoom factor on the view. A zoom factory visibility filter allows a layer to be visible between a minimum zoom factor and a maximum zoom factor. Both limits can have the NO_LIMIT value if the layer should be visible for any zoom factor smaller than a minimum zoom factor or, conversely, for any zoom factor larger than a maximum zoom factor.

Since:
JViews 5.5
See Also:
Serialized Form

Field Summary
static float NO_LIMIT
          The value meaning that a scale limit is undefined.
 
Constructor Summary
IlvZoomFactorVisibilityFilter(double minZoomFactor, double maxZoomFactor)
          Initializes an IlvZoomFactorVisibilityFilter object.
IlvZoomFactorVisibilityFilter(IlvInputStream stream)
          Initializes an IlvZoomFactorVisibilityFilter from an IlvInputStream.
 
Method Summary
 double getMaxZoomFactor()
          Sets the maximum zoom factor.
 double getMinZoomFactor()
          Returns the minimum zoom factor.
 boolean isPersistent()
          Returns true if the filter must be saved.
 boolean isVisible(IlvManagerLayer layer, IlvManagerView view)
          Returns true if the zoom factor of the layer in the argument view is between the maximum and the minimum zoom factors.
 void setMaxZoomFactor(double maxZoomFactor)
          Sets the maximal zoom factor at which the filtered layer is visible.
 void setMinZoomFactor(double minZoomFactor)
          Sets the minimal zoom factor at which the filtered layer is visible.
 void setPersistent(boolean persistent)
          Specifies whether the filter must be saved or not.
 void write(IlvOutputStream stream)
          Writes the filter to an IlvOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_LIMIT

public static final float NO_LIMIT
The value meaning that a scale limit is undefined.

See Also:
Constant Field Values
Constructor Detail

IlvZoomFactorVisibilityFilter

public IlvZoomFactorVisibilityFilter(double minZoomFactor,
                                     double maxZoomFactor)
Initializes an IlvZoomFactorVisibilityFilter object. The layer will be visible if its zoom factor is between minZoomFactor and maxZoomFactor.

Parameters:
minZoomFactor - The minimum zoom factor at which the layer will be visible. If no minimum zoom factor is required, you must pass the value NO_LIMIT.
maxZoomFactor - The maximum zoom factor at which the layer will be visible. If no maximum zoom factor is required, you must pass the value NO_LIMIT.
See Also:
NO_LIMIT

IlvZoomFactorVisibilityFilter

public IlvZoomFactorVisibilityFilter(IlvInputStream stream)
                              throws IlvReadFileException
Initializes an IlvZoomFactorVisibilityFilter from an IlvInputStream.

Throws:
IlvReadFileException
Method Detail

isVisible

public boolean isVisible(IlvManagerLayer layer,
                         IlvManagerView view)
Returns true if the zoom factor of the layer in the argument view is between the maximum and the minimum zoom factors.

Specified by:
isVisible in class IlvLayerVisibilityFilter

isPersistent

public boolean isPersistent()
Returns true if the filter must be saved. By default, it returns true.

Specified by:
isPersistent in class IlvLayerVisibilityFilter

setPersistent

public void setPersistent(boolean persistent)
Specifies whether the filter must be saved or not.

Parameters:
persistent - If true, the filter will be saved.

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the filter to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvLayerVisibilityFilter
Parameters:
stream - The output stream.
Throws:
IOException - standard IO error.

getMinZoomFactor

public double getMinZoomFactor()
Returns the minimum zoom factor.


setMinZoomFactor

public void setMinZoomFactor(double minZoomFactor)
Sets the minimal zoom factor at which the filtered layer is visible.

Parameters:
minZoomFactor - The minimum zoom factor.

getMaxZoomFactor

public double getMaxZoomFactor()
Sets the maximum zoom factor.


setMaxZoomFactor

public void setMaxZoomFactor(double maxZoomFactor)
Sets the maximal zoom factor at which the filtered layer is visible.

Parameters:
maxZoomFactor - The maximum zoom factor.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.