Search in sources :

Example 1 with CommandLineArgs

use of org.cytoscape.cmdline.CommandLineArgs in project cytoscape-impl by cytoscape.

the class CyActivator method start.

public void start(BundleContext bc) {
    CommandLineArgs args = getService(bc, CommandLineArgs.class);
    CyVersion cyVersion = getService(bc, CyVersion.class);
    CyShutdown cyShutdown = getService(bc, CyShutdown.class);
    StreamUtil streamUtil = getService(bc, StreamUtil.class);
    OpenSessionTaskFactory loadSession = getService(bc, OpenSessionTaskFactory.class);
    LoadNetworkFileTaskFactory networkFileLoader = getService(bc, LoadNetworkFileTaskFactory.class);
    LoadNetworkURLTaskFactory networkURLLoader = getService(bc, LoadNetworkURLTaskFactory.class);
    LoadVizmapFileTaskFactory visualStylesLoader = getService(bc, LoadVizmapFileTaskFactory.class);
    TaskManager<?, ?> taskManager = getService(bc, TaskManager.class);
    CyServiceRegistrar registrar = getService(bc, CyServiceRegistrar.class);
    CyProperty<Properties> props = (CyProperty<Properties>) getService(bc, CyProperty.class, "(cyPropertyName=cytoscape3.props)");
    StartupConfig sc = new StartupConfig(props.getProperties(), streamUtil, loadSession, networkFileLoader, networkURLLoader, visualStylesLoader, taskManager, registrar);
    Parser p = new Parser(args.getArgs(), cyShutdown, cyVersion, sc, props.getProperties());
    sc.start();
}
Also used : CyVersion(org.cytoscape.application.CyVersion) Properties(java.util.Properties) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) LoadVizmapFileTaskFactory(org.cytoscape.task.read.LoadVizmapFileTaskFactory) CyProperty(org.cytoscape.property.CyProperty) LoadNetworkURLTaskFactory(org.cytoscape.task.read.LoadNetworkURLTaskFactory) StreamUtil(org.cytoscape.io.util.StreamUtil) OpenSessionTaskFactory(org.cytoscape.task.read.OpenSessionTaskFactory) CommandLineArgs(org.cytoscape.cmdline.CommandLineArgs) LoadNetworkFileTaskFactory(org.cytoscape.task.read.LoadNetworkFileTaskFactory) CyShutdown(org.cytoscape.application.CyShutdown)

Example 2 with CommandLineArgs

use of org.cytoscape.cmdline.CommandLineArgs in project cytoscape-impl by cytoscape.

the class CyActivator method start.

public void start(BundleContext bc) {
    final CommandLineArgs args = getService(bc, CommandLineArgs.class);
    final CyVersion cyVersion = getService(bc, CyVersion.class);
    final CyShutdown cyShutdown = getService(bc, CyShutdown.class);
    final AvailableCommands availableCommands = getService(bc, AvailableCommands.class);
    final CommandExecutorTaskFactory cmdExec = getService(bc, CommandExecutorTaskFactory.class);
    final SynchronousTaskManager taskManager = getService(bc, SynchronousTaskManager.class);
    new Thread(new Runnable() {

        public void run() {
            StartupConfig sc = new StartupConfig(cmdExec, taskManager);
            Parser p = new Parser(args.getArgs(), cyShutdown, cyVersion, sc, availableCommands);
            sc.start();
            try {
                Thread.sleep(200);
            } catch (InterruptedException ie) {
                ie.printStackTrace();
            }
            cyShutdown.exit(0);
        }
    }).start();
}
Also used : CommandExecutorTaskFactory(org.cytoscape.command.CommandExecutorTaskFactory) SynchronousTaskManager(org.cytoscape.work.SynchronousTaskManager) CyVersion(org.cytoscape.application.CyVersion) AvailableCommands(org.cytoscape.command.AvailableCommands) CommandLineArgs(org.cytoscape.cmdline.CommandLineArgs) CyShutdown(org.cytoscape.application.CyShutdown)

Aggregations

CyShutdown (org.cytoscape.application.CyShutdown)2 CyVersion (org.cytoscape.application.CyVersion)2 CommandLineArgs (org.cytoscape.cmdline.CommandLineArgs)2 Properties (java.util.Properties)1 AvailableCommands (org.cytoscape.command.AvailableCommands)1 CommandExecutorTaskFactory (org.cytoscape.command.CommandExecutorTaskFactory)1 StreamUtil (org.cytoscape.io.util.StreamUtil)1 CyProperty (org.cytoscape.property.CyProperty)1 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)1 LoadNetworkFileTaskFactory (org.cytoscape.task.read.LoadNetworkFileTaskFactory)1 LoadNetworkURLTaskFactory (org.cytoscape.task.read.LoadNetworkURLTaskFactory)1 LoadVizmapFileTaskFactory (org.cytoscape.task.read.LoadVizmapFileTaskFactory)1 OpenSessionTaskFactory (org.cytoscape.task.read.OpenSessionTaskFactory)1 SynchronousTaskManager (org.cytoscape.work.SynchronousTaskManager)1