Commit ae218286 authored by Markus Krug's avatar Markus Krug
Browse files

removed typeOverride from redewiedergabe view

parent 7afb5af4
Pipeline #4396 passed with stage
in 2 minutes and 10 seconds
......@@ -95,9 +95,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
@Inject
EModelService modelService;
private Type typOverride;
private String typeOverride;
//ambigDialogRType
Shell ambigDialogRTypeShell = new Shell();
......@@ -365,9 +363,8 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
frameTypeString = ApplicationUtil.getFromPreferences("Enter Frame-Type", "null");
stwrTypeString = ApplicationUtil.getFromPreferences("Enter Stwr-Type", "null");
typeOverride = ApplicationUtil.getFromPreferences("Enter Override Type", "null");
if (frameTypeString.equals("null") || stwrTypeString.equals("null") || typeOverride.equals("null")) {
if (frameTypeString.equals("null") || stwrTypeString.equals("null") ) {
return false;
}
......@@ -402,18 +399,14 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
this.borderFeat = this.stwrType.getFeatureByBaseName("Border");
this.metaphFeat = this.stwrType.getFeatureByBaseName("Metaph");
// Override Type
this.typOverride = (editor.getCas().getTypeSystem().getType(typeOverride));
// Visibility
editor.changeVisibility(stwrType, true);
editor.changeVisibility(frameType, true);
editor.changeVisibility(typOverride, true);
// layer
editor.changeLayer(stwrType, 2);
editor.changeLayer(frameType, 3);
editor.changeLayer(typOverride, 1);
// gainsboro
StyleRange rangeOv = new StyleRange();
......@@ -1894,14 +1887,6 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
}
}
AnnotationIndex<AnnotationFS> annotationIndex = editor.getCas()
.getAnnotationIndex(editor.getCas().getTypeSystem().getType(typeOverride));
FSIterator<AnnotationFS> iterator = annotationIndex.iterator();
ArrayList<AnnotationFS> overrides = new ArrayList<AnnotationFS>();
while (iterator.hasNext()) {
overrides.add((AnnotationFS) iterator.next());
}
// set input of Tableviewer
stwrViewer.setInput(stwrList);
......@@ -2039,18 +2024,6 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
// delete all overrides in that stage
AnnotationIndex<AnnotationFS> annotationIndex = editor.getCas().getAnnotationIndex(typOverride);
ArrayList<AnnotationFS> toDelete = new ArrayList<AnnotationFS>();
for (AnnotationFS anno : annotationIndex) {
if (anno.getBegin() == firstElement.getBegin() && anno.getEnd() == firstElement.getEnd()) {
toDelete.add(anno);
// editor.removeAnnotation(anno);
}
}
for (AnnotationFS a : toDelete) {
editor.removeAnnotation(a);
}
editor.removeAnnotation(firstElement);
......@@ -2062,13 +2035,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
// delete all overrides in that stage
if (reload == true) {
AnnotationIndex<AnnotationFS> annotationIndex = editor.getCas().getAnnotationIndex(typOverride);
ArrayList<AnnotationFS> toDelete = new ArrayList<AnnotationFS>();
for (AnnotationFS anno : annotationIndex) {
if (anno.getBegin() == firstElement.getBegin() && anno.getEnd() == firstElement.getEnd()) {
toDelete.add(anno);
}
}
for (AnnotationFS a : toDelete) {
// do not reload if we have to delete something since we add an
......@@ -2078,10 +2045,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
}
if (reload) {
AnnotationFS fss = editor.getCas().createAnnotation(typOverride, firstElement.getBegin(),
firstElement.getEnd());
this.editor.addAnnotation(fss);
editor.updateWidget();
}
}
......@@ -2091,17 +2055,6 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
}
private void addAnnotation(AnnotationFS anno) {
// =====END INTERACTIVE RULES=========
// add the override Annotation
CAS cas = this.editor.getCas();
this.editor.getCas().addFsToIndexes(anno);
AnnotationFS fs = cas.createAnnotation(typOverride, anno.getBegin(), anno.getEnd());
this.editor.addAnnotation(fs);
}
public List<AnnotationFS> getStwrList() {
return stwrList;
......
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