[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Thu Feb 3 21:47:57 UTC 2011


gordonp
Thu Feb  3 16:47:57 EST 2011
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui
In directory dev.open-bio.org:/tmp/cvs-serv20248/src/main/ca/ucalgary/seahawk/gui

Modified Files:
	MobyContentGUI.java 
Log Message:
Implement font resizing, and singleton application launching
moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentGUI.java,1.23,1.24
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java	2010/05/13 16:13:21	1.23
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java	2011/02/03 21:47:57	1.24
@@ -26,6 +26,7 @@
 import org.biomoby.shared.data.*;
 import org.biomoby.shared.parser.MobyTags;
 
+import ca.ucalgary.util.*;
 import ca.ucalgary.seahawk.util.*;
 import ca.ucalgary.seahawk.services.MobyClient;
 
@@ -36,7 +37,7 @@
  * @author Paul Gordon (gordonp at ucalgary.ca)
  */
 
-public class MobyContentGUI extends JFrame implements ActionListener, ComponentListener, KeyListener, MobyRequestEventHandler, MouseListener{
+public class MobyContentGUI extends JFrame implements ActionListener, ComponentListener, KeyListener, MobyRequestEventHandler, MouseListener, FontSizeChangeListener, ArgumentListener{
 
     // Variables used to coordinate component finding with the unit test cases
     public final static String BACK_BUTTON_NAME = "MCGbackButton";
@@ -248,7 +249,7 @@
 	tabbedPane.add(clipboard);
 	clipboard.init();
 
-	settingsGUI = new SeahawkOptionsGUI(this);
+	settingsGUI = new SeahawkOptionsGUI(this, this);  // params are frame owner, font change listener
     }
 
     public Acme.Serve.Serve getServletContainer(){
@@ -1189,15 +1190,17 @@
 	    new Thread(){ 
 		public void run(){
 		    for(;;) {
-			renderSplashFrame(g);
-			splash.update();
 			try {
+			    renderSplashFrame(g);
+			    splash.update();
 			    Thread.sleep(100);
 			}
-			catch(InterruptedException e) {
+			catch(Exception e) {
 			}
 			if(killSplash.tryAcquire()){
-			    splash.close();
+			    // Okay, we don't need to close the splash screen 
+			    // because it autocloses when a Java Window is shown.
+			    //splash.close();
 			    return;
 			}
 		    }
@@ -1277,6 +1280,24 @@
 		gui.loadPaneFromURL(startURL, true);
 	    }
 	}	
+	SingletonApplication.setArgumentListener(gui);
+    }
+
+    // Called when user attempts to launch Seahawk again while its running
+    public void processArgument(String arg){
+	try{
+	    loadPaneFromURL(new URL(arg), true);
+	}
+	catch(Exception e){
+	    System.err.println("Could not load "+arg+" as a URL, trying as a file");
+	    try{
+		File f = new File(arg);
+		loadPaneFromURL(f.toURI().toURL(), true);
+	    } catch(Exception fe){
+		logger.error("Could not load "+arg+" as a URL or file: "+fe.getMessage());
+		e.printStackTrace();
+	    }
+	}
     }
 
     protected static void cacheOntologies(){
@@ -1314,4 +1335,11 @@
     public JLabel getStatusComponent() {
 	return status;
     }
+
+    public void fontSizeChanged(String fontSize) {
+	// Update font in all Seahawk-generated documents
+	for(int i = 0; i < tabbedPane.getTabCount(); i++){
+	    ((MobyContentPane) tabbedPane.getComponentAt(i)).setFontSize(fontSize);
+	}
+    }
 }




More information about the MOBY-guts mailing list