fr.systemsbiology.cyni
Class AbstractCyniTask

java.lang.Object
  extended by org.cytoscape.work.AbstractTask
      extended by fr.systemsbiology.cyni.AbstractCyniTask
All Implemented Interfaces:
org.cytoscape.work.ObservableTask, org.cytoscape.work.Task

public abstract class AbstractCyniTask
extends org.cytoscape.work.AbstractTask
implements org.cytoscape.work.ObservableTask

This is a basic implementation of a CyniAlgorithm Task that does some bookkeeping, but primarily delegates to the doCyniTask() method.


Field Summary
protected  org.cytoscape.model.CyNetworkFactory netFactory
           
protected  org.cytoscape.model.CyNetworkManager netMgr
           
protected  org.cytoscape.model.CyNetworkTableManager netTableMgr
           
protected  org.cytoscape.model.CyNetwork newNetwork
          This variable holds the new network that will be created if an inference algorithm is executed.
protected  int nThreads
          Indicates the maximum number of threads that this task can use
protected  String outputMessage
          This variable holds the message that will be shown after task is done
protected  org.cytoscape.model.subnetwork.CyRootNetworkManager rootNetMgr
           
protected  boolean selectedOnly
          Indicates whether to apply the algorithm to all rows or only the selected rows.
protected  org.cytoscape.view.model.CyNetworkViewFactory viewFactory
           
protected  org.cytoscape.view.model.CyNetworkViewManager viewMgr
           
protected  org.cytoscape.view.vizmap.VisualMappingManager vmMgr
           
 
Fields inherited from class org.cytoscape.work.AbstractTask
cancelled
 
Constructor Summary
AbstractCyniTask(String name, CyniAlgorithmContext context)
          This Constructor can be used for Cyni tasks that don't need to create a new network such as Discretization or Imputation algorithms
AbstractCyniTask(String name, CyniAlgorithmContext context, org.cytoscape.model.CyNetworkFactory networkFactory, org.cytoscape.view.model.CyNetworkViewFactory networkViewFactory, org.cytoscape.model.CyNetworkManager networkManager, org.cytoscape.view.model.CyNetworkViewManager networkViewManager, org.cytoscape.model.CyNetworkTableManager netTableMgr, org.cytoscape.model.subnetwork.CyRootNetworkManager rootNetMgr, org.cytoscape.view.vizmap.VisualMappingManager visualMapperManager)
          Constructor.
 
Method Summary
protected abstract  void doCyniTask(org.cytoscape.work.TaskMonitor taskMonitor)
          This method is designed to actually encapsulate the cyni algorithm.
 Object getResults(Class requestedType)
           
 void run(org.cytoscape.work.TaskMonitor taskMonitor)
           
 
Methods inherited from class org.cytoscape.work.AbstractTask
cancel, insertTasksAfterCurrentTask, insertTasksAfterCurrentTask, setTaskIterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cytoscape.work.Task
cancel
 

Field Detail

netTableMgr

protected final org.cytoscape.model.CyNetworkTableManager netTableMgr

rootNetMgr

protected final org.cytoscape.model.subnetwork.CyRootNetworkManager rootNetMgr

netFactory

protected org.cytoscape.model.CyNetworkFactory netFactory

viewFactory

protected org.cytoscape.view.model.CyNetworkViewFactory viewFactory

netMgr

protected org.cytoscape.model.CyNetworkManager netMgr

viewMgr

protected org.cytoscape.view.model.CyNetworkViewManager viewMgr

vmMgr

protected org.cytoscape.view.vizmap.VisualMappingManager vmMgr

selectedOnly

protected final boolean selectedOnly
Indicates whether to apply the algorithm to all rows or only the selected rows.


nThreads

protected int nThreads
Indicates the maximum number of threads that this task can use


newNetwork

protected org.cytoscape.model.CyNetwork newNetwork
This variable holds the new network that will be created if an inference algorithm is executed.


outputMessage

protected String outputMessage
This variable holds the message that will be shown after task is done

Constructor Detail

AbstractCyniTask

public AbstractCyniTask(String name,
                        CyniAlgorithmContext context,
                        org.cytoscape.model.CyNetworkFactory networkFactory,
                        org.cytoscape.view.model.CyNetworkViewFactory networkViewFactory,
                        org.cytoscape.model.CyNetworkManager networkManager,
                        org.cytoscape.view.model.CyNetworkViewManager networkViewManager,
                        org.cytoscape.model.CyNetworkTableManager netTableMgr,
                        org.cytoscape.model.subnetwork.CyRootNetworkManager rootNetMgr,
                        org.cytoscape.view.vizmap.VisualMappingManager visualMapperManager)
Constructor.

Parameters:
name - The name of the algorithm.
context - The context with the parameters to apply the algorithm
networkFactory - The network factory to create a new network
networkViewFactory - The network view factory to create a new network view
networkManager - The network manager
networkViewManager - The network view manager
netTableMgr - The network table manager to generate a new network and its table
rootNetMgr - The root network manager to generate a new root network
vmMgr - The Visual mapping manager that allows changing the visual style of a network

AbstractCyniTask

public AbstractCyniTask(String name,
                        CyniAlgorithmContext context)
This Constructor can be used for Cyni tasks that don't need to create a new network such as Discretization or Imputation algorithms

Parameters:
name - The name of the algorithm.
context - The context with the parameters to apply the algorithm
Method Detail

run

public final void run(org.cytoscape.work.TaskMonitor taskMonitor)
Specified by:
run in interface org.cytoscape.work.Task
Specified by:
run in class org.cytoscape.work.AbstractTask

getResults

public Object getResults(Class requestedType)
Specified by:
getResults in interface org.cytoscape.work.ObservableTask

doCyniTask

protected abstract void doCyniTask(org.cytoscape.work.TaskMonitor taskMonitor)
This method is designed to actually encapsulate the cyni algorithm. It will be called from within the run() method of the task.

Parameters:
taskMonitor - Provided to allow updates to the task status.


Copyright © 2014. All rights reserved.