Package org.cytoscape.view.layout
Interface CyLayoutAlgorithm
-
- All Known Implementing Classes:
AbstractLayoutAlgorithm
public interface CyLayoutAlgorithmA task factory specifically for layout algorithms.Module:
layout-apiTo use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>layout-api</artifactId> </dependency>
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
Fields Modifier and Type Field Description static Set<View<CyNode>>ALL_NODE_VIEWSA convenience declaration for an empty set signifying that all node views should be laid out when creating the task iterator.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectcreateLayoutContext()Returns a new layout context object.TaskIteratorcreateTaskIterator(CyNetworkView networkView, Object layoutContext, Set<View<CyNode>> nodesToLayOut, String layoutAttribute)Creates a task iterator containing the layout tasks.ObjectgetDefaultLayoutContext()Returns the default instance of the layout context.StringgetName()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.booleangetSupportsSelectedOnly()Returns true if this algorithm supports being applied to only the currently selected nodes.booleanisReady(CyNetworkView networkView, Object layoutContext, Set<View<CyNode>> nodesToLayOut, String layoutAttribute)Returns true if the task factory is ready to produce a task iterator.StringtoString()Returns the human-readable name of the layout.
-
-
-
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.
-
-