Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.layout
Class AbstractLayout

java.lang.Object
  extended by cytoscape.layout.AbstractLayout
All Implemented Interfaces:
CyLayoutAlgorithm
Direct Known Subclasses:
GridNodeLayout

public abstract class AbstractLayout
extends Object
implements CyLayoutAlgorithm

The AbstractLayout provides nice starting point for Layouts written for Cytoscape.


Constructor Summary
AbstractLayout()
          The Constructor is null
 
Method Summary
abstract  void construct()
          These abstract methods must be overridden.
 void doLayout()
          doLayout on current network view.
 void doLayout(CyNetworkView nview)
          doLayout on specified network view.
 void doLayout(CyNetworkView nview, TaskMonitor monitor)
          doLayout on specified network view with specified monitor.
 List<String> getInitialAttributeList()
          This returns the list of "attributes" that are provided by an algorithm for internal purposes.
abstract  String getName()
          getName is used to construct property strings for this layout.
 LayoutProperties getSettings()
          Property handling -- these must be overridden by any algorithms that want to use properties or have a settings UI.
 JPanel getSettingsPanel()
          Returns a JPanel to be used as part of the Settings dialog for this layout algorithm.
 void halt()
          Halt the algorithm.
 void initialize()
          Initializer, calls intialize_local to start construction process.
 void lockNode(NodeView v)
          Lock this node (i.e. prevent it from moving).
 void lockNodes(NodeView[] nodes)
          Lock these nodes (i.e. prevent them from moving).
 void revertSettings()
          Property handling -- these must be overridden by any algorithms that want to use properties or have a settings UI.
 void setLayoutAttribute(String attributeName)
          Set the name of the attribute to use for attribute dependent layout algorithms.
 void setSelectedOnly(boolean selectedOnly)
          Set the flag that indicates that this algorithm should only operate on the currently selected nodes.
 byte[] supportsEdgeAttributes()
          Returns the types of edge attributes supported by this algorithm.
 byte[] supportsNodeAttributes()
          Returns the types of node attributes supported by this algorithm.
 boolean supportsSelectedOnly()
          These methods should be overridden
abstract  String toString()
          toString is used to get the user-visible name of the layout
 void unlockAllNodes()
          Unlock all nodes
 void unlockNode(NodeView v)
          Unlock this node
 void updateSettings()
          Property handling -- these must be overridden by any algorithms that want to use properties or have a settings UI.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractLayout

public AbstractLayout()
The Constructor is null

Method Detail

construct

public abstract void construct()
These abstract methods must be overridden.


getName

public abstract String getName()
getName is used to construct property strings for this layout.

Specified by:
getName in interface CyLayoutAlgorithm
Returns:
String representing the name of the layout.

toString

public abstract String toString()
toString is used to get the user-visible name of the layout

Overrides:
toString in class Object

supportsSelectedOnly

public boolean supportsSelectedOnly()
These methods should be overridden

Specified by:
supportsSelectedOnly in interface CyLayoutAlgorithm
Returns:
true if layout supports layouts on a subset of the nodes

setSelectedOnly

public void setSelectedOnly(boolean selectedOnly)
Set the flag that indicates that this algorithm should only operate on the currently selected nodes.

Specified by:
setSelectedOnly in interface CyLayoutAlgorithm
Parameters:
selectedOnly - set to "true" if the algorithm should only apply to selected nodes only

supportsNodeAttributes

public byte[] supportsNodeAttributes()
Returns the types of node attributes supported by this algorithm. This should be overloaded by the specific algorithm

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

supportsEdgeAttributes

public byte[] supportsEdgeAttributes()
Returns the types of edge attributes supported by this algorithm. This should be overloaded by the specific algorithm

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

setLayoutAttribute

public void setLayoutAttribute(String attributeName)
Set the name of the attribute to use for attribute dependent layout algorithms.

Specified by:
setLayoutAttribute in interface CyLayoutAlgorithm
Parameters:
attributeName - The name of the attribute

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 algorithmn 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
Returns:
A (possibly empty) list of attributes

getSettingsPanel

public JPanel getSettingsPanel()
Returns a JPanel to be used as part of the Settings dialog for this layout algorithm.

Specified by:
getSettingsPanel in interface CyLayoutAlgorithm
Returns:
JPanel that will be used in the LayoutSettingsDialog. If this algorithm does not support a UI for settings, it should return null

revertSettings

public void revertSettings()
Property handling -- these must be overridden by any algorithms that want to use properties or have a settings UI.

Specified by:
revertSettings in interface CyLayoutAlgorithm

updateSettings

public void updateSettings()
Property handling -- these must be overridden by any algorithms that want to use properties or have a settings UI.

Specified by:
updateSettings in interface CyLayoutAlgorithm

getSettings

public LayoutProperties getSettings()
Property handling -- these must be overridden by any algorithms that want to use properties or have a settings UI.

Specified by:
getSettings in interface CyLayoutAlgorithm
Returns:
the layout properties for this algorithm

doLayout

public void doLayout()
doLayout on current network view.

Specified by:
doLayout in interface CyLayoutAlgorithm

doLayout

public void doLayout(CyNetworkView nview)
doLayout on specified network view.

Specified by:
doLayout in interface CyLayoutAlgorithm
Parameters:
nview - the CyNetworkView on which to perform the layout

doLayout

public void doLayout(CyNetworkView nview,
                     TaskMonitor monitor)
doLayout on specified network view with specified monitor.

Specified by:
doLayout in interface CyLayoutAlgorithm
Parameters:
nview - the CyNetworkView on which to perform the layout
monitor - the task monitor to use

initialize

public void initialize()
Initializer, calls intialize_local to start construction process.


lockNodes

public void lockNodes(NodeView[] nodes)
Lock these nodes (i.e. prevent them from moving).

Specified by:
lockNodes in interface CyLayoutAlgorithm
Parameters:
nodes - An array of NodeView's to lock

lockNode

public void lockNode(NodeView v)
Lock this node (i.e. prevent it from moving).

Specified by:
lockNode in interface CyLayoutAlgorithm
Parameters:
v - A NodeView to lock

unlockNode

public void unlockNode(NodeView v)
Unlock this node

Specified by:
unlockNode in interface CyLayoutAlgorithm
Parameters:
v - A NodeView to unlock

unlockAllNodes

public void unlockAllNodes()
Unlock all nodes

Specified by:
unlockAllNodes in interface CyLayoutAlgorithm

halt

public void halt()
Halt the algorithm.

Specified by:
halt in interface CyLayoutAlgorithm

www.cytoscape.org