Package org.cytoscape.view.layout
Class AbstractLayoutAlgorithm
- java.lang.Object
-
- org.cytoscape.view.layout.AbstractLayoutAlgorithm
-
- All Implemented Interfaces:
CyLayoutAlgorithm
public abstract class AbstractLayoutAlgorithm extends Object implements CyLayoutAlgorithm
The AbstractLayoutAlgorithm provides a basic implementation of a layout TaskFactory.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 (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.
-
-
Field Summary
Fields Modifier and Type Field Description protected UndoSupportundoSupportAn undo support object available for use-
Fields inherited from interface org.cytoscape.view.layout.CyLayoutAlgorithm
ALL_NODE_VIEWS
-
-
Constructor Summary
Constructors Constructor Description AbstractLayoutAlgorithm(String computerName, String humanName, UndoSupport undoSupport)The Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectcreateLayoutContext()Returns a new layout context object.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 view, Object tunableContext, Set<View<CyNode>> nodesToLayout, String attributeName)Returns true if the task factory is ready to produce a task iterator.StringtoString()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 Detail
-
undoSupport
protected final UndoSupport undoSupport
An undo support object available for use
-
-
Constructor Detail
-
AbstractLayoutAlgorithm
public AbstractLayoutAlgorithm(String computerName, String humanName, UndoSupport undoSupport)
The Constructor.- Parameters:
computerName- a computer readable name used to construct property strings.humanName- a user visible name of the layout.
-
-
Method Detail
-
createLayoutContext
public Object createLayoutContext()
Description copied from interface:CyLayoutAlgorithmReturns a new layout context object. This method can be used to create custom configurations for layouts.- Specified by:
createLayoutContextin interfaceCyLayoutAlgorithm- Returns:
- a new layout context object.
-
getDefaultLayoutContext
public final Object getDefaultLayoutContext()
Description copied from interface:CyLayoutAlgorithmReturns the default instance of the layout context. This is the default layout configuration used in most cases.- Specified by:
getDefaultLayoutContextin interfaceCyLayoutAlgorithm- Returns:
- the default instance of the layout context.
-
getName
public String getName()
Description copied from interface:CyLayoutAlgorithmReturns the computer-readable name of the layout. To get a human readable name, use toString().- Specified by:
getNamein interfaceCyLayoutAlgorithm- Returns:
- The computer-readable name of the layout.
-
toString
public String toString()
Description copied from interface:CyLayoutAlgorithmReturns the human-readable name of the layout.- Specified by:
toStringin interfaceCyLayoutAlgorithm- Overrides:
toStringin classObject- Returns:
- The human-readable name of the layout.
-
getSupportedNodeAttributeTypes
public Set<Class<?>> getSupportedNodeAttributeTypes()
Description copied from interface:CyLayoutAlgorithmReturns the set of node attribute types potentially used by this layout algorithm. May (and frequently will) return an empty set.- Specified by:
getSupportedNodeAttributeTypesin interfaceCyLayoutAlgorithm- Returns:
- types of allowable attribute types.
-
getSupportedEdgeAttributeTypes
public Set<Class<?>> getSupportedEdgeAttributeTypes()
Description copied from interface:CyLayoutAlgorithmReturns the set of node attribute types potentially used by this layout algorithm. May (and frequently will) return an empty set.- Specified by:
getSupportedEdgeAttributeTypesin interfaceCyLayoutAlgorithm- Returns:
- types of allowable attribute types.
-
getSupportsSelectedOnly
public boolean getSupportsSelectedOnly()
Description copied from interface:CyLayoutAlgorithmReturns true if this algorithm supports being applied to only the currently selected nodes.- Specified by:
getSupportsSelectedOnlyin 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:CyLayoutAlgorithmReturns true if the task factory is ready to produce a task iterator.- Specified by:
isReadyin 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.
-
-