Cytoscape 3.0.1 API

org.cytoscape.view.layout
Interface CyLayoutAlgorithm

All Known Implementing Classes:
AbstractLayoutAlgorithm

public interface CyLayoutAlgorithm

A task factory specifically for layout algorithms.


Cytoscape Backwards Compatibility (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.

Field Summary
static Set<View<CyNode>> ALL_NODE_VIEWS
          A convenience declaration for an empty set signifying that all node views should be laid out when creating the task iterator.
 
Method Summary
 Object createLayoutContext()
          Returns a new layout context object.
 TaskIterator createTaskIterator(CyNetworkView networkView, Object layoutContext, Set<View<CyNode>> nodesToLayOut, String layoutAttribute)
          Creates a task iterator containing the layout tasks.
 Object getDefaultLayoutContext()
          Returns the default instance of the layout context.
 String getName()
          Returns the computer-readable name of the layout.
 Set<Class<?>> getSupportedEdgeAttributeTypes()
          Returns the set of node attribute types potentially used by this layout algorithm.
 Set<Class<?>> getSupportedNodeAttributeTypes()
          Returns the set of node attribute types potentially used by this layout algorithm.
 boolean getSupportsSelectedOnly()
          Returns true if this algorithm supports being applied to only the currently selected nodes.
 boolean isReady(CyNetworkView networkView, Object layoutContext, Set<View<CyNode>> nodesToLayOut, String layoutAttribute)
          Returns true if the task factory is ready to produce a task iterator.
 String toString()
          Returns the human-readable name of the layout.
 

Field Detail

ALL_NODE_VIEWS

static final Set<View<CyNode>> ALL_NODE_VIEWS
A convenience declaration for an empty set signifying that all node views should be laid out when creating the task iterator.

Method Detail

createTaskIterator

TaskIterator createTaskIterator(CyNetworkView networkView,
                                Object layoutContext,
                                Set<View<CyNode>> nodesToLayOut,
                                String layoutAttribute)
Creates a task iterator containing the layout tasks.

Parameters:
networkView - The network view that the layout algorithm should be applied to.
layoutContext - The layout context for this layout algorithm.
nodesToLayOut - The set of node views to layout.
layoutAttribute - The possibly null name of the attribute to use for this layout.
Returns:
taskIterator contains layout tasks.

isReady

boolean isReady(CyNetworkView networkView,
                Object layoutContext,
                Set<View<CyNode>> nodesToLayOut,
                String layoutAttribute)
Returns true if the task factory is ready to produce a task iterator.

Parameters:
networkView - The network view that the layout algorithm should be applied to.
layoutContext - The layout context for this layout algorithm.
nodesToLayOut - The set of node views to layout.
layoutAttribute - The possibly null name of the attribute to use for this layout.
Returns:
true if the task factory is ready to produce a task iterator.

createLayoutContext

Object createLayoutContext()
Returns a new layout context object. This method can be used to create custom configurations for layouts.

Returns:
a new layout context object.

getDefaultLayoutContext

Object getDefaultLayoutContext()
Returns the default instance of the layout context. This is the default layout configuration used in most cases.

Returns:
the default instance of the layout context.

getSupportedNodeAttributeTypes

Set<Class<?>> getSupportedNodeAttributeTypes()
Returns the set of node attribute types potentially used by this layout algorithm. May (and frequently will) return an empty set.

Returns:
types of allowable attribute types.

getSupportedEdgeAttributeTypes

Set<Class<?>> getSupportedEdgeAttributeTypes()
Returns the set of node attribute types potentially used by this layout algorithm. May (and frequently will) return an empty set.

Returns:
types of allowable attribute types.

getSupportsSelectedOnly

boolean getSupportsSelectedOnly()
Returns true if this algorithm supports being applied to only the currently selected nodes.

Returns:
true if this algorithm supports being applied to only the currently selected nodes.

getName

String getName()
Returns the computer-readable name of the layout. To get a human readable name, use toString().

Returns:
The computer-readable name of the layout.

toString

String toString()
Returns the human-readable name of the layout.

Overrides:
toString in class Object
Returns:
The human-readable name of the layout.

Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.