svn commit: r1178869 - /uima/uimaj/trunk/uimaj-ep-cas-editor-ide/src/main/java/org/apache/uima/caseditor/ide/DefaultCasDocumentProvider.java

2011-10-04 Thread joern
Author: joern
Date: Tue Oct  4 17:29:29 2011
New Revision: 1178869

URL: http://svn.apache.org/viewvc?rev=1178869&view=rev
Log:
UIMA-2245 Updated to store settings in a Preferenc eStore instead of the Dot 
Corpus file. And added a mechanism to initialize the Preference Store from an 
existing Dot Corpus file.

Modified:

uima/uimaj/trunk/uimaj-ep-cas-editor-ide/src/main/java/org/apache/uima/caseditor/ide/DefaultCasDocumentProvider.java

Modified: 
uima/uimaj/trunk/uimaj-ep-cas-editor-ide/src/main/java/org/apache/uima/caseditor/ide/DefaultCasDocumentProvider.java
URL: 
http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-ep-cas-editor-ide/src/main/java/org/apache/uima/caseditor/ide/DefaultCasDocumentProvider.java?rev=1178869&r1=1178868&r2=1178869&view=diff
==
--- 
uima/uimaj/trunk/uimaj-ep-cas-editor-ide/src/main/java/org/apache/uima/caseditor/ide/DefaultCasDocumentProvider.java
 (original)
+++ 
uima/uimaj/trunk/uimaj-ep-cas-editor-ide/src/main/java/org/apache/uima/caseditor/ide/DefaultCasDocumentProvider.java
 Tue Oct  4 17:29:29 2011
@@ -19,13 +19,17 @@
 
 package org.apache.uima.caseditor.ide;
 
+import java.awt.Color;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.uima.cas.CAS;
 import org.apache.uima.cas.Type;
@@ -35,6 +39,7 @@ import org.apache.uima.caseditor.core.mo
 import org.apache.uima.caseditor.core.model.dotcorpus.DotCorpus;
 import org.apache.uima.caseditor.core.model.dotcorpus.DotCorpusSerializer;
 import org.apache.uima.caseditor.editor.AnnotationStyle;
+import org.apache.uima.caseditor.editor.AnnotationStyle.Style;
 import org.apache.uima.caseditor.editor.CasDocumentProvider;
 import org.apache.uima.caseditor.editor.DocumentFormat;
 import org.apache.uima.caseditor.editor.DocumentUimaImpl;
@@ -53,6 +58,8 @@ import org.eclipse.core.runtime.IProgres
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceStore;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
@@ -125,13 +132,12 @@ public class DefaultCasDocumentProvider 
   private Map sharedEditorStatus = new 
HashMap();
   
   /**
-   * This map resolves a type system to a style.
-   * 
-   * TODO: Right now styles are not closed, how are they
-   * deleted when they are not longer needed ?!
+   * This map resolves a type system to a style. It is used to cache type 
system
+   * preference instance while the editor is open.
*/
-  private Map styles = new HashMap();
+  private Map typeSystemPreferences = new 
HashMap();
   
+  // UIMA-2245 Remove this method together with the migration code below one 
day
   private String getStyleFileForTypeSystem(String typeSystemFile) {
 int lastSlashIndex = typeSystemFile.lastIndexOf("/");
 
@@ -141,6 +147,85 @@ public class DefaultCasDocumentProvider 
 return styleId;
   }
   
+  private String getPreferenceFileForTypeSystem(String typeSystemFile) {
+int lastSlashIndex = typeSystemFile.lastIndexOf("/");
+
+String styleId = typeSystemFile.substring(0, lastSlashIndex + 1);
+styleId = styleId + ".pref-" + typeSystemFile.substring(lastSlashIndex + 
1);
+
+return styleId;
+  }
+  
+  private void putAnnotatationStyleToStore(IPreferenceStore store, 
AnnotationStyle style) {
+
+Color color = new Color(style.getColor().getRed(), 
style.getColor().getGreen(),
+style.getColor().getBlue());
+
+// TODO: Define appendixes in constants ...
+store.putValue(style.getAnnotation() + ".style.color", 
Integer.toString(color.getRGB()));
+store.putValue(style.getAnnotation() + ".style.strategy", 
style.getStyle().toString());
+store.putValue(style.getAnnotation() + ".style.layer", 
Integer.toString(style.getLayer()));
+
+if (style.getConfiguration() != null)
+  store.putValue(style.getAnnotation() + ".style.config", 
style.getConfiguration());
+  }
+  
+  // method to get annotation style from pref store
+  private AnnotationStyle getAnnotationStyleFromStore(IPreferenceStore store, 
String typeName) {
+
+AnnotationStyle.Style style = AnnotationStyle.Style.UNDERLINE;
+
+String styleString = store.getString(typeName + ".style.strategy");
+if (styleString.length() != 0) {
+  // TODO: Might throw exception, catch it and use default!
+  try {
+style = AnnotationStyle.Style.valueOf(styleString);
+  }
+  catch (IllegalArgumentException e) {
+  }
+}
+
+Color color = Color.RED;
+
+String colorS

svn commit: r1178880 - /uima/addons/trunk/Tagger/pom.xml

2011-10-04 Thread schor
Author: schor
Date: Tue Oct  4 17:53:34 2011
New Revision: 1178880

URL: http://svn.apache.org/viewvc?rev=1178880&view=rev
Log:
[UIMA-2134] depend on already released to maven central version of the 
whitespace tagger.

Modified:
uima/addons/trunk/Tagger/pom.xml

Modified: uima/addons/trunk/Tagger/pom.xml
URL: 
http://svn.apache.org/viewvc/uima/addons/trunk/Tagger/pom.xml?rev=1178880&r1=1178879&r2=1178880&view=diff
==
--- uima/addons/trunk/Tagger/pom.xml (original)
+++ uima/addons/trunk/Tagger/pom.xml Tue Oct  4 17:53:34 2011
@@ -83,7 +83,7 @@

org.apache.uima
WhitespaceTokenizer
-   2.3.2-SNAPSHOT
+   2.3.1


   




svn commit: r1178888 - in /uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain: element/ElementTreeLabelProvider.java tree/ExplainTree.java

2011-10-04 Thread joern
Author: joern
Date: Tue Oct  4 18:09:31 2011
New Revision: 117

URL: http://svn.apache.org/viewvc?rev=117&view=rev
Log:
UIMA-2234 Dynamic anchoring of rule elements. Patch from Peter Klügl applied.

Modified:

uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/element/ElementTreeLabelProvider.java

uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/tree/ExplainTree.java

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/element/ElementTreeLabelProvider.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/element/ElementTreeLabelProvider.java?rev=117&r1=1178887&r2=117&view=diff
==
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/element/ElementTreeLabelProvider.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/element/ElementTreeLabelProvider.java
 Tue Oct  4 18:09:31 2011
@@ -71,15 +71,18 @@ public class ElementTreeLabelProvider ex
 Type type = ts.getType(ExplainConstants.RULE_ELEMENT_MATCHES_TYPE);
 FeatureStructure fs = debugNode.getFeatureStructure();
 Feature f = type.getFeatureByBaseName(ExplainTree.ELEMENT);
-if (f != null) {
+Feature fanchor = type.getFeatureByBaseName(ExplainTree.RULE_ANCHOR);
+if (f != null && fanchor != null) {
   String v = fs.getStringValue(f);
-  return v;
+  String ruleAnchor = fs.getBooleanValue(fanchor) ? "'" : "";
+  return ruleAnchor + v;
 }
   } else if (element instanceof RuleElementMatchNode) {
 FeatureStructure fs = debugNode.getFeatureStructure();
 if (fs instanceof AnnotationFS) {
   String s = ((AnnotationFS) fs).getCoveredText();
   s = s.replaceAll("[\\n\\r]", "");
+
   return s;
 }
   } else if (element instanceof ConditionNode) {

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/tree/ExplainTree.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/tree/ExplainTree.java?rev=117&r1=1178887&r2=117&view=diff
==
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/tree/ExplainTree.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/tree/ExplainTree.java
 Tue Oct  4 18:09:31 2011
@@ -58,6 +58,8 @@ public class ExplainTree {
 
   public static final String ELEMENT = "element";
 
+  public static final String RULE_ANCHOR = "ruleAnchor";
+
   public static final String TIME = "time";
 
   private IExplainTreeNode root;




svn commit: r1178889 - in /uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards: BasicEngine.xml BasicTypeSystem.xml InternalTypeSystem.xml

2011-10-04 Thread joern
Author: joern
Date: Tue Oct  4 18:09:48 2011
New Revision: 1178889

URL: http://svn.apache.org/viewvc?rev=1178889&view=rev
Log:
UIMA-2234 Dynamic anchoring of rule elements. Patch from Peter Klügl applied.

Modified:

uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/BasicEngine.xml

uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/BasicTypeSystem.xml

uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/InternalTypeSystem.xml

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/BasicEngine.xml
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/BasicEngine.xml?rev=1178889&r1=117&r2=1178889&view=diff
==
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/BasicEngine.xml
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/BasicEngine.xml
 Tue Oct  4 18:09:48 2011
@@ -154,6 +154,13 @@
 false
 false
   
+  
+dynamicAnchoring
+Activates dynamic achoring (possible speed 
up).
+Boolean
+false
+false
+  
 
 
   

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/BasicTypeSystem.xml
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/BasicTypeSystem.xml?rev=1178889&r1=117&r2=1178889&view=diff
==
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/BasicTypeSystem.xml
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/BasicTypeSystem.xml
 Tue Oct  4 18:09:48 2011
@@ -17,6 +17,7 @@
   specific language governing permissions and limitations
   under the License.
 -->
+
 http://uima.apache.org/resourceSpecifier";>
   BasicTypeSystem
   

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/InternalTypeSystem.xml
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/InternalTypeSystem.xml?rev=1178889&r1=117&r2=1178889&view=diff
==
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/InternalTypeSystem.xml
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/wizards/InternalTypeSystem.xml
 Tue Oct  4 18:09:48 2011
@@ -17,6 +17,7 @@
   specific language governing permissions and limitations
   under the License.
 -->
+
 http://uima.apache.org/resourceSpecifier";>
   InternalTypeSystem
   
@@ -140,6 +141,13 @@
   uima.cas.FSArray
   
org.apache.uima.textmarker.type.DebugEvaluatedCondition
 
+
+  elements
+  
+  uima.cas.FSArray
+  
org.apache.uima.textmarker.type.DebugRuleElementMatches
+  false
+
   
 
 
@@ -158,6 +166,11 @@
   
   uima.cas.String
 
+
+  ruleAnchor
+  
+  uima.cas.Boolean
+
   
 
 




svn commit: r1178890 [2/2] - in /uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine: META-INF/ desc/ src/main/java/org/apache/uima/textmarker/ src/main/java/org/apache/uima/textmarker/engine/ sr

2011-10-04 Thread joern
Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/type/TextMarkerBasic.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/type/TextMarkerBasic.java?rev=1178890&r1=1178889&r2=1178890&view=diff
==
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/type/TextMarkerBasic.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/type/TextMarkerBasic.java
 Tue Oct  4 18:12:06 2011
@@ -13,12 +13,10 @@ import org.apache.uima.jcas.JCasRegistry
 import org.apache.uima.jcas.cas.TOP_Type;
 import org.apache.uima.jcas.tcas.Annotation;
 
-/**
- * Updated by JCasGen Tue Sep 20 15:37:41 CEST 2011 XML source:
- * 
D:/work/workspace-uima3/uimaj-ep-textmarker-engine/desc/InternalTypeSystem.xml
- * 
- * @generated
- */
+/** 
+ * Updated by JCasGen Mon Sep 26 19:07:28 CEST 2011
+ * XML source: 
D:/work/workspace-uima3/uimaj-ep-textmarker-engine/desc/InternalTypeSystem.xml
+ * @generated */
 public class TextMarkerBasic extends Annotation {
 
   private Set partOf = new HashSet(20);
@@ -151,18 +149,15 @@ public class TextMarkerBasic extends Ann
 
   /** @generated */
   @Override
-  public int getTypeIndexID() {
-return typeIndexID;
-  }
-
+  public int getTypeIndexID() {return typeIndexID;}
+ 
   /**
* Never called. Disable default constructor
* 
* @generated
*/
-  protected TextMarkerBasic() {
-  }
-
+  protected TextMarkerBasic() {}
+
   /**
* Internal - constructor used by generator
* 
@@ -172,12 +167,12 @@ public class TextMarkerBasic extends Ann
 super(addr, type);
 readObject();
   }
-
+  
   /** @generated */
   public TextMarkerBasic(JCas jcas) {
 super(jcas);
-readObject();
-  }
+readObject();   
+  } 
 
   /** @generated */
   public TextMarkerBasic(JCas jcas, int begin, int end) {
@@ -185,13 +180,10 @@ public class TextMarkerBasic extends Ann
 setBegin(begin);
 setEnd(end);
 readObject();
-  }
+  }   
 
-  /**
-   *  Write your own initialization here 
-   * 
-   * @generated modifiable
-   */
+  /**  Write your own initialization here 
+  @generated modifiable */
   private void readObject() {
   }
 
@@ -204,29 +196,20 @@ public class TextMarkerBasic extends Ann
* @generated
*/
   public String getReplacement() {
-if (TextMarkerBasic_Type.featOkTst
-&& ((TextMarkerBasic_Type) jcasType).casFeat_replacement == null)
-  jcasType.jcas.throwFeatMissing("replacement",
-  "org.apache.uima.textmarker.type.TextMarkerBasic");
-return jcasType.ll_cas.ll_getStringValue(addr,
-((TextMarkerBasic_Type) jcasType).casFeatCode_replacement);
-  }
-
+if (TextMarkerBasic_Type.featOkTst && 
((TextMarkerBasic_Type)jcasType).casFeat_replacement == null)
+  jcasType.jcas.throwFeatMissing("replacement", 
"org.apache.uima.textmarker.type.TextMarkerBasic");
+return jcasType.ll_cas.ll_getStringValue(addr, 
((TextMarkerBasic_Type)jcasType).casFeatCode_replacement);}
+
   /**
* setter for Replacement - sets
* 
* @generated
*/
   public void setReplacement(String v) {
-if (TextMarkerBasic_Type.featOkTst
-&& ((TextMarkerBasic_Type) jcasType).casFeat_replacement == null)
-  jcasType.jcas.throwFeatMissing("replacement",
-  "org.apache.uima.textmarker.type.TextMarkerBasic");
-jcasType.ll_cas.ll_setStringValue(addr,
-((TextMarkerBasic_Type) jcasType).casFeatCode_replacement, v);
-  }
-
-  public Map> getEndMap() {
+if (TextMarkerBasic_Type.featOkTst && 
((TextMarkerBasic_Type)jcasType).casFeat_replacement == null)
+  jcasType.jcas.throwFeatMissing("replacement", 
"org.apache.uima.textmarker.type.TextMarkerBasic");
+jcasType.ll_cas.ll_setStringValue(addr, 
((TextMarkerBasic_Type)jcasType).casFeatCode_replacement, v);}
+  public Map> getEndMap() {
 return endMap;
   }
 

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/type/TextMarkerBasic_Type.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/type/TextMarkerBasic_Type.java?rev=1178890&r1=1178889&r2=1178890&view=diff
==
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/type/TextMarkerBasic_Type.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/type/TextMarkerBasic_Type.java
 Tue Oct  4 18:12:06 2011
@@ -14,7 +14,7 @@ import org.apache.uima.jcas.JCasRegistry
 import org.apache.uima.jcas.tcas.Annotation_Type;
 
 /**