org.cytoscape.cyni
Class CyniAlgorithmContext

java.lang.Object
  extended by org.cytoscape.cyni.CyniAlgorithmContext

public class CyniAlgorithmContext
extends Object

This is a class that contains several methods that are needed to display the context of a Cyni algorithm


Field Summary
protected  boolean selectedOnly
          Indicates that only selected rows should be used.
 
Constructor Summary
CyniAlgorithmContext(boolean supportsSelectedOnly)
          The constructor
 
Method Summary
 boolean contextContentValid()
          This method checks the context values to validate them.
 boolean contextHasOwnSwingPanel()
          This method tells cytoscape if this algorithm provides its own swing Panel to display the context parameters.
 List<String> getAllAttributesNumbers(org.cytoscape.model.CyTable table)
          Returns a list of the names of the columns that contains numbers(Float,Integer,Double)
 List<String> getAllAttributesStrings(org.cytoscape.model.CyTable table)
          Returns a list of the names of the columns that contains strings
 void getAttributesList(List<String> attributeList, org.cytoscape.model.CyTable table, String prefix, Object type)
          Fills a list with names of columns that has the same type that the one requested
 JPanel getContextSwingPanel()
          Returns the swing Panel that will be used instead of the tunables panel
 void setSelectedOnly(boolean selectedOnly)
          Set the flag that indicates that this algorithm should only operate on the currently selected rows.
 boolean useSelectedOnly()
          Returns whether the algorithm allows working with only selected rows
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectedOnly

protected boolean selectedOnly
Indicates that only selected rows should be used.

Constructor Detail

CyniAlgorithmContext

public CyniAlgorithmContext(boolean supportsSelectedOnly)
The constructor

Method Detail

contextHasOwnSwingPanel

public boolean contextHasOwnSwingPanel()
This method tells cytoscape if this algorithm provides its own swing Panel to display the context parameters. So it does not use Cytoscape tunables.

Returns:
True if the panel is provided by the algorithm

getContextSwingPanel

public JPanel getContextSwingPanel()
Returns the swing Panel that will be used instead of the tunables panel

Returns:
The swing Panel that will be added to the dialog used to select the context parameters

contextContentValid

public boolean contextContentValid()
This method checks the context values to validate them. It is only used if tunables are not used. Otherwise tunables already has a validation procedure.

Returns:
True if the context content is correct

setSelectedOnly

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

Parameters:
selectedOnly - set to "true" if the algorithm should only apply to selected rows only

useSelectedOnly

public boolean useSelectedOnly()
Returns whether the algorithm allows working with only selected rows

Returns:
True if the algorithm allows working with only selected rows

getAttributesList

public void getAttributesList(List<String> attributeList,
                              org.cytoscape.model.CyTable table,
                              String prefix,
                              Object type)
Fills a list with names of columns that has the same type that the one requested

Parameters:
attributeList - The list of names of columns.
table - The CyTable to get the names of attributes.
prefix - The prefix that could be added to the name of columns
type - The type of the columns

getAllAttributesStrings

public List<String> getAllAttributesStrings(org.cytoscape.model.CyTable table)
Returns a list of the names of the columns that contains strings

Parameters:
table - The CyTable to get the names of attributes.
Returns:
The list of column names

getAllAttributesNumbers

public List<String> getAllAttributesNumbers(org.cytoscape.model.CyTable table)
Returns a list of the names of the columns that contains numbers(Float,Integer,Double)

Parameters:
table - The CyTable to get the names of attributes.
Returns:
The list of column names


Copyright © 2013. All Rights Reserved.