From b5385bdd3f52abb6363148815c4a794abf31cd7c Mon Sep 17 00:00:00 2001 From: lingutln Date: Thu, 17 Nov 2011 00:06:58 +0000 Subject: [PATCH] Added some Modification to annotate box. Done by Nikhil. svn path=/; revision=217 --- image_annotation/.classpath | 2 +- .../src/ie/dcu/apps/ist/AppWindow.java | 3 --- .../dcu/apps/ist/views/SegmentationView.java | 22 ++++++++++++------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/image_annotation/.classpath b/image_annotation/.classpath index 6a5ba76..810f0b6 100644 --- a/image_annotation/.classpath +++ b/image_annotation/.classpath @@ -3,7 +3,7 @@ - + diff --git a/image_annotation/src/ie/dcu/apps/ist/AppWindow.java b/image_annotation/src/ie/dcu/apps/ist/AppWindow.java index a07bbb0..5f32b24 100644 --- a/image_annotation/src/ie/dcu/apps/ist/AppWindow.java +++ b/image_annotation/src/ie/dcu/apps/ist/AppWindow.java @@ -337,9 +337,6 @@ public class AppWindow extends ApplicationWindow implements FileDropListener { help.add(actions.get(HelpAction.class)); help.add(actions.get(AboutAction.class)); - MenuManager annotate = addMenu(bar, "&Annotate"); - annotate.add(actions.get(HelpAction.class)); - if (OsUtils.isMacOSX()) { // Enhance the UI on the Mac IAction aboutAction = actions.get(AboutAction.class); diff --git a/image_annotation/src/ie/dcu/apps/ist/views/SegmentationView.java b/image_annotation/src/ie/dcu/apps/ist/views/SegmentationView.java index b5b52ee..6107725 100644 --- a/image_annotation/src/ie/dcu/apps/ist/views/SegmentationView.java +++ b/image_annotation/src/ie/dcu/apps/ist/views/SegmentationView.java @@ -67,9 +67,6 @@ public class SegmentationView extends Composite { // Combo box housing the selectable views private Combo combo, comboLabel; - // Button for assigning a label to the Segmented image - private Button assign; - // Current segmentation tool private Segmenter segmenter; @@ -188,7 +185,9 @@ public class SegmentationView extends Composite { }); bar2.pack(); } - + /** + * Third tool bar for holding the Annotate combo. + */ private void createToolbar3() { SwtUtils.addLabel(bar3, getAction(Tool.SetLabel).getText()); comboLabel = SwtUtils.addCombo(bar3, 130, SWT.SIMPLE); @@ -198,18 +197,24 @@ public class SegmentationView extends Composite { public void keyReleased(KeyEvent e) { comboLabel.remove(0,comboLabel.getItemCount()-1); setLabel(comboLabel.getText()); - } + Display.getCurrent().asyncExec(new Runnable() { + public void run() { + comboLabel.setFocus(); + comboLabel.setText(comboLabel.getText()); + } + }); + } @Override public void keyPressed(KeyEvent arg0) { // TODO Auto-generated method stub } }); - ToolItem item = new ToolItem(bar3, SWT.SEPARATOR); + /*ToolItem item = new ToolItem(bar3, SWT.SEPARATOR); assign = new Button(bar3, SWT.PUSH); assign.setText("Assign"); item.setWidth(50); item.setControl(assign); - bar3.pack(); + bar3.pack();*/ } @@ -731,7 +736,7 @@ public class SegmentationView extends Composite { Tool.Clear.action.setEnabled(canClear()); Tool.AutoApply.action.setChecked(auto); Tool.SegmenterOptions.action.setEnabled(canShowOptions()); - + // Always enabled if view enabled Tool.SetBrushSize.action.setEnabled(true); Tool.SegmenterOptions.action.setEnabled(true); @@ -772,6 +777,7 @@ public class SegmentationView extends Composite { for(int i=0; i