- All Implemented Interfaces:
- Direct Known Subclasses:
public abstract class AbstractLayoutTask extends AbstractTask
This is a basic implementation of a LayoutAlgorithm Task that does some bookkeeping, but primarily delegates to the doLayout() method. Extensions of this class are meant to operate on the CyNetworkView provided to the constructor (and is available as a protected member variable).
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.
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>layout-api</artifactId> </dependency>
Field SummaryModifier and TypeFieldDescription
protected static final StringThe table column name that provides the layout algorithm name.
protected final StringThe attribute to be used for this layout.
protected final CyNetworkViewThe network view that the layout will be applied to.The node views that will be laid out by the algorithm.
protected booleanDetermines whether the resulting set of nodes should be moved back to their original centroid after being laid out.
protected final UndoSupportUndo support for the task.
Methods inherited from class org.cytoscape.work.AbstractTask
cancel, getTaskIterator, insertTasksAfterCurrentTask, insertTasksAfterCurrentTask, setTaskIterator
LAYOUT_ALGORITHMprotected static final String LAYOUT_ALGORITHMThe table column name that provides the layout algorithm name.
- See Also:
networkViewprotected final CyNetworkView networkViewThe network view that the layout will be applied to.
nodesToLayOutThe node views that will be laid out by the algorithm.
layoutAttributeprotected final String layoutAttributeThe attribute to be used for this layout. May be null and/or ignored.
undoprotected final UndoSupport undoUndo support for the task.
recenterprotected boolean recenterDetermines whether the resulting set of nodes should be moved back to their original centroid after being laid out.
(String displayName, CyNetworkView networkView, Set<View<CyNode>> nodesToLayOut, String layoutAttribute, UndoSupport undo)Constructor.
displayName- The name of the layout algorithm.
networkView- The network view that the layout algorithm will be applied to.
nodesToLayOut- The set of nodes to be laid out.
layoutAttribute- The name of the attribute to use for the layout. May be null or empty.
runpublic final void run
(TaskMonitor taskMonitor)This method is called when the
Taskbegins execution. This method should not be called by the programmer, as it will be called by the
doLayoutprotected abstract void doLayout
(TaskMonitor taskMonitor)This method is designed to actually encapsulate the layout algorithm. It will be called from within the run() method of the task.
taskMonitor- Provided to allow updates to the task status.