From f5b86c289309a84f9f6d9f16fb09581d5be5f078 Mon Sep 17 00:00:00 2001 From: MarkusKrug <markus.krug@uni-wuerzburg.de> Date: Fri, 23 Feb 2018 09:25:47 +0100 Subject: [PATCH] changed some casting issues with ArrayFS --- .../editor/ui/DSAnnotatingView.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/de.uniwue.mk.athen/bundles/de.uniwue.mkrug.kallimachos.annotation.editor/src/de/uniwue/mkrug/kallimachos/annotation/editor/ui/DSAnnotatingView.java b/de.uniwue.mk.athen/bundles/de.uniwue.mkrug.kallimachos.annotation.editor/src/de/uniwue/mkrug/kallimachos/annotation/editor/ui/DSAnnotatingView.java index 6645822e..264eb83a 100644 --- a/de.uniwue.mk.athen/bundles/de.uniwue.mkrug.kallimachos.annotation.editor/src/de/uniwue/mkrug/kallimachos/annotation/editor/ui/DSAnnotatingView.java +++ b/de.uniwue.mk.athen/bundles/de.uniwue.mkrug.kallimachos.annotation.editor/src/de/uniwue/mkrug/kallimachos/annotation/editor/ui/DSAnnotatingView.java @@ -14,7 +14,6 @@ import org.apache.uima.cas.CAS; import org.apache.uima.cas.Feature; import org.apache.uima.cas.FeatureStructure; import org.apache.uima.cas.Type; -import org.apache.uima.cas.impl.ArrayFSImpl; import org.apache.uima.cas.text.AnnotationFS; import org.apache.uima.cas.text.AnnotationIndex; import org.eclipse.e4.core.services.events.IEventBroker; @@ -52,7 +51,6 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; @@ -223,8 +221,8 @@ public class DSAnnotatingView extends AEditorSubordinateViewPart { for (AnnotationFS ds : editor.getCas().getAnnotationIndex(typ)) { - ArrayFSImpl speakerArray = (ArrayFSImpl) ds.getFeatureValue(speakerArrayFeature); - ArrayFSImpl spokenToArray = (ArrayFSImpl) ds.getFeatureValue(spokenToArrayFeature); + ArrayFS speakerArray = (ArrayFS) ds.getFeatureValue(speakerArrayFeature); + ArrayFS spokenToArray = (ArrayFS) ds.getFeatureValue(spokenToArrayFeature); if (speakerArray == null || speakerArray.size() == 0) { @@ -233,7 +231,7 @@ public class DSAnnotatingView extends AEditorSubordinateViewPart { AnnotationFS speaker = (AnnotationFS) ds.getFeatureValue(speakerFeature); if (speaker != null) { - ArrayFSImpl arrayNew = (ArrayFSImpl) editor.getCas().createArrayFS(1); + ArrayFS arrayNew = (ArrayFS) editor.getCas().createArrayFS(1); arrayNew.set(0, speaker); @@ -249,7 +247,7 @@ public class DSAnnotatingView extends AEditorSubordinateViewPart { AnnotationFS spokenTo = (AnnotationFS) ds.getFeatureValue(spokenToFeature); if (spokenTo != null) { - ArrayFSImpl arrayNew = (ArrayFSImpl) editor.getCas().createArrayFS(1); + ArrayFS arrayNew = (ArrayFS) editor.getCas().createArrayFS(1); arrayNew.set(0, spokenTo); @@ -1256,13 +1254,13 @@ public class DSAnnotatingView extends AEditorSubordinateViewPart { private void updateSpeakerArrays(Feature selF, AnnotationFS ds, AnnotationFS selected) { if (selF.getName().contains("SpokenTo")) { - ArrayFSImpl spokArray = (ArrayFSImpl) ds.getFeatureValue(spokenToArrayFeature); + ArrayFS spokArray = (ArrayFS) ds.getFeatureValue(spokenToArrayFeature); int size = 1; if (spokArray != null) size = spokArray.size() + 1; - ArrayFSImpl arrayNew = (ArrayFSImpl) editor.getCas().createArrayFS(size); + ArrayFS arrayNew = (ArrayFS) editor.getCas().createArrayFS(size); if (spokArray == null) { arrayNew.set(0, selected); @@ -1282,13 +1280,13 @@ public class DSAnnotatingView extends AEditorSubordinateViewPart { // speaker else { - ArrayFSImpl speakerArray = (ArrayFSImpl) ds.getFeatureValue(speakerArrayFeature); + ArrayFS speakerArray = (ArrayFS) ds.getFeatureValue(speakerArrayFeature); int size = 1; if (speakerArray != null) size = speakerArray.size() + 1; - ArrayFSImpl arrayNew = (ArrayFSImpl) editor.getCas().createArrayFS(size); + ArrayFS arrayNew = (ArrayFS) editor.getCas().createArrayFS(size); if (speakerArray == null) { arrayNew.set(0, selected); @@ -1819,7 +1817,7 @@ public class DSAnnotatingView extends AEditorSubordinateViewPart { buttonUnknownSpokenTo.setSelection(false); } // get the speaker of that anno - ArrayFSImpl speakerNEArray = (ArrayFSImpl) coveringDS.getFeatureValue(speakerArrayFeature); + ArrayFS speakerNEArray = (ArrayFS) coveringDS.getFeatureValue(speakerArrayFeature); if (speakerNEArray != null) { for (int i = 0; i < speakerNEArray.size(); i++) { @@ -1832,7 +1830,7 @@ public class DSAnnotatingView extends AEditorSubordinateViewPart { } // also add spokenToAnnotation if possible - ArrayFSImpl spokenToNEArray = (ArrayFSImpl) coveringDS.getFeatureValue(spokenToArrayFeature); + ArrayFS spokenToNEArray = (ArrayFS) coveringDS.getFeatureValue(spokenToArrayFeature); if (spokenToNEArray != null) { for (int i = 0; i < spokenToNEArray.size(); i++) { -- GitLab