Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
Saving annotated images functionality and UI changes. Done by Nikhil.
authorlingutln <lingutln@localhost>
Thu, 31 May 2012 20:45:20 +0000 (20:45 +0000)
committerlingutln <lingutln@localhost>
Thu, 31 May 2012 20:45:20 +0000 (20:45 +0000)
svn path=/; revision=341

Annotation/src/ie/dcu/apps/ist/actions/ExportImageMapAction.java
Annotation/src/ie/dcu/apps/ist/actions/OpenAction.java
Annotation/src/ie/dcu/apps/ist/actions/SaveAction.java
Annotation/src/ie/dcu/apps/ist/dialogs/ExportDialog.java
Annotation/src/ie/dcu/apps/ist/export/imagemap/Exporter.java

index f72882f75de3eaa9c7d923d69b73fafbfb469bc1..ce71c837a28fa33a0febec6983a0ff7c901eeabc 100644 (file)
@@ -31,7 +31,6 @@ public class ExportImageMapAction extends AppAction{
 
        @Override 
        public void run() { 
-               
                SegmentationContext ctx = window.getContext();
                List<SegmentationMask> masks = ctx.getSegmentationMasks();
                if (ctx.hasSegmentationMasks()) {
@@ -39,9 +38,7 @@ public class ExportImageMapAction extends AppAction{
                        // Get options from user
                        ExportDialog dialog = new ExportDialog(window.getShell());
                        ExportDialog.Result result = dialog.open();
-                       
                        if (result != null) {
-                               
                                // Grab image and mask
                                
                                        BufferedImage image = ImageConverter.convert(ctx.getImageData());
@@ -51,8 +48,9 @@ public class ExportImageMapAction extends AppAction{
                                        exporter.setHtmlFile(result.html);
                                        
                                        // Taking html file name and making the same as filename of imagemap
-                                       int dotIndex = result.image.indexOf('.');
-                                       String zipFile = result.image.substring(0, dotIndex); 
+                                       int dotIndex = result.zipFile.indexOf('.');
+                                       String zipFile = result.zipFile.substring(0, dotIndex); 
+                                       System.out.println("Zip file name is : "+zipFile);
                                        exporter.setZipFile(zipFile+IMGMAP_EXTENSION);
                                        
                                        exporter.setImageFile(result.image);
index ed1790cb1c701154ef773fe9f551a1a7ab232b85..991a319a5cec8f876132b0318697d4fd40f02016 100644 (file)
@@ -1,6 +1,7 @@
 package ie.dcu.apps.ist.actions;
 
 import ie.dcu.apps.ist.*;
+import ie.dcu.apps.ist.views.SegmentationView;
 import ie.dcu.segment.SegmentationContext;
 
 import java.io.*;
index e1fe18a509ff206f5764239846ebdcfdac5dbc4d..549a62cda43530b59e9acafc869d6c8de097bbc6 100644 (file)
@@ -55,8 +55,7 @@ public class SaveAction extends AppAction {
                                        exporter.setHtmlFile("imagemap.html");
                                        
                                        // Taking html file name and making the same as filename of imagemap
-                                       int dotIndex = result.html.indexOf('.');
-                                       String zipFile = result.html.substring(0, dotIndex); 
+                                       String zipFile = result.zipFile; 
                                        exporter.setZipFile(zipFile+IMGMAP_EXTENSION);
                                        
                                        exporter.setImageFile(result.image);
index 8feeb306b40e31256b8ca9a39fd43544634d9571..8bbf3942a56b320ad795646fde68480eae8629a5 100644 (file)
@@ -28,6 +28,7 @@ public class ExportDialog extends Dialog {
        public class Result {
                public final File folder;
                public final String html;
+               public final String zipFile;
                public final String image;
                public final String link;
                public final String description;
@@ -39,7 +40,8 @@ public class ExportDialog extends Dialog {
                        folder = new File(folderText.getText().trim());
                        //html = htmlText.getText().trim();
                        html = "imagemap.html";
-                       image = imageText.getText().trim();
+                       zipFile = zipFileName.getText().trim();
+                       image = "image";
                        link = linkText.getText().trim();
                        description = descriptionText.getText();
                        shape = getShape();
@@ -61,6 +63,7 @@ public class ExportDialog extends Dialog {
        private Text folderText;
        private Button browseButton;
        private Text htmlText;
+       private Text zipFileName;
        private Text imageText;
        private Text linkText;
        private Button effectCheck;
@@ -134,12 +137,13 @@ public class ExportDialog extends Dialog {
                label(widgets, "Export folder:");
                folderText = text(widgets, "");
                browseButton = button(widgets, "Browse...");
-               //label(widgets, "HTML file name:");
-               //htmlText = text(widgets, "imagemap.html");
+               label(widgets, "Target zip file name:");
+               zipFileName = text(widgets, "annotated");
+               label(widgets, ".zip");
                //spacer(widgets);
-               label(widgets, "File name:");
+               /*label(widgets, "File name:");
                imageText = text(widgets, "image");
-               spacer(widgets);
+               spacer(widgets);*/
                hline(widgets);
                label(widgets, "Export shape:");
                shapeRadios = radios(widgets, SHAPES);
@@ -218,19 +222,19 @@ public class ExportDialog extends Dialog {
                        return false;
                }
                
-               /*String htmlFile = htmlText.getText().trim();
-               if (htmlFile.equals("")) {
+               String zipFile = zipFileName.getText().trim();
+               if (zipFile.equals("")) {
                        validationError("The HTML file name cannot be empty");
-                       htmlText.setFocus();
+                       zipFileName.setFocus();
                        return false;
-               }*/
+               }
                
-               String imageFile = imageText.getText().trim();
+               /*String imageFile = imageText.getText().trim();
                if (imageFile.equals("")) {
                        validationError("The image file name cannot be empty");
                        imageText.setFocus();
                        return false;
-               }
+               }*/
                
                return true;
        }
index 557a0a9e792f79827c42c009044660e4685deaa4..1ed82c1b29673db2da31502e0f133ba7879f3e19 100644 (file)
@@ -32,7 +32,7 @@ public class Exporter {
        
        private RolloverEffect effect;
        private String htmlFile = "imagemap.html";
-       private String zipFile = "imagemap.zip";
+       private String zipFile = "";
        private String imageFile = "image.png";
        private String imageName = "image";
        private String objectDescription = "";