Cytoscape 3.0.0-alpha8-SNAPSHOT API

org.cytoscape.view.layout
Class AbstractLayoutAlgorithm<T extends CyLayoutContext>

java.lang.Object
  extended by org.cytoscape.view.layout.AbstractLayoutAlgorithm<T>
All Implemented Interfaces:
CyLayoutAlgorithm<T>

public abstract class AbstractLayoutAlgorithm<T extends CyLayoutContext>
extends Object
implements CyLayoutAlgorithm<T>

The AbstractLayoutAlgorithm provides a basic implementation of a layout TaskFactory.


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.

Constructor Summary
AbstractLayoutAlgorithm(String computerName, String humanName, boolean supportsSelectedOnly)
          The Constructor.
 
Method Summary
 List<String> getInitialAttributeList()
          This returns the list of "attributes" that are provided by an algorithm for internal purposes.
 String getName()
          A computer readable name used to construct property strings.
 boolean isReady(T tunableContext)
           
 Set<Class<?>> supportsEdgeAttributes()
          Returns the types of edge attributes supported by this algorithm.
 Set<Class<?>> supportsNodeAttributes()
          Returns the types of node attributes supported by this algorithm.
 boolean supportsSelectedOnly()
          Indicates whether this algorithm supports applying the layout only to selected nodes.
 String toString()
          Used to get the user-visible 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
createLayoutContext, createTaskIterator
 

Constructor Detail

AbstractLayoutAlgorithm

public AbstractLayoutAlgorithm(String computerName,
                               String humanName,
                               boolean supportsSelectedOnly)
The Constructor.

Parameters:
undo - the UndoSupport object used for allowing undo of layouts.
computerName - a computer readable name used to construct property strings.
humanName - a user visible name of the layout.
supportsSelectedOnly - indicates whether only selected nodes should be laid out.
Method Detail

getName

public String getName()
A computer readable name used to construct property strings.

Specified by:
getName in interface CyLayoutAlgorithm<T extends CyLayoutContext>
Returns:
a computer readable name used to construct property strings.

toString

public String toString()
Used to get the user-visible name of the layout.

Overrides:
toString in class Object
Returns:
the user-visible name of the layout.

supportsSelectedOnly

public final boolean supportsSelectedOnly()
Indicates whether this algorithm supports applying the layout only to selected nodes.

Specified by:
supportsSelectedOnly in interface CyLayoutAlgorithm<T extends CyLayoutContext>
Returns:
true if layout supports layouts on a subset of the nodes

supportsNodeAttributes

public Set<Class<?>> supportsNodeAttributes()
Returns the types of node attributes supported by this algorithm. This should be overridden by the specific algorithm.

Specified by:
supportsNodeAttributes in interface CyLayoutAlgorithm<T extends CyLayoutContext>
Returns:
the list of supported attribute types, or null if node attributes are not supported

supportsEdgeAttributes

public Set<Class<?>> supportsEdgeAttributes()
Returns the types of edge attributes supported by this algorithm. This should be overridden by the specific algorithm.

Specified by:
supportsEdgeAttributes in interface CyLayoutAlgorithm<T extends CyLayoutContext>
Returns:
the list of supported attribute types, or null if edge attributes are not supported

getInitialAttributeList

public List<String> getInitialAttributeList()
This returns the list of "attributes" that are provided by an algorithm for internal purposes. For example, an edge-weighted algorithm might seed the list of attributes with "unweighted". This should be overloaded by algorithms that intend to return custom attributes.

Specified by:
getInitialAttributeList in interface CyLayoutAlgorithm<T extends CyLayoutContext>
Returns:
A (possibly empty) list of attributes

isReady

public boolean isReady(T tunableContext)
Specified by:
isReady in interface CyLayoutAlgorithm<T extends CyLayoutContext>

Cytoscape 3.0.0-alpha8-SNAPSHOT API

Copyright 2011 Cytoscape Consortium. All rights reserved.