Skip to content
Snippets Groups Projects
Select Git revision
  • 1987f08349ca075bb7f34184d2c6becb5c661733
  • master default
  • dev_general
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
8 results

CyActivator.java

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    CyActivator.java 1.93 KiB
    package de.hhu.ba.yoshikoWrapper;
    
    import java.util.Properties;
    
    import org.cytoscape.application.CyApplicationManager;
    import org.cytoscape.application.swing.CyAction;
    import org.cytoscape.application.swing.CySwingApplication;
    import org.cytoscape.application.swing.CytoPanelComponent;
    import org.cytoscape.service.util.AbstractCyActivator;
    import org.osgi.framework.BundleContext;
    
    import de.hhu.ba.yoshikoWrapper.core.ConfigurationManager;
    import de.hhu.ba.yoshikoWrapper.core.Core;
    import de.hhu.ba.yoshikoWrapper.core.YoshikoLoader;
    import de.hhu.ba.yoshikoWrapper.gui.MainPanel;
    import de.hhu.ba.yoshikoWrapper.gui.MainPanelAction;
    import de.hhu.ba.yoshikoWrapper.gui.SolutionsPanel;
    
    
    public class CyActivator extends AbstractCyActivator {
    	
    	public CyActivator() {
    		super();
    	}
    		
    	@Override
    	public void start(BundleContext context) throws Exception {
    		//Initialize cytoscape configuration system
    		ConfigurationManager cm = new ConfigurationManager("yoshikoWrapper", "yoshiko.props");
    		Properties propsReaderServiceProps = new Properties();
    		propsReaderServiceProps.setProperty("cyPropertyName", "yoshiko.props");
    		registerAllServices(context,cm,propsReaderServiceProps);
    
    
    		//Attempt to find the yoshiko lib in r a previously stored location
    		YoshikoLoader.provideConfiguration(cm);
    		if (!YoshikoLoader.isLibraryLoaded()){
    			YoshikoLoader.loadLibrary(cm.getProperties().getProperty("pathToYoshiko"));
    		}
    		
    		CyApplicationManager cyApplicationManager = getService(context, CyApplicationManager.class);
    		Core.setApplicationManager(cyApplicationManager);
    		
    		CySwingApplication cytoscapeDesktopService = getService(context,CySwingApplication.class);
    		
    		//main panel and result panel
    		MainPanel mainPanel = new MainPanel();
    		SolutionsPanel solutionsPanel = new SolutionsPanel();
    		registerService(context,mainPanel,CytoPanelComponent.class, new Properties());
    		registerService(context,solutionsPanel,CytoPanelComponent.class, new Properties());
    	}
    
    }