本文整理汇总了Java中org.apache.taverna.workbench.edits.EditException类的典型用法代码示例。如果您正苦于以下问题:Java EditException类的具体用法?Java EditException怎么用?Java EditException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EditException类属于org.apache.taverna.workbench.edits包,在下文中一共展示了EditException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connectNewProcessor
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
void connectNewProcessor(Workflow d, Processor newProcessor)
throws EditException {
List<Edit<?>> editsToDo = new ArrayList<>();
for (InputProcessorPort pip : newProcessor.getInputPorts()) {
InputWorkflowPort dip = new InputWorkflowPort(d, pip.getName());
// FIXME How to set depth?
editsToDo.add(new AddWorkflowInputPortEdit(d, dip));
editsToDo.add(new AddDataLinkEdit(d, new DataLink(d, dip, pip)));
}
for (OutputProcessorPort pop : newProcessor.getOutputPorts()) {
OutputWorkflowPort dop = new OutputWorkflowPort(d, pop.getName());
// TODO How to indicate depth?
editsToDo.add(new AddWorkflowOutputPortEdit(d, dop));
editsToDo.add(new AddDataLinkEdit(d, new DataLink(d, pop, dop)));
}
em.doDataflowEdit(d.getParent(), new CompoundEdit(editsToDo));
}
示例2: pasteProcessor
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
public Processor pasteProcessor(CopiedProcessor copy, Workflow d)
throws
ClassNotFoundException, InstantiationException,
IllegalAccessException, EditException {
Processor result = ProcessorXMLDeserializer.getInstance()
.deserializeProcessor(copy.processor, copy.requiredSubworkflows);
if (result == null)
return null;
String newName = Tools.uniqueProcessorName(result.getName(), d);
List<Edit<?>> editList = new ArrayList<>();
if (!newName.equals(result.getName()))
editList.add(new RenameEdit<>(result, newName));
editList.add(new AddProcessorEdit(d, result));
em.doDataflowEdit(d.getParent(), new CompoundEdit(editList));
return result;
}
示例3: createAction
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
@SuppressWarnings("serial")
@Override
protected Action createAction() {
undoAction = new AbstractUndoAction("Redo", editManager) {
@Override
protected boolean isActive(WorkflowBundle workflowBundle) {
return editManager.canRedoDataflowEdit(workflowBundle);
}
@Override
protected void performUndoOrRedo(WorkflowBundle workflowBundle) {
try {
editManager.redoDataflowEdit(workflowBundle);
} catch (EditException | RuntimeException e) {
logger.warn("Could not redo for " + workflowBundle, e);
showMessageDialog(null, "Could not redo for workflow "
+ workflowBundle + ":\n" + e, "Could not redo",
ERROR_MESSAGE);
}
}
};
undoAction.setSelectionManager(selectionManager);
return undoAction;
}
示例4: actionPerformed
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
Set<String> usedOutputPorts = new HashSet<>();
for (OutputWorkflowPort usedOutputPort : dataflow.getOutputPorts())
if (!usedOutputPort.getName().equals(port.getName()))
usedOutputPorts.add(usedOutputPort.getName());
DataflowOutputPortPanel inputPanel = new DataflowOutputPortPanel();
ValidatingUserInputDialog vuid = new ValidatingUserInputDialog(
"Edit Workflow Output Port", inputPanel);
vuid.addTextComponentValidation(inputPanel.getPortNameField(),
"Set the workflow output port name.", usedOutputPorts,
"Duplicate workflow output port name.",
"[\\p{L}\\p{Digit}_.]+", "Invalid workflow output port name.");
vuid.setSize(new Dimension(400, 200));
inputPanel.setPortName(port.getName());
try {
if (vuid.show(component))
changeOutputPort(inputPanel);
} catch (EditException ex) {
logger.debug("Rename workflow output port failed", ex);
}
}
示例5: actionPerformed
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
Set<String> usedProcessors = new HashSet<>();
for (Processor usedProcessor : dataflow.getProcessors())
if (!usedProcessor.getName().equals(processor.getName()))
usedProcessors.add(usedProcessor.getName());
ProcessorPanel inputPanel = new ProcessorPanel();
ValidatingUserInputDialog vuid = new ValidatingUserInputDialog(
"Rename service", inputPanel);
vuid.addTextComponentValidation(inputPanel.getProcessorNameField(),
"Set the service name.", usedProcessors, "Duplicate service.",
"[\\p{L}\\p{Digit}_.]+", "Invalid service name.");
vuid.setSize(new Dimension(400, 200));
inputPanel.setProcessorName(processor.getName());
try {
if (vuid.show(component))
changeProcessorName(inputPanel);
} catch (EditException e1) {
logger.debug("Rename service (processor) failed", e1);
}
}
示例6: actionPerformed
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
try {
dataflowSelectionModel.removeSelection(port);
List<DataLink> datalinks = scufl2Tools.datalinksFrom(port);
if (datalinks.isEmpty())
editManager.doDataflowEdit(dataflow.getParent(),
new RemoveWorkflowInputPortEdit(dataflow, port));
else {
List<Edit<?>> editList = new ArrayList<>();
for (DataLink datalink : datalinks)
editList.add(new RemoveDataLinkEdit(dataflow, datalink));
editList.add(new RemoveWorkflowInputPortEdit(dataflow, port));
editManager.doDataflowEdit(dataflow.getParent(),
new CompoundEdit(editList));
}
} catch (EditException e1) {
logger.debug("Delete workflow input port failed", e1);
}
}
示例7: actionPerformed
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
try {
dataflowSelectionModel.removeSelection(port);
List<DataLink> datalinks = scufl2Tools.datalinksTo(port);
if (datalinks.isEmpty())
editManager.doDataflowEdit(dataflow.getParent(),
new RemoveWorkflowOutputPortEdit(dataflow, port));
else {
List<Edit<?>> editList = new ArrayList<>();
for (DataLink datalink : datalinks)
editList.add(new RemoveDataLinkEdit(dataflow, datalink));
editList.add(new RemoveWorkflowOutputPortEdit(dataflow, port));
editManager.doDataflowEdit(dataflow.getParent(),
new CompoundEdit(editList));
}
} catch (EditException ex) {
logger.debug("Delete workflow output port failed", ex);
}
}
示例8: configureActivity
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
public void configureActivity(WorkflowBundle workflowBundle, Activity activity,
ObjectNode json, List<ActivityPortConfiguration> inputPorts,
List<ActivityPortConfiguration> outputPorts) {
try {
List<Edit<?>> editList = new ArrayList<Edit<?>>();
Profile profile = activity.getParent();
List<ProcessorBinding> processorBindings = scufl2Tools
.processorBindingsToActivity(activity);
Configuration configuration = scufl2Tools.configurationFor(activity, profile);
editList.add(new ChangeJsonEdit(configuration, json));
configurePorts(activity, editList, processorBindings, inputPorts, PortType.INPUT);
configurePorts(activity, editList, processorBindings, outputPorts, PortType.OUTPUT);
editManager.doDataflowEdit(workflowBundle, new CompoundEdit(editList));
} catch (IllegalStateException | EditException e) {
logger.error(e);
}
}
示例9: createNestedWorkflow
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
private void createNestedWorkflow() {
final List<Edit<?>> currentWorkflowEditList = new ArrayList<>();
Map<Object, Object> oldNewMapping = new HashMap<>();
Map<DataLink, String> linkProcessorPortMapping = new HashMap<>();
Map<SenderPort, OutputWorkflowPort> outputPortMap = new HashMap<>();
Map<ReceiverPort, InputWorkflowPort> inputPortMap = new HashMap<>();
Profile profile;//FIXME
Processor nestingProcessor = createNestingProcessor(currentWorkflowEditList);
Workflow nestedDataflow = createNestedDataflow();
transferProcessors(currentWorkflowEditList, oldNewMapping,
nestedDataflow);
transferDatalinks(oldNewMapping, linkProcessorPortMapping,
outputPortMap, inputPortMap, nestedDataflow);
transferConditions(currentWorkflowEditList, oldNewMapping,
nestingProcessor);
addDataflowToNestingProcessor(nestingProcessor, nestedDataflow, profile);
currentWorkflowEditList.add(new AddChildEdit<>(currentDataflow,
nestingProcessor));
createDatalinkEdits(currentWorkflowEditList, oldNewMapping,
linkProcessorPortMapping, nestingProcessor);
try {
GraphController gc = graphView.getGraphController(currentDataflow);
gc.setExpandNestedDataflow(nestingProcessor.getActivity(profile), true);
em.doDataflowEdit(currentDataflow.getParent(), new CompoundEdit(
currentWorkflowEditList));
gc.redraw();
} catch (EditException e1) {
logger.error("failed to manufacture nested workflow", e1);
}
}
示例10: addDataflowToNestingProcessor
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
private void addDataflowToNestingProcessor(Processor nestingProcessor,
Workflow nestedDataflow, Profile profile) {
Activity da = new Activity();
da.setParent(profile);
da.createConfiguration(NESTED_WORKFLOW).getJsonAsObjectNode()
.put("nestedWorkflow", nestedDataflow.getName());
try {
new AddActivityEdit(nestingProcessor, da).doEdit();
new SetIterationStrategyStackEdit(nestingProcessor, null/*FIXME*/).doEdit();
for (InputActivityPort aip : da.getInputPorts()) {
InputProcessorPort pip = new InputProcessorPort();
pip.setName(aip.getName());
pip.setDepth(aip.getDepth());
new AddProcessorInputPortEdit(nestingProcessor, pip).doEdit();
new AddActivityInputPortMappingEdit(da, pip, aip).doEdit();
}
for (OutputActivityPort aop : da.getOutputPorts()) {
OutputProcessorPort pop = new OutputProcessorPort();
pop.setName(aop.getName());
pop.setDepth(aop.getDepth());
pop.setGranularDepth(aop.getGranularDepth());
new AddProcessorOutputPortEdit(nestingProcessor, pop).doEdit();
new AddActivityOutputPortMappingEdit(da, pop, aop).doEdit();
}
} catch (EditException e1) {
logger.error("failed to add ports to processor", e1);
}
}
示例11: createNestedDataflow
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
private Workflow createNestedDataflow() {
Workflow nestedDataflow = new Workflow(uniqueName(nameField.getText(),
currentDataflow.getParent().getWorkflows()));
// Set the title of the nested workflow to the name suggested by the user
try {
new AnnotationTools().setAnnotationString(nestedDataflow,
DescriptiveTitle.class, nameField.getText()).doEdit();
} catch (EditException ex) {
logger.error("failed to put annotation on nested dataflow", ex);
}
return nestedDataflow;
}
示例12: moveComponentActivityIntoPlace
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
void moveComponentActivityIntoPlace(Activity toReplace, Processor contextProcessor,
Activity replacingActivity) throws EditException {
List<Edit<?>> editsToDo = new ArrayList<>();
for (InputProcessorPort pip : contextProcessor.getInputPorts())
editsToDo.add(new AddActivityInputPortMappingEdit(toReplace, pip, null/*FIXME*/));
for (OutputProcessorPort pop : contextProcessor.getOutputPorts())
editsToDo.add(new AddActivityOutputPortMappingEdit(toReplace, pop, null/*FIXME*/));
editsToDo.add(new RemoveActivityEdit(contextProcessor, toReplace));
editsToDo.add(new AddActivityEdit(contextProcessor, replacingActivity));
em.doDataflowEdit(contextProcessor.getParent().getParent(),
new CompoundEdit(editsToDo));
}
示例13: createInitialComponent
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
public Version.ID createInitialComponent(WorkflowBundle d, Version.ID ident)
throws ComponentException {
try {
fm.saveDataflow(d, ft, ident, false);
em.doDataflowEdit(d, new RenameEdit<>(d, d.getName()));
} catch (SaveException | IllegalStateException | EditException e) {
throw new ComponentException(e);
}
return ident;
}
示例14: doDataflowEdit
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
@Override
public void doDataflowEdit(WorkflowBundle dataflow, Edit<?> edit)
throws EditException {
// We do the edit before we notify the observers
DataflowEdits edits = getEditsForDataflow(dataflow);
synchronized (edits) {
// Make sure the edits are in the order they were performed
edit.doEdit();
edits.addEdit(edit);
}
multiCaster.notify(new DataflowEditEvent(dataflow, edit));
}
示例15: redoDataflowEdit
import org.apache.taverna.workbench.edits.EditException; //导入依赖的package包/类
@Override
public void redoDataflowEdit(WorkflowBundle dataflow) throws EditException {
DataflowEdits edits = getEditsForDataflow(dataflow);
Edit<?> edit;
synchronized (edits) {
if (!edits.canRedo())
return;
edit = edits.getLastUndo();
edit.doEdit();
edits.addRedo(edit);
}
multiCaster.notify(new DataFlowRedoEvent(dataflow, edit));
}