- All Implemented Interfaces:
- Direct Known Subclasses:
public abstract class AbstractPartitionLayoutTask extends AbstractLayoutTask
This is a more helpful implementation of a LayoutAlgorithm Task that extends AbstractBasicLayoutTask and does the work of partitioning the CyNetworkView so that partitions may be laid out individually. Extensions of this class are meant to implement the layoutPartition() method and operate on the LayoutParition object that is passed to that method as an argument.
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 doublePartition size used for taskMonitor.
protected doubleStarting node number used for taskMonitor.
protected EdgeWeighterThe EdgeWeighter used for edge weight calculations.
protected doubleThe value used for spacing nodes.
protected static org.slf4j.LoggerThe list of LayoutPartition objects that get laid out.
protected TaskMonitorThe TaskMonitor initially set in the run method of the task.
protected doubleTotal number of nodes used for taskMonitor.
Fields inherited from class org.cytoscape.view.layout.AbstractLayoutTask
LAYOUT_ALGORITHM, layoutAttribute, networkView, nodesToLayOut, recenter, undo
Method SummaryModifier and TypeMethodDescription
(double width, double height, double screen_width, double screen_height, List<LayoutPartition> partitionList)
voidAbstractGraphPartitionLayout implements the doLayout method of AbstractBasicLayout in which it calls the layoutParition method on each LayoutPartition object created for the network.
abstract voidOverride this method and layout the LayoutPartion just like you would a NetworkView.
(int percent)Used for
Methods inherited from class org.cytoscape.work.AbstractTask
cancel, getTaskIterator, insertTasksAfterCurrentTask, insertTasksAfterCurrentTask, setTaskIterator
loggerprotected static org.slf4j.Logger logger
taskMonitorprotected TaskMonitor taskMonitorThe TaskMonitor initially set in the run method of the task. Used to track the layout progress.
incrprotected double incrThe value used for spacing nodes. Defaults to 100.
partitionListThe list of LayoutPartition objects that get laid out.
edgeWeighterprotected EdgeWeighter edgeWeighterThe EdgeWeighter used for edge weight calculations.
current_startprotected double current_startStarting node number used for taskMonitor.
current_sizeprotected double current_sizePartition size used for taskMonitor.
total_nodesprotected double total_nodesTotal number of nodes used for taskMonitor.
(String displayName, boolean singlePartition, CyNetworkView networkView, Set<View<CyNode>> nodesToLayOut, String layoutAttribute, UndoSupport undo)Creates a new AbstractPartitionLayoutTask object.
name- The name of the layout algorithm.
singlePartition- Whether this layout algorithm should execute on a single partition instead of multiple partitions.
networkView- the CyNetworkView being partitioned.
nodesToLayOut- the set of nodes to layout.
layoutAttribute- the name of the attribute to use for this layout. Allowed to be empty or null.
layoutPartitionpublic abstract void layoutPartition
(LayoutPartition partition)Override this method and layout the LayoutPartion just like you would a NetworkView.
partition- The LayoutPartition to be laid out.
setTaskStatusprotected void setTaskStatus
(int percent)Used for
percent- The percentage of completion for this partition. Value must be between 0 and 100.
doLayoutpublic void doLayout
(TaskMonitor taskMonitor)AbstractGraphPartitionLayout implements the doLayout method of AbstractBasicLayout in which it calls the layoutParition method on each LayoutPartition object created for the network.