当前位置: 首页>>代码示例>>Java>>正文


Java CySessionManager类代码示例

本文整理汇总了Java中org.cytoscape.session.CySessionManager的典型用法代码示例。如果您正苦于以下问题:Java CySessionManager类的具体用法?Java CySessionManager怎么用?Java CySessionManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CySessionManager类属于org.cytoscape.session包,在下文中一共展示了CySessionManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import org.cytoscape.session.CySessionManager; //导入依赖的package包/类
@Override
protected void configure() {
	// Bind cytoscape OSGi services
	bindService(CyServiceRegistrar.class);
	bindService(CyApplicationManager.class);
	bindService(CySwingApplication.class);
	bindService(CyNetworkManager.class);
	bindService(CyNetworkViewFactory.class);
	bindService(CyNetworkViewManager.class);
	bindService(CyNetworkFactory.class);
	bindService(IconManager.class);
	bindService(CyLayoutAlgorithmManager.class);
	bindService(CyGroupManager.class);
	bindService(CyGroupFactory.class);
	bindService(CyGroupAggregationManager.class);
	bindService(CyGroupSettingsManager.class);
	bindService(AvailableCommands.class);
	bindService(CommandExecutorTaskFactory.class);
	bindService(CySessionManager.class);
	bindService(CyEventHelper.class);
	bindService(OpenBrowser.class);
	bindService(VisualMappingManager.class);
	bindService(CyNetworkTableManager.class);
	bindService(CyTableManager.class);
	bindService(CyTableFactory.class);
	bindService(FileUtil.class);
	bindService(CyRootNetworkManager.class);
	
	bindService(DialogTaskManager.class);
	TypeLiteral<SynchronousTaskManager<?>> synchronousManager = new TypeLiteral<SynchronousTaskManager<?>>(){};
	bind(synchronousManager).toProvider(service(synchronousManager).single());
	
	bindService(AnnotationManager.class);
	TypeLiteral<AnnotationFactory<ShapeAnnotation>> shapeFactory = new TypeLiteral<AnnotationFactory<ShapeAnnotation>>(){};
	bind(shapeFactory).toProvider(service(shapeFactory).filter(ldap("(type=ShapeAnnotation.class)")).single());
	TypeLiteral<AnnotationFactory<TextAnnotation>> textFactory = new TypeLiteral<AnnotationFactory<TextAnnotation>>(){};
	bind(textFactory).toProvider(service(textFactory).filter(ldap("(type=TextAnnotation.class)")).single());
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:39,代码来源:CytoscapeServiceModule.java

示例2: start

import org.cytoscape.session.CySessionManager; //导入依赖的package包/类
@Override
public void start(BundleContext context) throws Exception {
	CyApplicationManager cyApplicationManager = getService(context, CyApplicationManager.class);
	CyNetworkViewFactory networkViewFactory = getService(context, CyNetworkViewFactory.class);
	CyNetworkFactory networkFactory = getService(context, CyNetworkFactory.class);
	CyNetworkManager networkManager = getService(context, CyNetworkManager.class);
	DialogTaskManager dialogTaskManager = getService(context, DialogTaskManager.class);
	VisualMappingManager vmmServiceRef = getService(context,VisualMappingManager.class);
	VisualStyleFactory visualStyleFactoryServiceRef = getService(context,VisualStyleFactory.class);
	VisualMappingFunctionFactory vmfFactoryC = getService(context,VisualMappingFunctionFactory.class, "(mapping.type=continuous)");
	VisualMappingFunctionFactory vmfFactoryD = getService(context,VisualMappingFunctionFactory.class, "(mapping.type=discrete)");
	VisualMappingFunctionFactory vmfFactoryP = getService(context,VisualMappingFunctionFactory.class, "(mapping.type=passthrough)");
	CyLayoutAlgorithmManager cyAlgorithmManager = getService(context, CyLayoutAlgorithmManager.class);
	CyNetworkViewManager cyNetworkViewManager = getService(context, CyNetworkViewManager.class);
	CySwingApplication cySwingApplication = getService(context, CySwingApplication.class);
	OpenBrowser openBrowser = getService(context, OpenBrowser.class);
					
	Plugin plugin = new Plugin(networkFactory, networkManager, dialogTaskManager, networkViewFactory, vmmServiceRef, visualStyleFactoryServiceRef,
			vmfFactoryC, vmfFactoryD, vmfFactoryP, cyAlgorithmManager, cyApplicationManager, cyNetworkViewManager, cySwingApplication);
	registerService(context, plugin, NetworkDestroyedListener.class, new Properties());
	
	// CyTargetLinker implements two actions: extend network and help
	ExtensionAction extAction = new ExtensionAction("Extend network", plugin);
	registerAllServices(context, extAction, new Properties());
	
	HelpAction helpAction = new HelpAction("Help", openBrowser);
	registerAllServices(context, helpAction, new Properties());
	
	// property stores last used RegIN directory
	CyTargetLinkerProperty property = new CyTargetLinkerProperty();
	CyProperty<Properties> prop = property.checkCyProperties(getService(context, CySessionManager.class));
	registerService(context, prop, CyProperty.class, new Properties());
	
	// registers the panel for CyTargetLinker
	CyTargetLinkerPanel panel = new CyTargetLinkerPanel(plugin);
	registerService(context, panel, CytoPanelComponent.class, new Properties());
}
 
开发者ID:CyTargetLinker,项目名称:cytargetlinker,代码行数:38,代码来源:CyActivator.java

示例3: checkCyProperties

import org.cytoscape.session.CySessionManager; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public CyProperty<Properties> checkCyProperties(CySessionManager cySessionManager) {
	CySession session = cySessionManager.getCurrentSession();
	
	// check if cytargetlinker directory property already exists
	boolean flag = false;
	if(session != null) {
		Set<CyProperty<?>> props = new HashSet<CyProperty<?>>();
		props = session.getProperties();
		if(props != null) {
			for (CyProperty<?> prop : props) {
			    if (prop.getName() != null){
			    	if (prop.getName().equals(CTL_RegIN_DIRECTOY_PROP)) {
			    		ctlProperty = (CyProperty<Properties>) prop;
			    		flag = true;
			    		break;
			    	}
			    }
			}
		}
	}

	if (!flag) {
		// if property does not exists yet = create new property
		CTL_PROP.setProperty(CTL_RegIN_DIRECTOY_PROP, CTL_RegIN_DIRECTORY);
		ctlProperty = new SimpleCyProperty("CyTargetLinker", CTL_PROP, String.class, CyProperty.SavePolicy.CONFIG_DIR);
	} else {
		// if property does exist - retrieve directory value
		CTL_PROP = ctlProperty.getProperties();
		CTL_RegIN_DIRECTOY_PROP = (String)CTL_PROP.get(CTL_RegIN_DIRECTOY_PROP);
	}
	return ctlProperty;
}
 
开发者ID:CyTargetLinker,项目名称:cytargetlinker,代码行数:34,代码来源:CyTargetLinkerProperty.java


注:本文中的org.cytoscape.session.CySessionManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。