Search in sources :

Example 61 with CyServiceRegistrar

use of org.cytoscape.service.util.CyServiceRegistrar in project PhenomeScape by soulj.

the class CyActivator method start.

@Override
public void start(BundleContext context) throws Exception {
    CyServiceRegistrar cyServiceRegistrar = getService(context, CyServiceRegistrar.class);
    CyApplicationManager cyApplicationManager = getService(context, CyApplicationManager.class);
    LoadHumanNetworkMenuAction loadHumanNetworkMenuAction = new LoadHumanNetworkMenuAction(cyApplicationManager, cyServiceRegistrar);
    LoadMouseNetworkMenuAction loadMouseNetworkMenuAction = new LoadMouseNetworkMenuAction(cyApplicationManager, cyServiceRegistrar);
    TableManager myTableManager = new TableManager(cyServiceRegistrar);
    Properties properties = new Properties();
    registerAllServices(context, loadHumanNetworkMenuAction, properties);
    registerAllServices(context, loadMouseNetworkMenuAction, properties);
    CyTableManager cyTableManager = getService(context, CyTableManager.class);
    ControlPanel myControlPanel = new ControlPanel(cyServiceRegistrar, cyTableManager);
    registerService(context, myControlPanel, CytoPanelComponent.class, properties);
    ResultsPanel myResultsPanel = new ResultsPanel(cyServiceRegistrar);
    registerService(context, myResultsPanel, CytoPanelComponent.class, properties);
}
Also used : CyApplicationManager(org.cytoscape.application.CyApplicationManager) CyTableManager(org.cytoscape.model.CyTableManager) LoadMouseNetworkMenuAction(org.cytoscape.phenomescape.internal.listeners.LoadMouseNetworkMenuAction) TableManager(org.cytoscape.phenomescape.internal.util.TableManager) CyTableManager(org.cytoscape.model.CyTableManager) Properties(java.util.Properties) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) LoadHumanNetworkMenuAction(org.cytoscape.phenomescape.internal.listeners.LoadHumanNetworkMenuAction)

Example 62 with CyServiceRegistrar

use of org.cytoscape.service.util.CyServiceRegistrar in project PhenomeScape by soulj.

the class NetworkSelectedListener method itemStateChanged.

@Override
public void itemStateChanged(ItemEvent event) {
    if (event.getStateChange() == ItemEvent.SELECTED) {
        CyServiceRegistrar cyServiceRegistrar = controlPanel.cyServiceRegistrar;
        JComboBox comboBox = (JComboBox) event.getSource();
        String item = (String) comboBox.getSelectedItem();
        CommandExecutor.execute("network set current network=" + '"' + item + '"', cyServiceRegistrar);
        CyNetwork selectedNetwork = cyServiceRegistrar.getService(CyApplicationManager.class).getCurrentNetwork();
        CyTable selectedTable = selectedNetwork.getDefaultNodeTable();
        Collection<CyColumn> columns = selectedTable.getColumns();
        DefaultComboBoxModel geneNameComboModel = new DefaultComboBoxModel();
        DefaultComboBoxModel foldChangeComboModel = new DefaultComboBoxModel();
        DefaultComboBoxModel pvalueComboModel = new DefaultComboBoxModel();
        for (CyColumn column : columns) {
            geneNameComboModel.addElement(column.getName());
            foldChangeComboModel.addElement(column.getName());
            pvalueComboModel.addElement(column.getName());
        }
        controlPanel.setGeneName(geneNameComboModel);
        controlPanel.setFoldChange(foldChangeComboModel);
        controlPanel.setPvalue(pvalueComboModel);
    }
}
Also used : CyApplicationManager(org.cytoscape.application.CyApplicationManager) CyTable(org.cytoscape.model.CyTable) JComboBox(javax.swing.JComboBox) CyColumn(org.cytoscape.model.CyColumn) CyNetwork(org.cytoscape.model.CyNetwork) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Aggregations

CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)62 Properties (java.util.Properties)32 CyEventHelper (org.cytoscape.event.CyEventHelper)14 VisualMappingManager (org.cytoscape.view.vizmap.VisualMappingManager)13 CyApplicationManager (org.cytoscape.application.CyApplicationManager)12 UndoSupport (org.cytoscape.work.undo.UndoSupport)12 TaskIterator (org.cytoscape.work.TaskIterator)11 CyNetwork (org.cytoscape.model.CyNetwork)10 Task (org.cytoscape.work.Task)10 Before (org.junit.Before)10 Test (org.junit.Test)10 CyNetworkManager (org.cytoscape.model.CyNetworkManager)7 CyNetworkViewManager (org.cytoscape.view.model.CyNetworkViewManager)7 TaskFactory (org.cytoscape.work.TaskFactory)7 CyGroupManager (org.cytoscape.group.CyGroupManager)6 CyNetworkFactory (org.cytoscape.model.CyNetworkFactory)6 CyRootNetworkManager (org.cytoscape.model.subnetwork.CyRootNetworkManager)6 CyNetworkNaming (org.cytoscape.session.CyNetworkNaming)6 RenderingEngineManager (org.cytoscape.view.presentation.RenderingEngineManager)6 CyNetworkView (org.cytoscape.view.model.CyNetworkView)5