Cytoscape 3.0.1 API

org.cytoscape.view.layout
Class AbstractLayoutAlgorithm

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

public abstract class AbstractLayoutAlgorithm
extends Object
implements CyLayoutAlgorithm

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.

Field Summary
protected  UndoSupport undoSupport
          An undo support object available for use
 
Fields inherited from interface org.cytoscape.view.layout.CyLayoutAlgorithm
ALL_NODE_VIEWS
 
Constructor Summary
AbstractLayoutAlgorithm(String computerName, String humanName, UndoSupport undoSupport)
          The Constructor.
 
Method Summary
 Object createLayoutContext()
          Returns a new layout context object.
 Object getDefaultLayoutContext()
          Returns the default instance of the layout context.
 String getName()
          Returns the computer-readable name of the layout.
 Set<Class<?>> getSupportedEdgeAttributeTypes()
          Returns the set of node attribute types potentially used by this layout algorithm.
 Set<Class<?>> getSupportedNodeAttributeTypes()
          Returns the set of node attribute types potentially used by this layout algorithm.
 boolean getSupportsSelectedOnly()
          Returns true if this algorithm supports being applied to only the currently selected nodes.
 boolean isReady(CyNetworkView view, Object tunableContext, Set<View<CyNode>> nodesToLayout, String attributeName)
          Returns true if the task factory is ready to produce a task iterator.
 String toString()
          Returns the human-readable 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
createTaskIterator
 

Field Detail

undoSupport

protected final UndoSupport undoSupport
An undo support object available for use

Constructor Detail

AbstractLayoutAlgorithm

public AbstractLayoutAlgorithm(String computerName,
                               String humanName,
                               UndoSupport undoSupport)
The Constructor.

Parameters:
computerName - a computer readable name used to construct property strings.
humanName - a user visible name of the layout.
Method Detail

createLayoutContext

public Object createLayoutContext()
Description copied from interface: CyLayoutAlgorithm
Returns a new layout context object. This method can be used to create custom configurations for layouts.

Specified by:
createLayoutContext in interface CyLayoutAlgorithm
Returns:
a new layout context object.

getDefaultLayoutContext

public final Object getDefaultLayoutContext()
Description copied from interface: CyLayoutAlgorithm
Returns the default instance of the layout context. This is the default layout configuration used in most cases.

Specified by:
getDefaultLayoutContext in interface CyLayoutAlgorithm
Returns:
the default instance of the layout context.

getName

public String getName()
Description copied from interface: CyLayoutAlgorithm
Returns the computer-readable name of the layout. To get a human readable name, use toString().

Specified by:
getName in interface CyLayoutAlgorithm
Returns:
The computer-readable name of the layout.

toString

public String toString()
Description copied from interface: CyLayoutAlgorithm
Returns the human-readable name of the layout.

Specified by:
toString in interface CyLayoutAlgorithm
Overrides:
toString in class Object
Returns:
The human-readable name of the layout.

getSupportedNodeAttributeTypes

public Set<Class<?>> getSupportedNodeAttributeTypes()
Description copied from interface: CyLayoutAlgorithm
Returns the set of node attribute types potentially used by this layout algorithm. May (and frequently will) return an empty set.

Specified by:
getSupportedNodeAttributeTypes in interface CyLayoutAlgorithm
Returns:
types of allowable attribute types.

getSupportedEdgeAttributeTypes

public Set<Class<?>> getSupportedEdgeAttributeTypes()
Description copied from interface: CyLayoutAlgorithm
Returns the set of node attribute types potentially used by this layout algorithm. May (and frequently will) return an empty set.

Specified by:
getSupportedEdgeAttributeTypes in interface CyLayoutAlgorithm
Returns:
types of allowable attribute types.

getSupportsSelectedOnly

public boolean getSupportsSelectedOnly()
Description copied from interface: CyLayoutAlgorithm
Returns true if this algorithm supports being applied to only the currently selected nodes.

Specified by:
getSupportsSelectedOnly in interface CyLayoutAlgorithm
Returns:
true if this algorithm supports being applied to only the currently selected nodes.

isReady

public boolean isReady(CyNetworkView view,
                       Object tunableContext,
                       Set<View<CyNode>> nodesToLayout,
                       String attributeName)
Description copied from interface: CyLayoutAlgorithm
Returns true if the task factory is ready to produce a task iterator.

Specified by:
isReady in interface CyLayoutAlgorithm
Parameters:
view - The network view that the layout algorithm should be applied to.
tunableContext - The layout context for this layout algorithm.
nodesToLayout - The set of node views to layout.
attributeName - The possibly null name of the attribute to use for this layout.
Returns:
true if the task factory is ready to produce a task iterator.

Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.