[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Thu Dec 6 18:47:31 UTC 2007


gordonp
Thu Dec  6 13:47:31 EST 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui
In directory dev.open-bio.org:/tmp/cvs-serv26508/src/main/ca/ucalgary/seahawk/gui

Modified Files:
	SeahawkOptionsGUI.java 
Log Message:
Added support for office document conversion proxy settings
moby-live/Java/src/main/ca/ucalgary/seahawk/gui SeahawkOptionsGUI.java,1.5,1.6
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/SeahawkOptionsGUI.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/SeahawkOptionsGUI.java	2007/07/11 15:06:57	1.5
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/SeahawkOptionsGUI.java	2007/12/06 18:47:31	1.6
@@ -1,6 +1,6 @@
 package ca.ucalgary.seahawk.gui;
 
-import ca.ucalgary.seahawk.util.SeahawkOptions;
+import ca.ucalgary.seahawk.util.*;
 
 import org.biomoby.registry.meta.*;
 
@@ -30,6 +30,8 @@
 
     private JButton deleteCacheButton;
     private JButton selectCacheDirButton;
+    private JTextField converterHostTextField;
+    private JTextField converterPortTextField;
     private JTextField cacheExpiryTextField;
     private JFileChooser cacheDirFileChooser;
 
@@ -142,40 +144,73 @@
         add(registryNamespace, c);
 
         //........................................
-        c.gridx = 0;
+	c.gridx = 0;
         c.gridy = 4;
-        c.gridwidth = 6;
+        c.gridwidth = 5;
         JSeparator line = new JSeparator();
         add(line, c);
 
         //........................................
-        c.gridx = 0;
+	c.gridx = 0;
         c.gridy = 5;
+        c.gridwidth = 2;
+        label = new JLabel("OpenOffice Service Host & Port:", JLabel.RIGHT);
+	label.setToolTipText(HTMLUtils.htmlifyToolTipText("Used to convert Word " +
+				       "documents and other formats for display " +
+				       "in Seahawk.  If left blank, no conversions " +
+				       "will be performed, restricting data import.", 50));
+        add(label, c);
+
+        c.gridx = 2;
+        c.gridwidth = 1;
+        converterHostTextField = new JTextField(12);
+	converterHostTextField.setMinimumSize(converterHostTextField.getPreferredSize()); // prevents text collapsing
+        add(converterHostTextField, c);	
+        c.gridx = 3;
+        c.gridwidth = 1;
+        c.fill = GridBagConstraints.NONE;	
+	c.anchor = GridBagConstraints.WEST;
+        converterPortTextField = new JTextField(5);
+        converterPortTextField.setMinimumSize(converterPortTextField.getPreferredSize()); // prevents text collapsing
+        add(converterPortTextField, c);	
+	c.fill = GridBagConstraints.HORIZONTAL;
+
+        //........................................
+        c.gridx = 0;
+        c.gridy = 6;
+        c.gridwidth = 5;
+        line = new JSeparator();
+        add(line, c);
+
+        //........................................
+        c.gridx = 0;
+        c.gridy = 7;
         c.gridwidth = 4;
         c.gridheight = 1;
         sendReferrerCheckBox = new JCheckBox("Send referrer data to services");
         add(sendReferrerCheckBox, c);
 
         //........................................
-        c.gridy = 6;
-        c.gridwidth = 6;
+        c.gridy = 8;
+        c.gridwidth = 5;
         line = new JSeparator();
         add(line, c);
 
         //........................................
-        c.gridy = 7;
+        c.gridy = 9;
         c.gridwidth = 2;
         label = new JLabel("Cache expiry (in hours)", JLabel.RIGHT);
         add(label, c);
 
         c.gridx = 2;
         c.gridwidth = 1;
+	c.fill = GridBagConstraints.NONE;
         cacheExpiryTextField = new JTextField(3);
         cacheExpiryTextField.setMinimumSize(cacheExpiryTextField.getPreferredSize()); // prevents text collapsing
         add(cacheExpiryTextField, c);
 
         c.gridx = 3;
-        c.gridwidth = 3;
+        c.gridwidth = 2;
         c.fill = GridBagConstraints.NONE;
         JPanel cbPanel = new JPanel(new GridLayout(1,0,4,2));
 
@@ -241,6 +276,8 @@
 	    registryComboBox.setSelectedItem(currentRegistry.getSynonym());
 	}
 	updateRegistryFields(); 
+	converterHostTextField.setText(""+SeahawkOptions.getDocConverterHost());
+	converterPortTextField.setText(""+SeahawkOptions.getDocConverterPort());
 	sendReferrerCheckBox.setSelected(SeahawkOptions.getSendReferrerPolicy());
 	cacheExpiryTextField.setText(""+SeahawkOptions.getCacheExpiry());
 	cacheDirFileChooser.setSelectedFile(SeahawkOptions.getTempDir());
@@ -252,8 +289,22 @@
 	    expiry = Double.parseDouble(cacheExpiryTextField.getText());
 	} catch(Exception e){
 	    JOptionPane.showMessageDialog(null, 
-					  "The cache expiry field is not a number,\nplease correct it to continue", 
-					  "Invalid Formatting", 
+					  "The cache expiry field is not a number,\n"+
+					  "please correct it to continue", 
+					  "Invalid Number Formatting", 
+					  JOptionPane.ERROR_MESSAGE);
+	    return;
+	}
+
+	int port = SeahawkOptions.getDocConverterPort();
+	try{
+	    port = Integer.parseInt(converterPortTextField.getText());
+	    SeahawkOptions.setDocConverterPort(port);
+	} catch(Exception e){
+	    JOptionPane.showMessageDialog(null, 
+					  "The converter port field is not an positive integer,\n"+
+					  "please correct it to continue", 
+					  "Invalid Integer Formatting", 
 					  JOptionPane.ERROR_MESSAGE);
 	    return;
 	}
@@ -296,6 +347,7 @@
 	    return;
 	}
 
+	SeahawkOptions.setDocConverterHost(converterHostTextField.getText().trim());
 	SeahawkOptions.setSendReferrerPolicy(sendReferrerCheckBox.isSelected());
 	SeahawkOptions.setCacheExpiry(expiry);
 




More information about the MOBY-guts mailing list