Commit d53b822e authored by Markus Krug's avatar Markus Krug

Merge branch 'redeWiedergabe_dev' into 'master'

automatically jump to next annotation after accepting/deleting one

See merge request !84
parents 8aa1435b 8fa8939f
Pipeline #12572 passed with stages
in 19 minutes and 9 seconds
......@@ -46,8 +46,10 @@ import de.ids.tt.athen.rwview.ui.RwDrawingStrategy;
import de.ids.tt.athen.rwview.ui.RwFrameDrawingStrategy;
import de.ids.tt.athen.rwview.ui.RwMetadataDialog;
import de.ids.tt.athen.rwview.ui.RwSpeakerDrawingStrategy;
import de.ids.tt.athen.rwview.ui.RwStwrTableComposite;
import de.ids.tt.athen.rwview.ui.RwExpDrawingStrategy;
import de.ids.tt.athen.rwview.ui.RwViewComposite;
import de.ids.tt.athen.rwview.ui.helper.StwrTableViewerDropListener;
import de.uniwue.kalimachos.coref.paintingStrategies.BackgroundGCDrawingStrategy;
import de.uniwue.mk.athen.textwidget.struct.AnnoStyle;
import de.uniwue.mk.kall.athen.part.editor.annotations.ATHENEditorDrawingInfo;
......@@ -1725,6 +1727,19 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
}
public void deleteAnnotations(List<AnnotationFS> annos) {
AnnotationFS anno = annos.get(0);
int i = 0;
for (AnnotationFS stwrAnno : stwrList){
if (stwrAnno.equals(anno) && i+1 < stwrList.size()){
editor.highlightRange(stwrList.get(i+1).getBegin(), stwrList.get(i+1).getEnd() - stwrList.get(i+1).getBegin(), true);
// highlight in table
IStructuredSelection sel = new StructuredSelection(stwrList.get(i+1));
rwViewComposite.refreshSelection(sel);
}
i++;
}
deleteAnnotations(annos.toArray(new AnnotationFS[0]));
}
......@@ -2094,6 +2109,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
}
}
public void changeToFreeIndirect(List<AnnotationFS> annos){
for (AnnotationFS anno : annos) {
String rTypeValue = anno.getFeatureValueAsString(rTypeFeat);
......@@ -2103,10 +2119,30 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
}
rTypeValue = rTypeValue.equals("ruleFreeIndirect") ? "freeIndirect" : "ruleFreeIndirect";
updateAnnotation(anno, rTypeFeat, rTypeValue, true);
int i = 0;
for (AnnotationFS stwrAnno : stwrList){
if (stwrAnno.equals(anno) && i+1 < stwrList.size()){
editor.highlightRange(stwrList.get(i+1).getBegin(), stwrList.get(i+1).getEnd() - stwrList.get(i+1).getBegin(), true);
// highlight in table
IStructuredSelection sel = new StructuredSelection(stwrList.get(i+1));
rwViewComposite.refreshSelection(sel);
}
i++;
}
}
renewPage();
/*
if (i+1 < annos.size()){
System.out.println("test");
editor.highlightRange(annos.get(i+1).getBegin(), annos.get(i+1).getEnd() - annos.get(i+1).getBegin(), true);
}
*/
renewPage();
}
public void addStwrNote(List<AnnotationFS> annos) {
for (AnnotationFS anno : annos) {
......
......@@ -167,7 +167,7 @@ public class RwStwrTableComposite extends Composite{
goToStwr.setText("Go to selected Annotation");
delStwr = new MenuItem(stwrMenu, SWT.None);
delStwr.setText("Delete Selected Annotation");
delStwr.setText("Delete Selected Annotation (Entf)");
mediumMenu = new MenuItem(stwrMenu, SWT.None);
mediumMenu.setText("Change medium (a)");
......@@ -211,7 +211,7 @@ public class RwStwrTableComposite extends Composite{
}
private void handleTableKeyDown(Event e) {
// if nothing is selected the we cant do anything
// if nothing is selected then we cant do anything
if (((IStructuredSelection) stwrViewer.getSelection()).getFirstElement() == null) {
return;
}
......@@ -219,7 +219,6 @@ public class RwStwrTableComposite extends Composite{
// access the selection and convert to annotations if possible
List<AnnotationFS> selectedAnnos = getSelectedAnnotationsFromTable();
// on enter we allow the user to change the name feature
if (e.keyCode == SWT.CR) {
//part.addStwrNote(selectedAnnos);
part.goToAnnotation(getSelectedAnnotationsFromTable());
......@@ -262,7 +261,7 @@ public class RwStwrTableComposite extends Composite{
part.toggleMetaph(selectedAnnos);
}
else if (e.keyCode == KeyEvent.VK_SPACE){
part.changeToFreeIndirect(selectedAnnos);
part.changeToFreeIndirect(selectedAnnos);
}
else if (e.keyCode == KeyEvent.VK_DELETE){
part.deleteAnnotations(getSelectedAnnotationsFromTable());
......
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