You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2010/11/30 22:45:44 UTC

svn commit: r1040788 - /uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java

Author: joern
Date: Tue Nov 30 21:45:44 2010
New Revision: 1040788

URL: http://svn.apache.org/viewvc?rev=1040788&view=rev
Log:
UIMA-1875 Fixed an issue when multiple tag drawing styles are active, line spacing was just reset to zero if one tag style was made invisible

Modified:
    uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java

Modified: uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java?rev=1040788&r1=1040787&r2=1040788&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java (original)
+++ uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java Tue Nov 30 21:45:44 2010
@@ -952,7 +952,7 @@ public final class AnnotationEditor exte
       if (strategy != null) {
         
         if (style.getStyle().equals(AnnotationStyle.Style.TAG)) {
-          getSourceViewer().getTextWidget().setLineSpacing(12);
+          getSourceViewer().getTextWidget().setLineSpacing(13);
         }
         
         mPainter.addDrawingStrategy(type.getName(), strategy);
@@ -969,7 +969,22 @@ public final class AnnotationEditor exte
       shownAnnotationTypes.remove(type);
       
       if (style.getStyle().equals(AnnotationStyle.Style.TAG)) {
-        getSourceViewer().getTextWidget().setLineSpacing(0);
+        // TODO: only if no more TAG styles are active
+        // How to figure that out ?!
+        boolean isKeepLineSpacing = false;
+        
+        for(Type shownType : shownAnnotationTypes) {
+          AnnotationStyle potentialTagStyle = 
+            getDocumentProvider().getAnnotationStyle(getEditorInput(), shownType);
+          
+          if (AnnotationStyle.Style.TAG.equals(potentialTagStyle.getStyle())) {
+            isKeepLineSpacing = true;
+            break;
+          }
+        }
+        
+        if (!isKeepLineSpacing)
+          getSourceViewer().getTextWidget().setLineSpacing(0);
       }
     }
   }