Cytoscape 3.0.0-alpha8-SNAPSHOT API

org.cytoscape.view.layout
Class AbstractBasicLayoutTask

java.lang.Object
  extended by org.cytoscape.work.AbstractTask
      extended by org.cytoscape.view.layout.AbstractBasicLayoutTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
AbstractPartitionLayoutTask

public abstract class AbstractBasicLayoutTask
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.

Field Summary
protected static String LAYOUT_ALGORITHM
          The table column name that provides the layout algorithm name.
protected  CyNetworkView networkView
          The network view that the layout will be applied to.
protected  boolean selectedOnly
          Indicates whether to apply the layout to all nodes or only the selected nodes.
protected  Set<View<CyNode>> staticNodes
          The set of nodes whose positions are locked and not meant to change.
 
Fields inherited from class org.cytoscape.work.AbstractTask
cancelled
 
Constructor Summary
AbstractBasicLayoutTask(String name, AbstractLayoutAlgorithmContext context)
          Constructor.
 
Method Summary
protected abstract  void doLayout(TaskMonitor taskMonitor)
          This method is designed to actually encapsulate the layout algorithm.
protected  boolean isLocked(View<CyNode> v)
          Returns true if the specified node view is locked in place, false otherwise.
 void run(TaskMonitor taskMonitor)
          This method is called when the Task begins execution.
 
Methods inherited from class org.cytoscape.work.AbstractTask
cancel, insertTasksAfterCurrentTask, insertTasksAfterCurrentTask, setTaskIterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAYOUT_ALGORITHM

protected static final String LAYOUT_ALGORITHM
The table column name that provides the layout algorithm name.

See Also:
Constant Field Values

networkView

protected final CyNetworkView networkView
The network view that the layout will be applied to.


staticNodes

protected final Set<View<CyNode>> staticNodes
The set of nodes whose positions are locked and not meant to change.


selectedOnly

protected final boolean selectedOnly
Indicates whether to apply the layout to all nodes or only the selected nodes.

Constructor Detail

AbstractBasicLayoutTask

public AbstractBasicLayoutTask(String name,
                               AbstractLayoutAlgorithmContext context)
Constructor.

Parameters:
networkView - The network view that the layout algorithm will be applied to.
name - The name of the algorithm. Used for setting attributes associated with this layout.
selectedOnly - Indicates whether the layout should be applied to the selected nodes or not.
staticNodes - The list of nodes whose positions are meant to be locked and not changed.
Method Detail

run

public final void run(TaskMonitor taskMonitor)
Description copied from class: AbstractTask
This method is called when the Task begins execution. This method should not be called by the programmer, as it will be called by the TaskManager.

Specified by:
run in interface Task
Specified by:
run in class AbstractTask
Parameters:
taskMonitor - This is provided by TaskManager to allow the Task to modify its user interface.

isLocked

protected boolean isLocked(View<CyNode> v)
Returns true if the specified node view is locked in place, false otherwise.

Parameters:
v - The node view to test.
Returns:
True if the specified node view is locked in place, false otherwise.

doLayout

protected 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.

Parameters:
taskMonitor - Provided to allow updates to the task status.

Cytoscape 3.0.0-alpha8-SNAPSHOT API

Copyright 2011 Cytoscape Consortium. All rights reserved.