ilog.views.graphlayout
Class IlvLayoutGraphicFilter

java.lang.Object
  extended by ilog.views.graphlayout.IlvLayoutGraphicFilter
All Implemented Interfaces:
IlvGraphicFilter

public class IlvLayoutGraphicFilter
extends Object
implements IlvGraphicFilter

This class allows you to perform the layout on a subgraph; that is, on a subset of the nodes and links of the original grapher (IlvGrapher). The accept(ilog.views.IlvGraphic) method of the filter is called by the IlvGrapherAdapter to know for any node and link whether the node or link must be taken into account or if it must be completely ignored.

To install a filter on an IlvGrapherAdapter instance, use the method IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter).

Note that all overridden implementations of the method accept(ilog.views.IlvGraphic) must respect the following rules:

See Also:
IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter)

Constructor Summary
IlvLayoutGraphicFilter()
          Creates a new IlvLayoutGraphicFilter.
IlvLayoutGraphicFilter(IlvGraphLayout layout)
          Deprecated. Beginning with JViews 3.0, you should use the constructor without any arguments and specify the filter using the method IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter).
 
Method Summary
 boolean accept(IlvGraphic nodeOrLink)
          Returns true if the graphic object nodeOrLink is a node or a link that must be taken into account during the layout.
 IlvGrapherAdapter getGrapherAdapter()
          Returns the IlvGrapherAdapter with which the filter is associated.
 IlvGraphLayout getLayout()
          Deprecated. Beginning with JViews 3.0, the filter is no longer associated with a layout instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvLayoutGraphicFilter

public IlvLayoutGraphicFilter()
Creates a new IlvLayoutGraphicFilter. To install a filter on an IlvGrapherAdapter instance, use the method IlvGrapherAdapter.setFilter.

Since:
JViews 3.0
See Also:
IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter)

IlvLayoutGraphicFilter

public IlvLayoutGraphicFilter(IlvGraphLayout layout)
Deprecated. Beginning with JViews 3.0, you should use the constructor without any arguments and specify the filter using the method IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter).

Creates a new IlvLayoutGraphicFilter This creates a filter for the layout instance layout. To install a filter on an IlvGrapherAdapter instance, use the method IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter).

See Also:
IlvLayoutGraphicFilter()
Method Detail

getGrapherAdapter

public IlvGrapherAdapter getGrapherAdapter()
Returns the IlvGrapherAdapter with which the filter is associated.


getLayout

public IlvGraphLayout getLayout()
Deprecated. Beginning with JViews 3.0, the filter is no longer associated with a layout instance

Returns the layout instance with which the filter is associated.


accept

public boolean accept(IlvGraphic nodeOrLink)
Returns true if the graphic object nodeOrLink is a node or a link that must be taken into account during the layout. If no layers are specified using the method IlvGrapherAdapter.addLayer(ilog.views.IlvManagerLayer) on the adapter instance on which the filter is installed, or if all the layers of the IlvGrapher are specified, the method returns true for node or link contained in the grapher encapsulated by the adapter. Otherwise, it returns true only for objects on the specified layers.

This method can be overridden in order to specify other conditions for filtering the nodes and the links. The overridden implementation should first check if the node or link is accepted in the superclass:

 if (!super.accept(nodeOrLink))
   return false;
 
Only after that other specific filtering rules should be applied.

Note that any overridden implementation of this method must respect the following rules:

The method throws a RuntimeException if the layout instance has no attached grapher.

Specified by:
accept in interface IlvGraphicFilter


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