public abstract class AbstractLayoutTask extends AbstractTask
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>
Modifier and Type | Field and Description |
---|---|
protected static String |
LAYOUT_ALGORITHM
The table column name that provides the layout algorithm name.
|
protected String |
layoutAttribute
The attribute to be used for this layout.
|
protected CyNetworkView |
networkView
The network view that the layout will be applied to.
|
protected Set<View<CyNode>> |
nodesToLayOut
The node views that will be laid out by the algorithm.
|
protected boolean |
recenter
Determines whether the resulting set of nodes should be moved back to
their original centroid after being laid out.
|
protected UndoSupport |
undo
Undo support for the task.
|
cancelled
Constructor and Description |
---|
AbstractLayoutTask(String displayName,
CyNetworkView networkView,
Set<View<CyNode>> nodesToLayOut,
String layoutAttribute,
UndoSupport undo)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doLayout(TaskMonitor taskMonitor)
This method is designed to actually encapsulate the layout algorithm.
|
void |
run(TaskMonitor taskMonitor)
This method is called when the
Task begins execution. |
cancel, insertTasksAfterCurrentTask, insertTasksAfterCurrentTask, setTaskIterator
protected static final String LAYOUT_ALGORITHM
protected final CyNetworkView networkView
protected final Set<View<CyNode>> nodesToLayOut
protected final String layoutAttribute
protected final UndoSupport undo
protected boolean recenter
public AbstractLayoutTask(String displayName, CyNetworkView networkView, Set<View<CyNode>> nodesToLayOut, String layoutAttribute, UndoSupport undo)
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.public final void run(TaskMonitor taskMonitor)
Task
begins execution.
This method should not be called by the programmer, as it will be called by the TaskManager
.run
in interface Task
run
in class AbstractTask
taskMonitor
- The TaskMonitor
provided by TaskManager
.
to allow the Task
to modify its user interface.protected abstract void doLayout(TaskMonitor taskMonitor)
taskMonitor
- Provided to allow updates to the task status.Copyright 2011-2015 Cytoscape Consortium. All rights reserved.