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

cytoscape.layout
Interface CyLayoutAlgorithm

All Known Implementing Classes:
AbstractLayout, GridNodeLayout, LayoutAdapter

public interface CyLayoutAlgorithm


Method Summary
 void doLayout()
          This method performs the layout on the current network using the current network view.
 void doLayout(CyNetworkView networkView)
          This method performs the layout on the current network.
 void doLayout(CyNetworkView networkView, TaskMonitor monitor)
          This method performs the layout on the current network, but assumes that the layout is part of an existing monitored task
 List<String> getInitialAttributeList()
          This returns a (possibly empty) List of Strings that is used for the attribute list in the menu for attribute-based layouts.
 String getName()
          Get the name of this layout.
 LayoutProperties getSettings()
          This method is used to ask the algorithm to get all of its tunables and return them to the caller.
 JPanel getSettingsPanel()
          This method should return a JPanel that implements the UI to set the tuneable parameters for the algorithm.
 void halt()
          Can be used to stop the layout from running.
 void lockNode(NodeView v)
          Lock this node.
 void lockNodes(NodeView[] nodes)
          Lock this array of nodes.
 void revertSettings()
          This method is used to ask the algorithm to revert its settings to some previous state.
 void setLayoutAttribute(String attributeName)
          Sets the attribute to use for node- or edge- based attribute layouts
 void setSelectedOnly(boolean selectedOnly)
          Sets the "selectedOnly" flag
 byte[] supportsEdgeAttributes()
          Tests to see if this layout supports doing a layout based on edge attributes.
 byte[] supportsNodeAttributes()
          Tests to see if this layout supports doing a layout based on node attributes.
 boolean supportsSelectedOnly()
          Tests to see if this layout supports doing a layout on a subset of the nodes in this network view.
 void unlockAllNodes()
          Unlock all of the nodes.
 void unlockNode(NodeView v)
          Unlock this node.
 void updateSettings()
          This method is used to ask the algorithm to get its settings from the settings dialog.
 

Method Detail

doLayout

void doLayout()
This method performs the layout on the current network using the current network view.


doLayout

void doLayout(CyNetworkView networkView)
This method performs the layout on the current network.

Parameters:
networkView - the CyNetworkView on which to perform the layout

doLayout

void doLayout(CyNetworkView networkView,
              TaskMonitor monitor)
This method performs the layout on the current network, but assumes that the layout is part of an existing monitored task

Parameters:
networkView - the CyNetworkView on which to perform the layout
monitor - the task monitor to use

supportsSelectedOnly

boolean supportsSelectedOnly()
Tests to see if this layout supports doing a layout on a subset of the nodes in this network view.

Returns:
true if layout supports layouts on a subset of the nodes

setSelectedOnly

void setSelectedOnly(boolean selectedOnly)
Sets the "selectedOnly" flag

Parameters:
selectedOnly - boolean value that tells the layout algorithm whether to only layout the selected nodes

supportsNodeAttributes

byte[] supportsNodeAttributes()
Tests to see if this layout supports doing a layout based on node attributes.

Returns:
byte array of allowable attribute types or "null" if not supported. If the first type is "-1", all types are supported

supportsEdgeAttributes

byte[] supportsEdgeAttributes()
Tests to see if this layout supports doing a layout based on edge attributes.

Returns:
type array of allowable attribute types or "null" if not supported. If the first type is "-1", all types are supported

setLayoutAttribute

void setLayoutAttribute(String attributeName)
Sets the attribute to use for node- or edge- based attribute layouts

Parameters:
attributeName - String with the name of the attribute to use

getInitialAttributeList

List<String> getInitialAttributeList()
This returns a (possibly empty) List of Strings that is used for the attribute list in the menu for attribute-based layouts. This allows layout algorithms to provide "special" attributes. For example, a force directed layout might want to set the list to ["(unweighted)"] to allow the user to perform an unweighted layout. Note that this value will be set using setLayoutAttribute() just like other attributes, so the layout algorithm will need to check for it.

Returns:
List of Strings

getSettingsPanel

JPanel getSettingsPanel()
This method should return a JPanel that implements the UI to set the tuneable parameters for the algorithm.

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

revertSettings

void revertSettings()
This method is used to ask the algorithm to revert its settings to some previous state. It is called from the settings dialog when the user presses the "Cancel" button. NOTE: AbstractLayout implements this on behalf of all its subclasses by using Java Preferences.


updateSettings

void updateSettings()
This method is used to ask the algorithm to get its settings from the settings dialog. It is called from the settings dialog when the user presses the "Done" or the "Execute" buttons. NOTE: AbstractLayout implements this on behalf of all its subclasses by using Java Preferences.


getSettings

LayoutProperties getSettings()
This method is used to ask the algorithm to get all of its tunables and return them to the caller.

Returns:
the layout properties for this algorithm

getName

String getName()
Get the name of this layout.

Returns:
String representing the name of the layout.

lockNodes

void lockNodes(NodeView[] nodes)
Lock this array of nodes. Locking a node prevents the node from being moved by layout algorithmes.

Parameters:
nodes - the array of nodes to lock

lockNode

void lockNode(NodeView v)
Lock this node. Locking a node prevents the node from being moved by layout algorithmes.

Parameters:
v - the NodeView of the node to lock

unlockNode

void unlockNode(NodeView v)
Unlock this node. Unlocking a node allows the node to be moved by a layout algorithmes.

Parameters:
v - the node to unlock

unlockAllNodes

void unlockAllNodes()
Unlock all of the nodes. Unlocking a node allows the node to be moved by a layout algorithmes.


halt

void halt()
Can be used to stop the layout from running.


www.cytoscape.org