fr.systemsbiology.cyni
Class CyniAlgorithmContext

java.lang.Object
  extended by fr.systemsbiology.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> getAllAttributesLists(org.cytoscape.model.CyTable table)
          Returns a list of the names of the columns that contains list of strings
 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
 JPanel getContextSwingPanel()
          Returns the swing Panel that will be used instead of the tunables panel
 void getListOfAttributes(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
 Component getParentSwingComponent()
          Returns the swing parent component of this context
 void setParentSwingComponent(Component parent)
          Sets the parent component of this context so the context knows whether a swing UI has been created for this context
 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

setParentSwingComponent

public void setParentSwingComponent(Component parent)
Sets the parent component of this context so the context knows whether a swing UI has been created for this context

Parameters:
parent - The swing component parent for this context

getParentSwingComponent

public Component getParentSwingComponent()
Returns the swing parent component of this context

Returns:
The swing parent component, if null means the context does not have a corresponding UI

contextHasOwnSwingPanel

public boolean contextHasOwnSwingPanel()
This method tells cytoscape if this algorithm provides its own swing Panel to display the context parameters. If so, it will 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

getListOfAttributes

public void getListOfAttributes(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

getAllAttributesLists

public List<String> getAllAttributesLists(org.cytoscape.model.CyTable table)
Returns a list of the names of the columns that contains list of 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 © 2014. All rights reserved.