ilog.tgo.composite
Class IltMixedZoomPolicy

java.lang.Object
  extended by ilog.tgo.composite.IltZoomPolicy
      extended by ilog.tgo.composite.IltLogicalZoomPolicy
          extended by ilog.tgo.composite.IltMixedZoomPolicy
All Implemented Interfaces:
IlpZoomPolicy

public class IltMixedZoomPolicy
extends IltLogicalZoomPolicy

This class implements a mixed zoom policy.

Here the zoom factor of a transformer is the square root of the absolute value of its determinant.

The default value of the determinant threshold is 1.

Since:
JTGO 2.0
See Also:
IltPhysicalZoomPolicy, IltLogicalZoomPolicy

Field Summary
 
Fields inherited from class ilog.tgo.composite.IltLogicalZoomPolicy
_additionalZoom, _targetView
 
Fields inherited from class ilog.tgo.composite.IltZoomPolicy
_ilvmanager, _manager
 
Constructor Summary
IltMixedZoomPolicy()
          Default constructor
 
Method Summary
 void attach()
          This method is called when the policy is attached to a manager.
protected  IlvTransformer computeZoomTransformer(IlvTransformer t)
          The mixed zoom is realized as follows: It all depends on the target view's transformer tt, more precisely on its scale factor (i.e.
 void detach()
          This method is called when the policy is detached from its manager.
 boolean equals(Object o)
           
 String[] getDecorationNames()
          Returns the names of the decorations that may have visibility thresholds specified in this zoom policy.
 String getDecorationNames(int index)
          Returns the name of the decoration at a given index in the list of names of decorations that may have visibility thresholds specified in this zoom policy.
 double getSubNetworkZoomFactor()
          Returns the additional zoom factor applied to subnetworks.
 double[] getVisibilityThreshold(String name)
          Returns the visibility thresholds defined in this zoom policy for a given decoration name.
 double[] getVisibilityThresholds()
          Returns the list of all visibility thresholds defined in this zoom policy.
 double getVisibilityThresholds(int index)
          Returns the visibility thresholds defined in this zoom policy for a given decoration name.
 double getZoomThreshold()
          Returns the value of the determinant threshold.
 void setDecorationNames(int index, String key)
          Sets the name for one of the decorations that have visibility thresholds specified in this zoom policy.
 void setDecorationNames(String[] keys)
          Sets the names of the decorations that have visibility thresholds specified in this zoom policy.
 void setSubNetworkZoomFactor(double subnetworkZoomFactor)
          Sets the additional zoom factor that gets applied to expanded subnetworks.
 void setVisibilityThresholds(double[] visibilityThresholds)
          Sets the visibility thresholds below which decorations with specific names are automatically hidden.
 void setVisibilityThresholds(int index, double visibilityThreshold)
          Sets the visibility thresholds below which decorations with a specific name are automatically hidden.
 void setZoomThreshold(double threshold)
          Sets the value of the zoom threshold determining when the physical zoom policy or the logical zoom policy must be used.
 
Methods inherited from class ilog.tgo.composite.IltLogicalZoomPolicy
attachView, changeZoomTransformer, detachView, getAdditionalZoom, getGraphLayoutTransformer, getTargetView, setAdditionalZoom, setTargetView, zoomTransformerChanged
 
Methods inherited from class ilog.tgo.composite.IltZoomPolicy
applyTransformerToManagerContents, getManager, setManager
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IltMixedZoomPolicy

public IltMixedZoomPolicy()
Default constructor

Method Detail

computeZoomTransformer

protected IlvTransformer computeZoomTransformer(IlvTransformer t)
The mixed zoom is realized as follows: It all depends on the target view's transformer tt, more precisely on its scale factor (i.e. Math.sqrt(Math.abs(tt.getDeterminant()))). If it is >= _zoomThreshold, we set _logicalZoomActive = true and zoomTransformer = linearized part of tt. If it is <= _zoomThreshold, we set _logicalZoomActive = false and zoomTransformer = _zoomThreshold * identity.

Overrides:
computeZoomTransformer in class IltLogicalZoomPolicy
Internal method or field: do not use!

getZoomThreshold

public double getZoomThreshold()
Returns the value of the determinant threshold.


setZoomThreshold

public void setZoomThreshold(double threshold)
Sets the value of the zoom threshold determining when the physical zoom policy or the logical zoom policy must be used. The threshold is compared against the square root of the absolute value of the view's transformer's determinant.

The default threshold is 1.


getSubNetworkZoomFactor

public double getSubNetworkZoomFactor()
Returns the additional zoom factor applied to subnetworks.


setSubNetworkZoomFactor

public void setSubNetworkZoomFactor(double subnetworkZoomFactor)
Sets the additional zoom factor that gets applied to expanded subnetworks.


attach

public void attach()
This method is called when the policy is attached to a manager. The manager is already accessible as getManager(). You should not call this method directly.

Specified by:
attach in interface IlpZoomPolicy
Overrides:
attach in class IltZoomPolicy

detach

public void detach()
This method is called when the policy is detached from its manager. The manager is still accessible as getManager(). You should not call this method directly.

Specified by:
detach in interface IlpZoomPolicy
Overrides:
detach in class IltZoomPolicy

setDecorationNames

public void setDecorationNames(String[] keys)
Sets the names of the decorations that have visibility thresholds specified in this zoom policy. The visibility thresholds determine the zoom level below which the corresponding decorations are automatically hidden.

See IltGraphicElementName for the list of decoration names.

See IltrZoom.SetVisibilityThreshold(ilog.tgo.graphic.IltGraphicElementName, double) for an explanation of visibility thresholds.

Parameters:
keys - The decoration names.
Since:
JTGO 4.0

setDecorationNames

public void setDecorationNames(int index,
                               String key)
                        throws ArrayIndexOutOfBoundsException
Sets the name for one of the decorations that have visibility thresholds specified in this zoom policy. The visibility thresholds determine the zoom level below which the corresponding decorations are automatically hidden.

See IltGraphicElementName for the list of decoration names.

See IltrZoom.SetVisibilityThreshold(ilog.tgo.graphic.IltGraphicElementName, double) for an explanation of visibility thresholds.

Parameters:
index - The index of the key being set.
key - The key value.
Throws:
ArrayIndexOutOfBoundsException
Since:
JTGO 4.0

getDecorationNames

public String[] getDecorationNames()
Returns the names of the decorations that may have visibility thresholds specified in this zoom policy.

Returns:
An array containing the decoration names.
Since:
JTGO 4.0

getDecorationNames

public String getDecorationNames(int index)
                          throws ArrayIndexOutOfBoundsException
Returns the name of the decoration at a given index in the list of names of decorations that may have visibility thresholds specified in this zoom policy.

Parameters:
index - The index of the decoration name to be retrieved.
Returns:
The decoration name that is defined at index.
Throws:
ArrayIndexOutOfBoundsException
Since:
JTGO 4.0

setVisibilityThresholds

public void setVisibilityThresholds(double[] visibilityThresholds)
Sets the visibility thresholds below which decorations with specific names are automatically hidden.

The indices of the visibility thresholds in this array must match the indices in the decoration name array.

Refer to IltrZoom.SetVisibilityThreshold(ilog.tgo.graphic.IltGraphicElementName, double) for an explanation of visibility thresholds.

A visibility setting in this zoom policy overrides the corresponding global setting.

Parameters:
visibilityThresholds - Visibility thresholds, in the same order as the specified decoration names.
See Also:
setDecorationNames(java.lang.String[]), IltrZoom.SetVisibilityThreshold(ilog.tgo.graphic.IltGraphicElementName, double)
Internal method or field: do not use!

setVisibilityThresholds

public void setVisibilityThresholds(int index,
                                    double visibilityThreshold)
                             throws ArrayIndexOutOfBoundsException
Sets the visibility thresholds below which decorations with a specific name are automatically hidden.

The decorations that are hidden are the ones that are identified by the decoration name that is positioned AT the same index in the decoration name structure.

See IltrZoom.SetVisibilityThreshold(ilog.tgo.graphic.IltGraphicElementName, double) for an explanation of visibility thresholds.

A visibility setting in this zoom policy overrides the corresponding global setting.

Parameters:
index - The index of the value being set.
visibilityThreshold - The visibility threshold.
Throws:
ArrayIndexOutOfBoundsException
Since:
JTGO 4.0
See Also:
setDecorationNames(java.lang.String[]), IltrZoom.SetVisibilityThreshold(ilog.tgo.graphic.IltGraphicElementName, double)

getVisibilityThresholds

public double[] getVisibilityThresholds()
Returns the list of all visibility thresholds defined in this zoom policy.

See IltrZoom.SetVisibilityThreshold(ilog.tgo.graphic.IltGraphicElementName, double) for an explanation of visibility thresholds.

Returns:
The visibility threshold list.
See Also:
setVisibilityThresholds(int, double)

getVisibilityThresholds

public double getVisibilityThresholds(int index)
                               throws ArrayIndexOutOfBoundsException
Returns the visibility thresholds defined in this zoom policy for a given decoration name. The decoration name is specified by its index. See setDecorationNames(int, String) for more information.

See IltrZoom.SetVisibilityThreshold(ilog.tgo.graphic.IltGraphicElementName, double) for an explanation of visibility thresholds.

Parameters:
index - The index in the list of decoration names.
Returns:
The visibility threshold at the given index.
Throws:
ArrayIndexOutOfBoundsException

getVisibilityThreshold

public double[] getVisibilityThreshold(String name)
Returns the visibility thresholds defined in this zoom policy for a given decoration name.

The value returned has been previously registered in this zoom policy using setVisibilityThresholds(double[]). If the value has not been registered, or if the given name does not correspond to a valid decoration name, this method returns null.

Refer to IltrZoom.SetVisibilityThreshold(ilog.tgo.graphic.IltGraphicElementName, double) for an explanation of visibility thresholds.

Overrides:
getVisibilityThreshold in class IltZoomPolicy
Parameters:
name - Decoration name
Returns:
Visibility threshold
See Also:
setDecorationNames(java.lang.String[]), setVisibilityThresholds(double[])
Internal method or field: do not use!

equals

public boolean equals(Object o)
Overrides:
equals in class IltLogicalZoomPolicy
Since:
JViews 7.5


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