Package org.cytoscape.view.layout
Class AbstractLayoutAlgorithm
java.lang.Object
org.cytoscape.view.layout.AbstractLayoutAlgorithm
- All Implemented Interfaces:
CyLayoutAlgorithm
The AbstractLayoutAlgorithm provides a basic implementation of a layout TaskFactory.
Cytoscape Backwards Compatibility (Abstract Class): This class is abstract and meant to be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
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>
-
Field Summary
Fields inherited from interface org.cytoscape.view.layout.CyLayoutAlgorithm
ALL_NODE_VIEWS
-
Constructor Summary
ConstructorDescriptionAbstractLayoutAlgorithm(String computerName, String humanName, UndoSupport undoSupport)
The Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns a new layout context object.Returns the default instance of the layout context.getName()
Returns the computer-readable name of the layout.Returns the set of node attribute types potentially used by this layout algorithm.Returns the set of node attribute types potentially used by this layout algorithm.boolean
Returns true if this algorithm supports being applied to only the currently selected nodes.boolean
isReady(CyNetworkView view, Object tunableContext, Set<View<CyNode>> nodesToLayout, String attributeName)
Returns true if the task factory is ready to produce a task iterator.toString()
Returns the human-readable name of the layout.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cytoscape.view.layout.CyLayoutAlgorithm
createTaskIterator
-
Field Details
-
undoSupport
An undo support object available for use
-
-
Constructor Details
-
AbstractLayoutAlgorithm
The Constructor.- Parameters:
computerName
- a computer readable name used to construct property strings.humanName
- a user visible name of the layout.
-
-
Method Details
-
createLayoutContext
Description copied from interface:CyLayoutAlgorithm
Returns a new layout context object. This method can be used to create custom configurations for layouts.- Specified by:
createLayoutContext
in interfaceCyLayoutAlgorithm
- Returns:
- a new layout context object.
-
getDefaultLayoutContext
Description copied from interface:CyLayoutAlgorithm
Returns the default instance of the layout context. This is the default layout configuration used in most cases.- Specified by:
getDefaultLayoutContext
in interfaceCyLayoutAlgorithm
- Returns:
- the default instance of the layout context.
-
getName
Description copied from interface:CyLayoutAlgorithm
Returns the computer-readable name of the layout. To get a human readable name, use toString().- Specified by:
getName
in interfaceCyLayoutAlgorithm
- Returns:
- The computer-readable name of the layout.
-
toString
Description copied from interface:CyLayoutAlgorithm
Returns the human-readable name of the layout.- Specified by:
toString
in interfaceCyLayoutAlgorithm
- Overrides:
toString
in classObject
- Returns:
- The human-readable name of the layout.
-
getSupportedNodeAttributeTypes
Description copied from interface:CyLayoutAlgorithm
Returns the set of node attribute types potentially used by this layout algorithm. May (and frequently will) return an empty set.- Specified by:
getSupportedNodeAttributeTypes
in interfaceCyLayoutAlgorithm
- Returns:
- types of allowable attribute types.
-
getSupportedEdgeAttributeTypes
Description copied from interface:CyLayoutAlgorithm
Returns the set of node attribute types potentially used by this layout algorithm. May (and frequently will) return an empty set.- Specified by:
getSupportedEdgeAttributeTypes
in interfaceCyLayoutAlgorithm
- Returns:
- types of allowable attribute types.
-
getSupportsSelectedOnly
public boolean getSupportsSelectedOnly()Description copied from interface:CyLayoutAlgorithm
Returns true if this algorithm supports being applied to only the currently selected nodes.- Specified by:
getSupportsSelectedOnly
in interfaceCyLayoutAlgorithm
- Returns:
- true if this algorithm supports being applied to only the currently selected nodes.
-
isReady
public boolean isReady(CyNetworkView view, Object tunableContext, Set<View<CyNode>> nodesToLayout, String attributeName)Description copied from interface:CyLayoutAlgorithm
Returns true if the task factory is ready to produce a task iterator.- Specified by:
isReady
in interfaceCyLayoutAlgorithm
- Parameters:
view
- The network view that the layout algorithm should be applied to.tunableContext
- The layout context for this layout algorithm.nodesToLayout
- The set of node views to layout.attributeName
- 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.
-