Package org.cytoscape.view.layout
Interface CyLayoutAlgorithmManager
public interface CyLayoutAlgorithmManager
This class provides access to the available layout algorithms.
Module: layout-api
To 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 (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a collection of all available layouts.Returns Cytoscape's default layout.Returns a layout algorithm of the specified name and null if no algorithm exists with that name.getLayoutAttribute(CyLayoutAlgorithm layout, CyNetworkView view)
Returns the attribute name that has been associated with the layout, or the empty string if there is no valid attribute associated to the layout for the given view.setDefaultLayout(CyLayoutAlgorithm layout)
Changes Cytoscape's default layout.void
setLayoutAttribute(CyLayoutAlgorithm layout, String layoutAttribute)
Associates an attribute name with the layout.
-
Field Details
-
DEFAULT_LAYOUT_NAME
The name of the default layout.- See Also:
- Constant Field Values
-
DEFAULT_LAYOUT_PROPERTY_NAME
The name of the default layout property.- See Also:
- Constant Field Values
-
-
Method Details
-
getLayout
Returns a layout algorithm of the specified name and null if no algorithm exists with that name.- Parameters:
name
- The name of the algorithm.- Returns:
- a layout algorithm of the specified name and null if no algorithm exists with that name.
-
getAllLayouts
Collection<CyLayoutAlgorithm> getAllLayouts()Returns a collection of all available layouts.- Returns:
- a collection of all available layouts.
-
getDefaultLayout
CyLayoutAlgorithm getDefaultLayout()Returns Cytoscape's default layout.- Returns:
- the default layout.
-
setDefaultLayout
Changes Cytoscape's default layout.- Parameters:
layout
- The new default algorithm
-
getLayoutAttribute
Returns the attribute name that has been associated with the layout, or the empty string if there is no valid attribute associated to the layout for the given view. The attribute name may be a node or edge column name. Note, if an attribute was associated with the given layout using thesetLayoutAttribute(CyLayoutAlgorithm, String)
method, but the given CyNetworkView does not support that attribute, then the empty string will be returned instead.- Parameters:
view
- If null returns the value set usingsetLayoutAttribute(CyLayoutAlgorithm, String)
. If view is not null then returns the attribute if it is valid for the given view. If the attribute is not valid for the given view then the empty string is returned.- Returns:
- May return null if no attribute has been associated with the layout.
- See Also:
CyLayoutAlgorithm.getSupportedEdgeAttributeTypes()
,CyLayoutAlgorithm.getSupportedNodeAttributeTypes()
,setLayoutAttribute(CyLayoutAlgorithm, String)
-
setLayoutAttribute
Associates an attribute name with the layout. This attribute may be passed as the layoutAttribute parameter to theCyLayoutAlgorithm.createTaskIterator(org.cytoscape.view.model.CyNetworkView, Object, java.util.Set, String)
method when running the layout. The attribute name may be a node or edge column name.- Parameters:
layoutAttribute
- May be null.- See Also:
CyLayoutAlgorithm.getSupportedEdgeAttributeTypes()
,CyLayoutAlgorithm.getSupportedNodeAttributeTypes()
-