Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
kallimachos
Athen
Commits
8fa8939f
Commit
8fa8939f
authored
Oct 29, 2018
by
tu
Browse files
automatically jump to next annotation after accepting/deleting one
parent
f7351944
Pipeline
#12569
passed with stage
in 5 minutes and 9 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
de.uniwue.mk.athen/bundles/de.ids.tt.athen.rwview/src/de/ids/tt/athen/rwview/part/RedeWiedergabeView.java
View file @
8fa8939f
...
...
@@ -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
)
{
...
...
de.uniwue.mk.athen/bundles/de.ids.tt.athen.rwview/src/de/ids/tt/athen/rwview/ui/RwStwrTableComposite.java
View file @
8fa8939f
...
...
@@ -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 the
n
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
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment