public static String getAnnotation(Dataflow dataflow, Class<? extends AbstractTextualValueAssertion> annotation, String defaultValue) { return annotationTools.getAnnotationString(dataflow, annotation, defaultValue); }
@SuppressWarnings("unchecked") public Iterable<Class<? extends AnnotationBeanSPI>> getAnnotationBeanClasses() { // Mega casting mega trick! Iterable registry = getAnnotationBeanRegistry(); return (Iterable<Class<? extends AnnotationBeanSPI>>) registry; }
public static Processor getFirstProcessorWithActivityOutputPort( Dataflow dataflow, ActivityOutputPort targetPort) { Collection<Processor> processorsWithActivityPort = getProcessorsWithActivityOutputPort( dataflow, targetPort); for (Processor processor : processorsWithActivityPort) { return processor; } return null; }
private Processor createNestingProcessor(List<Edit<?>> editList) { Processor nestingProcessor = edits.createProcessor(uniqueProcessorName( nameField.getText(), currentDataflow)); if (includedProcessors.size() != 1 || !(includedProcessors.get(0) instanceof Processor)) return nestingProcessor; Processor includedProcessor = (Processor) includedProcessors.get(0); for (Class<?> c : at.getAnnotatingClasses(includedProcessor)) { AnnotationBeanSPI annotation = at.getAnnotation(includedProcessor, AbstractTextualValueAssertion.class); if ((annotation != null) && (annotation instanceof AbstractTextualValueAssertion)) editList.add(at.setAnnotationString(nestingProcessor, c, ((AbstractTextualValueAssertion) annotation).getText())); } return nestingProcessor; }
private EventForwardingOutputPort getSourcePort(Processor processor, Activity<?> activity, String portName, List<Edit<?>> editList) { OutputPort activityPort = net.sf.taverna.t2.workflowmodel.utils.Tools.getActivityOutputPort(activity, portName); //check if processor port exists EventForwardingOutputPort output = net.sf.taverna.t2.workflowmodel.utils.Tools.getProcessorOutputPort(processor, activity, activityPort); if (output == null) { //port doesn't exist so create a processor port and map it ProcessorOutputPort processorOutputPort = edits.createProcessorOutputPort(processor, activityPort.getName(), activityPort.getDepth(), activityPort.getGranularDepth()); editList.add(edits.getAddProcessorOutputPortEdit(processor, processorOutputPort)); editList.add(edits.getAddActivityOutputPortMappingEdit(activity, activityPort.getName(), activityPort.getName())); output = processorOutputPort; } return output; }
/** * * @see net.sf.taverna.t2.workflowmodel.utils.Tools#uniqueProcessorName(String, Dataflow) */ @Deprecated public static String uniqueProcessorName(String preferredName, Dataflow dataflow) { return net.sf.taverna.t2.workflowmodel.utils.Tools.uniqueProcessorName(preferredName, dataflow); }
/** * Find the first processor that contains an activity that has the given * activity input port. See #get * * @param dataflow * @param targetPort * @return */ public static Processor getFirstProcessorWithActivityInputPort( Dataflow dataflow, ActivityInputPort targetPort) { Collection<Processor> processorsWithActivityPort = getProcessorsWithActivityInputPort( dataflow, targetPort); for (Processor processor : processorsWithActivityPort) { return processor; } return null; }
public MyExperimentComponent(MyExperimentComponentRegistry componentRegistry, MyExperimentComponentFamily family, License license, String permissionsString, String uri) { super(uri); this.urlString = uri; this.componentRegistry = componentRegistry; this.componentFamily = family; this.permissionsString = permissionsString; this.license = license; annotationTools = new AnnotationTools(); }
public static String getUniqueMergeInputPortName(Merge merge, String name, int count) { String uniqueName = name + count; for (MergeInputPort mergeInputPort : merge.getInputPorts()) { if (mergeInputPort.getName().equals(uniqueName)) { return getUniqueMergeInputPortName(merge, name, ++count); } } return uniqueName; }
/** * Find processors that a given processor can connect to downstream. * <p> * This is calculated as all processors in the dataflow, except the * processor itself, and any processor <em>upstream</em>, following both * data links and conditional links. * * @see #possibleUpStreamProcessors(Dataflow, Processor) * @see #splitProcessors(Collection, Processor) * * @param dataflow * Dataflow from where to find processors * @param processor * Processor which is to be connected * @return A set of possible downstream processors */ public static Set<Processor> possibleDownStreamProcessors( Dataflow dataflow, Processor processor) { ProcessorSplit splitProcessors = splitProcessors(dataflow .getProcessors(), processor); Set<Processor> possibles = new HashSet<Processor>(splitProcessors .getUnconnected()); possibles.addAll(splitProcessors.getDownStream()); return possibles; }
/** * Find processors that a given processor can connect to upstream. * <p> * This is calculated as all processors in the dataflow, except the * processor itself, and any processor <em>downstream</em>, following both * data links and conditional links. * * @see #possibleDownStreamProcessors(Dataflow, Processor) * @see #splitProcessors(Collection, Processor) * * @param dataflow * Dataflow from where to find processors * @param processor * Processor which is to be connected * @return A set of possible downstream processors */ public static Set<Processor> possibleUpStreamProcessors(Dataflow dataflow, Processor firstProcessor) { ProcessorSplit splitProcessors = splitProcessors(dataflow .getProcessors(), firstProcessor); Set<Processor> possibles = new HashSet<Processor>(splitProcessors .getUnconnected()); possibles.addAll(splitProcessors.getUpStream()); return possibles; }
@SuppressWarnings("unchecked") public static String getAnnotationString(Annotated<?> annotated, Class annotationClass, String missingValue) { AbstractTextualValueAssertion a = (AbstractTextualValueAssertion) getAnnotation( annotated, annotationClass); if (a == null) { return missingValue; } return a.getText(); }
public ProcessorResultsComponent(Processor processor, Dataflow dataflow, String runId, ReferenceService referenceService) { super(new BorderLayout()); this.processor = processor; this.processorsPath = Tools.getNestedPathForProcessor( processor, dataflow); this.dataflow = dataflow; this.runId = runId; this.referenceService = referenceService; this.facade = null; initComponents(); }
@SuppressWarnings("unchecked") public <T> List<Class<? extends T>> getAnnotationBeanClasses( Class<T> superClass) { List<Class<? extends T>> results = new ArrayList<Class<? extends T>>(); for (Class<? extends AnnotationBeanSPI> annotationBeanClass : getAnnotationBeanClasses()) { if (superClass.isAssignableFrom(annotationBeanClass)) { results.add((Class<? extends T>) annotationBeanClass); } } return results; }
public String recordIdentifier() { net.sf.taverna.t2.workflowmodel.utils.Tools.addDataflowIdentification(this, internalIdentifier, new EditsImpl()); return internalIdentifier; }
public int compare(Datalink link1, Datalink link2) { // Text for link1 EventForwardingOutputPort source1 = link1.getSource(); String sourceName1 = findName(source1); EventHandlingInputPort sink1 = link1.getSink(); String sinkName1 = findName(sink1); String text1 = sourceName1 + " -> " + sinkName1; // Text for link2 EventForwardingOutputPort source2 = link2.getSource(); String sourceName2 = findName(source2); EventHandlingInputPort sink2 = link2.getSink(); String sinkName2 = findName(sink2); String text2 = sourceName2 + " -> " + sinkName2; return text1.compareToIgnoreCase(text2); }
public void actionPerformed(ActionEvent e) { try { editManager.doDataflowEdit(dataflow, Tools.getDisconnectDatalinkAndRemovePortsEdit(datalink)); dataflowSelectionModel.removeSelection(datalink); } catch (EditException e1) { logger.debug("Delete data link failed", e1); } }
public static String getAnnotation(Dataflow dataflow, Class<? extends AbstractTextualValueAssertion> annotation, String defaultValue) { return annotationTools.getAnnotationString(dataflow, annotation, defaultValue); }
public MyExperimentComponent(MyExperimentComponentRegistry componentRegistry, MyExperimentComponentFamily family, License license, String permissionsString, String uri) { super(uri); this.urlString = uri; this.componentRegistry = componentRegistry; this.componentFamily = family; this.permissionsString = permissionsString; this.license = license; annotationTools = new AnnotationTools(); }
public static String getUniqueMergeInputPortName(Merge merge, String name, int count) { String uniqueName = name + count; for (MergeInputPort mergeInputPort : merge.getInputPorts()) { if (mergeInputPort.getName().equals(uniqueName)) { return getUniqueMergeInputPortName(merge, name, ++count); } } return uniqueName; }