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-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 (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 UndoSupport
undoSupport
An 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 Object
createLayoutContext()
Returns a new layout context object.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 view, Object tunableContext, Set<View<CyNode>> nodesToLayout, String attributeName)
Returns true if the task factory is ready to produce a task iterator.String
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 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: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
public final 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
public String 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
public String 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
public Set<Class<?>> 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
public Set<Class<?>> 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.
-
-