Commit b0710c2c authored by Markus Krug's avatar Markus Krug

added 1 new feature: Annotations can now be created by double clicking

the type

and 1 bugfix- annobrowser labels were off by 1 iteration of the color
parent a77152e4
......@@ -388,6 +388,7 @@ public class AnnotationBrowserWidget extends Composite {
private void addTreeMouseListener() {
viewer.getTree().addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
......@@ -395,6 +396,15 @@ public class AnnotationBrowserWidget extends Composite {
IStructuredSelection sel = (IStructuredSelection) viewer.getSelection();
Object firstElement = sel.getFirstElement();
if(firstElement instanceof TypeStyleDataStructure){
TypeStyleDataStructure tsds = (TypeStyleDataStructure) firstElement;
if(editor.getActualSelectedText()!=null){
AnnotationFS fs = editor.getCas().createAnnotation(tsds.getAnnotationType(), editor.getActualSelectedText().x, editor.getActualSelectedText().y);
editor.addAnnotation(fs);
}
}
if (firstElement instanceof FeatureValueWrapper) {
......
......@@ -1137,8 +1137,11 @@ public class AnnotationEditorWidget extends Composite {
// default is backgroundDrawingStrategy
// TODO the anno browser labelprovider color seems off!!
StyleRange srAnnoType = new StyleRange();
srAnnoType.background=actual;
srAnnoType.foreground=actual;
AnnoStyle style = new AnnoStyle(DrawingTypeStrategyFactory.getNaiveSpanDrawingStrategy(next,
actual.getRGBA(), actual.getRGBA(), EDrawingType.RECTANGLE_FILLED), styleRange);
actual.getRGBA(), actual.getRGBA(), EDrawingType.RECTANGLE_FILLED), srAnnoType);
// AnnoStyle style = new AnnoStyle(strat, styleRange);
TypeStyleDataStructure asds = new TypeStyleDataStructure(next, style, 0);
......@@ -1283,6 +1286,8 @@ public class AnnotationEditorWidget extends Composite {
String[] filterExt = { "*.xml", "*.*" };
fd.setFilterExtensions(filterExt);
String selected = fd.open();
if (selected == null)
return;
AnnotationEditorWidget.this.currentNappiConfig = new File(selected);
if (AnnotationEditorWidget.this.currentNappiConfig != null) {
......
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