Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Modifications to Enable/Disable functionality. Done by Nikhil.
authorlingutln <lingutln@localhost>
Thu, 22 Dec 2011 23:27:43 +0000 (23:27 +0000)
committerlingutln <lingutln@localhost>
Thu, 22 Dec 2011 23:27:43 +0000 (23:27 +0000)
svn path=/; revision=233

Annotation/src/ie/dcu/apps/ist/views/SegmentationView.java
Annotation/src/ie/dcu/apps/ist/widgets/AnnotatedImageControl.java
Annotation/src/ie/dcu/segment/annotate/AnnotationManager.java

index 9104c2679a4819294b0d91591bc642818ca112c4..9c7b4a80c278acc93e8f1f5feb2eb36e83bc52cc 100644 (file)
@@ -448,8 +448,10 @@ public class SegmentationView extends Composite {
        public boolean canUndo() {
                return view.canUndo();
        }
-
-
+       
+       public boolean canAnnotate() {
+               return view.canAnnotate();
+       }
        public boolean canRedo() {
                return view.canRedo();
        }
@@ -761,7 +763,7 @@ public class SegmentationView extends Composite {
                        Tool.ZoomOut.action.setEnabled(canZoomOut());
                        Tool.ZoomOriginal.action.setEnabled(canZoomOriginal());
                        Tool.ZoomBestFit.action.setEnabled(canZoomBestFit());
-                       comboLabel.setEnabled(canZoomBestFit());
+                       comboLabel.setEnabled(canAnnotate());
                        assign.setEnabled(canZoomBestFit() & !(comboLabel.getText().isEmpty()));
                        Tool.Foreground.action.setChecked(isAnnotatingForeground());
                        Tool.Background.action.setChecked(isAnnotatingBackground());
index 89eb761cbb3a225fc6286a9b79ce3f24d6494c39..d3dea1d643b0b69aa30f296671df6d1ea808e3d6 100644 (file)
@@ -202,10 +202,16 @@ public class AnnotatedImageControl extends Composite {
                return false;
        }
        
+       public boolean canAnnotate() {
+               if (ctx != null) {
+                       return ctx.getAnnotations().canUndo();
+               }
+               return false;
+       }
        
        public boolean canRedo() {
                if (ctx != null) {
-                       return ctx.getAnnotations().canRedo();
+                       return ctx.getAnnotations().canAnnotate();
                }
                return false;
        }
index 7ea886d25f7514f84841bd8fdde0194faf5a2798..cb4566538c0020a16ae725d8f073fd3b05a394a7 100644 (file)
@@ -36,6 +36,20 @@ public class AnnotationManager {
                return !annotations.isEmpty();
        }
        
+       public boolean canAnnotate() {
+               String[] temp  = new String[annotations.size()];
+               int i = 0;
+               for(Annotation ann : annotations)
+               {
+                       temp[i++] = ann.getType().toString();
+                       System.out.println(ann.getType());
+               }
+               for(int j=0;j<temp.length;j++)
+               {
+                       System.out.println(temp[j]);
+               }
+               return !annotations.isEmpty();
+       }
        
        public boolean canRedo() {
                return !redos.isEmpty();