Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
Moved PO web service calls to application.properties file; added lookup label focus...
authorpreecej <preecej@localhost>
Tue, 31 Jan 2012 00:09:44 +0000 (00:09 +0000)
committerpreecej <preecej@localhost>
Tue, 31 Jan 2012 00:09:44 +0000 (00:09 +0000)
svn path=/; revision=287

Annotation/resources/config/application.properties
Annotation/src/ie/dcu/apps/ist/AppWindow.java
Annotation/src/ie/dcu/apps/ist/labelling/Labels.java
Annotation/src/ie/dcu/apps/ist/views/SegmentationView.java

index d21c60870c4553b28e7a3c120491ad39be272d22..31a723fa99a954642f26a6fddabde8b734c112cd 100644 (file)
@@ -25,3 +25,7 @@ ExperimentPanel.timeout-message=The time allocated for this task is up!
 ExperimentPanel.experiment-complete-message=The experiment has been completed
 ExperimentPanel.button.text.start=Start
 ExperimentPanel.button.text.finish=Finish
+
+# Web Service Configuration
+POWebService.TermSearch.URL=http://palea.cgrb.oregonstate.edu/services/PO_web_service.php?request_type=term_search&search_value=<search_term>&inc_synonyms&branch_filter=plant_anatomy&max=20
+POWebService.TermDetail.URL=http://palea.cgrb.oregonstate.edu/services/PO_web_service.php?request_type=term_detail&accession_id=<acc_id>
\ No newline at end of file
index 48a77cfeb94d8dd2a805a50926344b33e885298d..8203b9396b868d3a9fac7eb3ec37db1e82c4a338 100644 (file)
@@ -33,7 +33,7 @@ import org.eclipse.swt.widgets.*;
 public class AppWindow extends ApplicationWindow implements FileDropListener {
        private static final Logger log = Logger.getLogger("AppWindow");
        
-       private final Properties props;
+       public static Properties props;
 
        private AppPrefsManager prefsManager;
        private ActionManager actions;
index ce6cd69ebda2fab10c1f6c59db9283d8f821d5af..c85b7f6361bd4ff0cdaa8a8bb449bacf74439feb 100644 (file)
@@ -1,5 +1,7 @@
 package ie.dcu.apps.ist.labelling;
 
+import ie.dcu.apps.ist.AppWindow;
+
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
@@ -29,11 +31,13 @@ public class Labels
                try
            {
                        String encodedContent = URLEncoder.encode(content.toString(),"UTF-8");
-                       URL url = new URL("http://palea.cgrb.oregonstate.edu/services/PO_web_service.php?request_type=term_search&search_value="+encodedContent+"&inc_synonyms&branch_filter=plant_anatomy&max=20");
+                       String webServiceURL = AppWindow.props.getProperty("POWebService.TermSearch.URL");
+                       webServiceURL = webServiceURL.replace("<search_term>", encodedContent);
+                       URL url = new URL(webServiceURL);
                        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
                        BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                        // if the response from Web service is 'OK'
-                       if(connection.getResponseCode() == 200)
+                       if (connection.getResponseCode() == 200)
                {
                        String inputLine;
                        JSONObject object = null;
index 6db97632573f72a551704fffacfb8d18d42460be..1359f80b8bc5d1a8160973806d23c8c45d9a66ae 100644 (file)
@@ -228,6 +228,11 @@ public class SegmentationView extends Composite {
                                dropdownLabels(e);
                        }
                });
+               comboLabel.addFocusListener(new FocusAdapter() {
+                       public void focusGained(FocusEvent e) {
+                               termDetailLookup(e);
+                       }
+               });
                assign = SwtUtils.addButton(termLookupBar, 52, "Assign");
                assign.addSelectionListener(new SelectionAdapter() {
         public void widgetSelected(SelectionEvent arg0) {
@@ -275,7 +280,15 @@ public class SegmentationView extends Composite {
                        comboLabel.add(listElements.get(i),i);
                }
        }
-               
+
+       private void termDetailLookup(FocusEvent e) {
+               // call term detail web service method using accession id (from 1) segment obj or 2) label selection (before assign button is clicked))
+               termDetailTable.setEnabled(true);
+       }
+       
+       /**
+        * Set initial properties of the Term Detail right pane
+        */
        private void createTermDetailTable() {
                termDetailTable.setLinesVisible (true);
                termDetailTable.setHeaderVisible (true);
@@ -289,16 +302,43 @@ public class SegmentationView extends Composite {
                        TableColumn column = new TableColumn (termDetailTable, SWT.NONE);
                        column.setText (titles [i]);
                }
-               
+
+               TableItem item1 = new TableItem (termDetailTable, SWT.NONE);
+               item1.setText (0, "Name");
+               item1.setText (1, "");
+
+               TableItem item2 = new TableItem (termDetailTable, SWT.NONE);
+               item2.setText (0, "Accession ID");
+               item2.setText (1, "");
+
+               TableItem item3 = new TableItem (termDetailTable, SWT.NONE);
+               item3.setText (0, "Branch"); // a.k.a. "Aspect"
+               item3.setText (1, "");
+
+               TableItem item4 = new TableItem (termDetailTable, SWT.NONE);
+               item4.setText (0, "Definition");
+               item4.setText (1, "");
+
+               TableItem item5 = new TableItem (termDetailTable, SWT.NONE);
+               item5.setText (0, "Comment");
+               item5.setText (1, "");
+
+               TableItem item6 = new TableItem (termDetailTable, SWT.NONE);
+               item6.setText (0, "Synonyms");
+               item6.setText (1, "");
+
+               /*
                int count = 6;
                for (int i=0; i<count; i++) {
                        TableItem item = new TableItem (termDetailTable, SWT.NONE);
-                       item.setText (0, "x");
-                       item.setText (1, "y");
+                       item.setText (0, detailLabel[i]);
+                       item.setText (1, "");
                }
+               */
                for (int i=0; i<titles.length; i++) {
                        termDetailTable.getColumn (i).pack ();
                }
+               termDetailTable.setEnabled(false);
        }
        
        private void layoutControls() {