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);
}
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);
}
}
Aggregations