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


Java Activity类代码示例

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


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

示例1: findActivity

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
protected Activity findActivity() {
	if (getContextualSelection() == null)
		return null;
	Object selection = getContextualSelection().getSelection();
	if (selection instanceof Activity) {
		Activity activity = (Activity) selection;
		if (activity.getType().equals(activityType))
			return activity;
	}
	if (selection instanceof Processor) {
		Processor processor = (Processor) selection;
		Profile profile = processor.getParent().getParent().getMainProfile();
		for (ProcessorBinding processorBinding : scufl2Tools.processorBindingsForProcessor(processor, profile))
			if (processorBinding.getBoundActivity().getType().equals(activityType))
				return processorBinding.getBoundActivity();
	}
	return null;
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:19,代码来源:AbstractConfigureActivityMenuAction.java

示例2: createInputPort

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
private void createInputPort(Activity activity, List<Edit<?>> editList,
		List<ProcessorBinding> processorBindings,
		ActivityPortConfiguration portDefinition) {
	InputActivityPort actPort = new InputActivityPort(null,
			portDefinition.getName());
	actPort.setDepth(portDefinition.getDepth());
	// add port to activity
	editList.add(new AddChildEdit<>(activity, actPort));
	for (ProcessorBinding processorBinding : processorBindings) {
		Processor processor = processorBinding.getBoundProcessor();
		// add a new processor port
		InputProcessorPort procPort = new InputProcessorPort();
		procPort.setName(portDefinition.getName());
		procPort.setDepth(portDefinition.getDepth());
		editList.add(new AddProcessorInputPortEdit(processor, procPort));
		// add a new port binding
		ProcessorInputPortBinding binding = new ProcessorInputPortBinding();
		binding.setBoundProcessorPort(procPort);
		binding.setBoundActivityPort(actPort);
		editList.add(new AddChildEdit<>(processorBinding, binding));
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:23,代码来源:ActivityConfigurationDialog.java

示例3: setDialog

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
protected static void setDialog(Activity activity,
		ActivityConfigurationDialog dialog, FileManager fileManager) {
	if (listener == null) {
		listener = new DataflowCloseListener();
		/*
		 * Ensure that the DataflowCloseListener is the first notified
		 * listener. Otherwise you cannot save the configurations.
		 */
		List<Observer<FileManagerEvent>> existingListeners = fileManager
				.getObservers();
		fileManager.addObserver(listener);
		for (Observer<FileManagerEvent> observer : existingListeners)
			if (!observer.equals(listener)) {
				fileManager.removeObserver(observer);
				fileManager.addObserver(observer);
			}
	}
	if (configurationDialogs.containsKey(activity)) {
		ActivityConfigurationDialog currentDialog = configurationDialogs
				.get(activity);
		if (!currentDialog.equals(dialog) && currentDialog.isVisible())
			currentDialog.setVisible(false);
	}
	configurationDialogs.put(activity, dialog);
	dialog.setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:27,代码来源:ActivityConfigurationAction.java

示例4: generateInputPorts

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
private void generateInputPorts(Activity beanshell) {
	if (processorToCompare == null) {
	    return;
	}
	for (OutputProcessorPort procOut : processorToCompare.getOutputPorts()) {
	    // Any of the outputs are available to the script, giving
	    // a custom script that compares multiple outputs a better
	    // starting point.
		String portName = procOut.getName();
		if (portName.equals(loopProperties.findValue(COMPARE_PORT).asText()) ||
		        (loopProperties.findValue(IS_FEED_BACK).asBoolean())) {
			InputActivityPort input = new InputActivityPort(beanshell, portName);
			input.setDepth(procOut.getDepth());
			input.setParent(beanshell);
		}
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:18,代码来源:ActivityGenerator.java

示例5: DataflowActivityContextualView

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
public DataflowActivityContextualView(Activity activity, EditManager editManager,
		FileManager fileManager, MenuManager menuManager,
		ActivityIconManager activityIconManager, ColourManager colourManager,
		ServiceDescriptionRegistry serviceDescriptionRegistry,
		WorkbenchConfiguration workbenchConfiguration, SelectionManager selectionManager) {
	super(activity, colourManager);
	this.editManager = editManager;
	this.fileManager = fileManager;
	this.menuManager = menuManager;
	this.activityIconManager = activityIconManager;
	this.colourManager = colourManager;
	this.serviceDescriptionRegistry = serviceDescriptionRegistry;
	this.workbenchConfiguration = workbenchConfiguration;
	this.selectionManager = selectionManager;
	addEditButtons();
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:17,代码来源:DataflowActivityContextualView.java

示例6: testCompletenessOfSpecifiedActivities

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
@Test
public void testCompletenessOfSpecifiedActivities() {
	DummyProfile profile = new DummyProfile();
	// The fields will default to null
	profile.setActivities(new NamedSet<Activity>());
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(profile, true, rcvl);
	
	Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
	boolean problem = false;
	for (NullFieldProblem nlp : nullFieldProblems) {
		if (nlp.getBean().equals(profile) && nlp.getFieldName().equals("activities")) {
			problem = true;
		}
	}
	assertFalse(problem);
	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:22,代码来源:TestProfile.java

示例7: testIdenticalConfigurableTypes

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
@Test
public void testIdenticalConfigurableTypes() {
	Configuration configuration = new Configuration();
	Activity a = new Activity();
	URI tavernaUri = null;
	try {
		tavernaUri = new URI("http://www.taverna.org.uk");
	} catch (URISyntaxException e) {
		return;
	}
	configuration.setConfigures(a);
	configuration.setType(tavernaUri);
	a.setType(tavernaUri);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(configuration, false, rcvl);
	
	Set<MismatchConfigurableTypeProblem> mismatchConfigurableTypeProblems = rcvl.getMismatchConfigurableTypeProblems();
	assertEquals(0, mismatchConfigurableTypeProblems.size());
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:23,代码来源:TestConfiguration.java

示例8: testCompletenessOfMissingConfigurableType

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
@Test
public void testCompletenessOfMissingConfigurableType() {
	Activity a = new Activity();
	a.setType(null);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(a, true, rcvl);
	
	Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
	assertFalse(nullFieldProblems.isEmpty());
	boolean problem = false;
	for (NullFieldProblem nlp : nullFieldProblems) {
		if (nlp.getBean().equals(a) && nlp.getFieldName().equals("configurableType")) {
			problem = true;
		}
	}
	assertTrue(problem);
	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:22,代码来源:TestTyped.java

示例9: testFileURI

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
@Test
public void testFileURI() throws URISyntaxException {
	Activity a = new Activity();
	URI type = new URI("file:///fred/soup");
	a.setType(type);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(a, false, rcvl);
	
	Set<NonAbsoluteURIProblem> problems = rcvl.getNonAbsoluteURIProblems();
	boolean problem = false;
	for (NonAbsoluteURIProblem p : problems) {
		if (p.getBean().equals(a) && p.getFieldName().equals("configurableType") && p.getFieldValue().equals(type)) {
			problem = true;
		}
	}
	assertTrue(problem);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:21,代码来源:TestTyped.java

示例10: createProcessorFromActivity

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
@Test
public void createProcessorFromActivity() throws Exception {
	Profile profile = new Profile();
	Activity a = new Activity();
	a.setParent(profile);
	new InputActivityPort(a, "in1");
	new InputActivityPort(a, "in2").setDepth(1);		
	new OutputActivityPort(a, "out1");
	new OutputActivityPort(a, "out2").setDepth(0);		
	OutputActivityPort aOut3 = new OutputActivityPort(a, "out3");
	aOut3.setDepth(2);
	aOut3.setGranularDepth(1);
	
	ProcessorBinding binding = scufl2Tools.createProcessorAndBindingFromActivity(a);
	Processor p = binding.getBoundProcessor();
	assertEquals(profile, binding.getParent());
	
	assertEquals(2, p.getInputPorts().size());
	assertEquals(3, p.getOutputPorts().size());
	assertEquals(2, binding.getInputPortBindings().size());
	assertEquals(3, binding.getOutputPortBindings().size());
	assertEquals(a, binding.getBoundActivity());
	assertEquals(p, binding.getBoundProcessor());

}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:26,代码来源:TestScufl2Tools.java

示例11: parseConfiguration

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
		ConfigBean configBean, ParserState parserState) throws ReaderException {
	StringConstantConfig strConfig = unmarshallConfig(t2FlowParser,
			configBean, "xstream", StringConstantConfig.class);
	String value = strConfig.getValue();
	if (value == null)
		throw new ReaderException("String constant configuration has no value set");
	Configuration configuration = new Configuration();
	ObjectNode json = (ObjectNode) configuration.getJson();
	configuration.setType(CONSTANT.resolve("#Config"));
	json.put("string", value);
	
	Activity activity = parserState.getCurrentActivity();
	OutputActivityPort valuePort = new OutputActivityPort(activity, VALUE);
	valuePort.setDepth(0);
	valuePort.setGranularDepth(0);
	return configuration;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:20,代码来源:StringConstantActivityParser.java

示例12: parseProcessor

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
private void parseProcessor(ProcessorType pt) {
	Workflow currentWorkflow = parserState.get().getCurrentWorkflow();
	Processor p = new Processor(currentWorkflow, sanitiseName(pt.getName()));
	parserState.get().setCurrentProcessor(p);
	parseDispatchStack(pt);
	parseProcessorElement(pt.getProcessorElement());
	Activity activity = parserState.get().getCurrentActivity();
	if (activity != null)
		createDefaultProcessorBinding();
	parserState.get().setCurrentActivity(null);

	parseAlternates(pt);
	parseIterationStrategy(pt);
	parserState.get().setCurrentProcessor(null);
	parserState.get().addMapping(pt, p);
	// Cannot do anything about the ports
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:18,代码来源:ScuflParser.java

示例13: visit

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
@Override
public boolean visit(WorkflowBean node) {
	if (node instanceof Profile)
		profile((Profile) node);
	else if (node instanceof Activity)
		activity((Activity) node);
	else if (node instanceof InputActivityPort)
		inputActivityPort((InputActivityPort) node);
	else if (node instanceof OutputActivityPort)
		outputActivityPort((OutputActivityPort) node);
	else if (node instanceof ProcessorBinding)
		processorBinding((ProcessorBinding) node);
	else if (node instanceof ProcessorInputPortBinding)
		processorInputPortBinding((ProcessorInputPortBinding) node);
	else if (node instanceof ProcessorOutputPortBinding)
		processorOutputPortBinding((ProcessorOutputPortBinding) node);
	else if (node instanceof Configuration)
		configuration((Configuration) node);
	else
		throw new IllegalStateException("Unexpected node " + node);
	return true;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:23,代码来源:RDFXMLSerializer.java

示例14: parseActivity

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
protected void parseActivity(
		org.apache.taverna.scufl2.xml.Activity original) {
	Activity activity = new Activity();

	getParserState().push(activity);
	try {
		mapBean(original.getAbout(), activity);
		if (original.getName() != null)
			activity.setName(original.getName());
		activity.setParent(getParserState().getCurrent(
				org.apache.taverna.scufl2.api.profiles.Profile.class));
		if (original.getType() != null)
			activity.setType(resolve(original.getType().getResource()));
		for (org.apache.taverna.scufl2.xml.Activity.InputActivityPort inputActivityPort : original
				.getInputActivityPort())
			parseInputActivityPort(inputActivityPort.getInputActivityPort());
		for (org.apache.taverna.scufl2.xml.Activity.OutputActivityPort outputActivityPort : original
				.getOutputActivityPort())
			parseOutputActivityPort(outputActivityPort
					.getOutputActivityPort());
	} finally {
		getParserState().pop();
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:25,代码来源:ProfileParser.java

示例15: GisContextualView

import org.apache.taverna.scufl2.api.activity.Activity; //导入依赖的package包/类
public GisContextualView(Activity activity, EditManager editManager,
		FileManager fileManager, ActivityIconManager activityIconManager,
		ServiceDescriptionRegistry serviceDescriptionRegistry, ServiceRegistry serviceRegistry) {
	super(activity);
	this.editManager = editManager;
	this.fileManager = fileManager;
	this.activityIconManager = activityIconManager;
	this.serviceDescriptionRegistry = serviceDescriptionRegistry;
	this.serviceRegistry = serviceRegistry;
	initView();
}
 
开发者ID:apache,项目名称:incubator-taverna-plugin-gis,代码行数:12,代码来源:GisContextualView.java


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