Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
in progress: ontologyTerm refactoring associated with term detail web service call
authorpreecej <preecej@localhost>
Tue, 15 May 2012 23:58:32 +0000 (23:58 +0000)
committerpreecej <preecej@localhost>
Tue, 15 May 2012 23:58:32 +0000 (23:58 +0000)
svn path=/; revision=329

Annotation/.classpath
Annotation/src/ie/dcu/apps/ist/views/SegmentationView.java
Annotation/src/ie/dcu/apps/ist/widgets/AnnotatedImageControl.java
Annotation/src/ie/dcu/segment/SegmentationMask.java

index 22412b6c9a2c02f608af7c008e1447f0c9cabf62..6eb1bbea6dbea8595a47e6221b6a5a8ba9e1d5c3 100644 (file)
@@ -3,9 +3,9 @@
        <classpathentry kind="src" path="src"/>
        <classpathentry excluding="src/" kind="src" path=""/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-       <classpathentry kind="lib" path="/home/lingutln/workspace/Annotation/library/commons-lang3-3.1.jar"/>
-       <classpathentry kind="lib" path="/home/lingutln/workspace/Annotation/library/jface.jar"/>
-       <classpathentry kind="lib" path="/home/lingutln/workspace/Annotation/library/json.jar"/>
-       <classpathentry kind="lib" path="/home/lingutln/workspace/Annotation/library/swt-gtk-64.jar"/>
+       <classpathentry kind="lib" path="/home/preecej/Development/eclipse_workspace/Annotation/library/commons-lang3-3.1.jar"/>
+       <classpathentry kind="lib" path="/home/preecej/Development/eclipse_workspace/Annotation/library/jface.jar"/>
+       <classpathentry kind="lib" path="/home/preecej/Development/eclipse_workspace/Annotation/library/json.jar"/>
+       <classpathentry kind="lib" path="/home/preecej/Development/eclipse_workspace/Annotation/library/swt-gtk-64.jar"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
index ff817790ba46137c414ff753195d068bc48f4044..2af7ee9c307b313f94d75d9b88f79da4de055997 100644 (file)
@@ -53,7 +53,7 @@ public class SegmentationView extends Composite {
        private Composite termDetailComposite;
        
        // term detail table
-       private Table termDetailTable;
+       private static Table termDetailTable;
        
        // Control to change brush size
        private final BrushControl brushControl;
@@ -234,6 +234,10 @@ public class SegmentationView extends Composite {
                viewSelectionToolbar.pack();
        }
        
+       private String parseAccessionIdFromComboLabel(Combo comboLabel) {
+               return comboLabel.getText().substring(comboLabel.getText().indexOf('{')+1,comboLabel.getText().length()-1);
+       }
+       
        /**
         * Third tool bar for holding the Annotate Combo box. 
         */
@@ -248,7 +252,7 @@ public class SegmentationView extends Composite {
                });
                comboLabel.addSelectionListener(new SelectionAdapter() {
                        public void widgetSelected(SelectionEvent e) {
-                               selectDropdownLabel(e, comboLabel.getText().substring(comboLabel.getText().indexOf('{')+1,comboLabel.getText().length()-1));                                            
+                               termDetailLookup(parseAccessionIdFromComboLabel(comboLabel));                                           
                        }
                });
                assign = SwtUtils.addButton(termLookupBar, 55, "Assign");
@@ -256,6 +260,13 @@ public class SegmentationView extends Composite {
         public void widgetSelected(SelectionEvent arg0) {
                if(view.getContext().isEnabled())
                {
+                       OntologyTerm term = new OntologyTerm();
+                       term.setName((String)comboLabel.getData(comboLabel.getText()));
+                       term.setAccessionId(parseAccessionIdFromComboLabel(comboLabel));
+                       view.getContext().getEnabledMask().ontologyTerm = term;
+                       /* TODO: remove this and reference SegementationMake.ontologyTerm.getName() instead 
+                        * (find tooltip and any other reference as well)
+                        */
                        view.getContext().getEnabledMask().segmentName = (String) comboLabel.getData(comboLabel.getText());
                }
                execute(Tool.AssignButton, null);
@@ -310,21 +321,13 @@ public class SegmentationView extends Composite {
                searchSpecies.setEnabled(!(speciesCombo.getText().isEmpty()));
                speciesCombo.setListVisible(true);
        }
-       
-       // TODO: you need to find the event hook for segment selection, that resets the comboLabel and the .accessionId (you should use accessionId in this context)
-       public void selectSegment(SelectionEvent e) {
-               System.out.println("curr accession id (from segment): " + this.view.getContext().getEnabledMask().accessionId);
-               termDetailLookup(this.view.getContext().getEnabledMask().accessionId);  
-       }
-       
-       public void selectDropdownLabel(SelectionEvent e, String accessionId) {
-               System.out.println("curr accession id (from label): " + accessionId);
-               //System.out.println("curr comboLabel value: " + comboLabel.getText());
-               termDetailLookup(accessionId);  
-       }
-       
-       private void termDetailLookup(String accessionId) {
-               // call term detail web service method using accession id (from 1) segment obj or 2) label selection (before assign button is clicked))
+
+       /* 
+        * call term detail web service method using accession id from 1) segment obj or 2) label selection 
+        * (before assign button is clicked)
+       */
+       public static void termDetailLookup(String accessionId) {
+               System.out.println("curr accession id (from segment or label): " + accessionId);
                termDetailTable.setEnabled(true);
        }
        
index 757d1758ca84e76f3cdd0e3d8bd7d16342bd3003..091b31103dbc7acb9cb972594426a8ecce713405 100644 (file)
@@ -438,9 +438,10 @@ public class AnnotatedImageControl extends Composite {
                                {
                                        enableClickedSegment(view.canvasToImage(mouseClickedPoint));
                                        // For setting the comboLabel value and tooltip on clicking a segment
-                                       String segmentName = ctx.getEnabledMask().segmentName;
+                                       String segmentName = ctx.getEnabledMask().ontologyTerm.getName();
                                        getCanvas().setToolTipText(segmentName);
                                        SegmentationView.comboLabel.setText(segmentName);
+                                       SegmentationView.termDetailLookup(ctx.getEnabledMask().ontologyTerm.getAccessionId());
                                }
                                repaint();
                        }
index 32ba6e1d6680a2ae642b49d8a88890eb9b5f19c4..ef79baaa63588ec21c9bb8a346c70cc1754bed8e 100644 (file)
@@ -2,6 +2,7 @@ package ie.dcu.segment;
 
 import ie.dcu.matrix.ByteMatrix;
 import ie.dcu.segment.annotate.AnnotationManager;
+import ie.dcu.apps.ist.labelling.OntologyTerm;
 
 import java.io.*;
 
@@ -62,12 +63,17 @@ public class SegmentationMask extends ByteMatrix{
        //The layering number of the segmentation mask.
        public int layerNumber;
        
-       //The name(label) associated with each segment.
+       @Deprecated
+       //The name(label) associated with each segment. - replaced with Term object
        public String segmentName;
 
-       // accession id associated with the segmentName
+       @Deprecated
+       // accession id associated with the segmentName - replaced with Term object
        public String accessionId;
        
+       // holds the accessionId and name of the ontology term associated with this segment
+       public OntologyTerm ontologyTerm;
+       
        //The maskImage each segment.
        public Image maskImage;