Commit f5b86c28 authored by Markus Krug's avatar Markus Krug

changed some casting issues with ArrayFS

parent 720d7be5
Pipeline #7875 passed with stages
in 18 minutes and 19 seconds
......@@ -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++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment