Examples of EclipseAnnotationPeer


Examples of org.apache.uima.caseditor.editor.annotation.EclipseAnnotationPeer

    public int getLayer(Annotation annotation) {

      if (annotation instanceof EclipseAnnotationPeer) {

        EclipseAnnotationPeer eclipseAnnotation = (EclipseAnnotationPeer) annotation;

        AnnotationStyle style = getDocument().getProject().
            getDotCorpus().getAnnotation(eclipseAnnotation.getAnnotationFS().getType());

        return style.getLayer();
      }
      else {
        return 0;
View Full Code Here

Examples of org.apache.uima.caseditor.editor.annotation.EclipseAnnotationPeer

          }

          public Object next() {
            AnnotationFS annotation = (AnnotationFS) mAnnotations.next();

            EclipseAnnotationPeer peer = new EclipseAnnotationPeer(annotation.getType().getName(), false, "");
            peer.setAnnotation(annotation);
            return peer;
          }

          public void remove() {
          }};
      }

      public Position getPosition(Annotation annotation) {
        EclipseAnnotationPeer peer = (EclipseAnnotationPeer) annotation;
        AnnotationFS annotationFS = peer.getAnnotationFS();
        return new Position(annotationFS.getBegin(),
            annotationFS.getEnd() - annotationFS.getBegin());
      }

      public void removeAnnotation(Annotation annotation) {
View Full Code Here

Examples of org.apache.uima.caseditor.editor.annotation.EclipseAnnotationPeer

    // TODO: Build first a map, and then pass all annotations at once
    Map annotationsToAdd = new HashMap();
   
    while (mAnnotations.hasNext()) {
      AnnotationFS annotationFS = mAnnotations.next();
      annotationsToAdd.put(new EclipseAnnotationPeer(annotationFS), new Position(
              annotationFS.getBegin(), annotationFS.getEnd() - annotationFS.getBegin()));
    }
   
    ((IAnnotationModelExtension) annotationModel).replaceAnnotations(null, annotationsToAdd);
  }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.annotation.EclipseAnnotationPeer

      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      Map<Annotation, Position> addAnnotationMap = new HashMap<Annotation, Position>();
     
      for (AnnotationFS annotation : annotations) {
        addAnnotationMap.put(new EclipseAnnotationPeer(annotation), new Position(annotation.getBegin(),
                annotation.getEnd() - annotation.getBegin()));
      }
     
      annotationModel.replaceAnnotations(null, addAnnotationMap);
    }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.annotation.EclipseAnnotationPeer

      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      Annotation removeAnnotations[] = new Annotation[deletedAnnotations.size()];
      int removeAnnotationsIndex = 0;
      for (AnnotationFS annotation : deletedAnnotations) {
        removeAnnotations[removeAnnotationsIndex++] = new EclipseAnnotationPeer(annotation);
      }
     
      annotationModel.replaceAnnotations(removeAnnotations, null);
    }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.annotation.EclipseAnnotationPeer

    public void updatedAnnotation(Collection<AnnotationFS> annotations) {
     
      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      for (AnnotationFS annotation : annotations) {
        annotationModel.modifyAnnotationPosition(new EclipseAnnotationPeer(annotation),
                new Position(annotation.getBegin(), annotation.getEnd() - annotation.getBegin()));
      }
     
      selectionChanged(getSite().getPage().getActivePart(), mFeatureStructureSelectionProvider.getSelection());
    }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.annotation.EclipseAnnotationPeer

    public int getLayer(Annotation annotation) {

      if (annotation instanceof EclipseAnnotationPeer) {

        EclipseAnnotationPeer eclipseAnnotation = (EclipseAnnotationPeer) annotation;

        // ask document provider for this
        // getAnnotation must be added to cas document provider

        AnnotationStyle style = getAnnotationStyle(
            eclipseAnnotation.getAnnotationFS().getType());

        return style.getLayer();
      }
      else {
        return 0;
View Full Code Here

Examples of org.apache.uima.caseditor.editor.annotation.EclipseAnnotationPeer

      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      Map<Annotation, Position> addAnnotationMap = new HashMap<Annotation, Position>();
     
      for (AnnotationFS annotation : annotations) {
        addAnnotationMap.put(new EclipseAnnotationPeer(annotation), new Position(annotation.getBegin(),
                annotation.getEnd() - annotation.getBegin()));
      }
     
      annotationModel.replaceAnnotations(null, addAnnotationMap);
    }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.annotation.EclipseAnnotationPeer

      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      Annotation removeAnnotations[] = new Annotation[deletedAnnotations.size()];
      int removeAnnotationsIndex = 0;
      for (AnnotationFS annotation : deletedAnnotations) {
        removeAnnotations[removeAnnotationsIndex++] = new EclipseAnnotationPeer(annotation);
      }
     
      annotationModel.replaceAnnotations(removeAnnotations, null);
    }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.annotation.EclipseAnnotationPeer

    public int getLayer(Annotation annotation) {

      if (annotation instanceof EclipseAnnotationPeer) {

        EclipseAnnotationPeer eclipseAnnotation = (EclipseAnnotationPeer) annotation;

        // ask document provider for this
        // getAnnotation must be added to cas document provider

        AnnotationStyle style = getDocumentProvider().getAnnotationStyle(getEditorInput(),
            eclipseAnnotation.getAnnotationFS().getType());

        return style.getLayer();
      }
      else {
        return 0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.