[kepler-dev] [kepler-code] r18398 - trunk/modules/loader/src/org/kepler

Derik Barseghian barseghian at nceas.ucsb.edu
Tue May 19 17:03:42 PDT 2009


Hey Chad,

Looks like this import breaks the build on linux. Maybe windows too.

Derik


On May 19, 2009, at 4:50 PM, berkley at ecoinformatics.org wrote:

> Author: berkley
> Date: 2009-05-19 16:50:16 -0700 (Tue, 19 May 2009)
> New Revision: 18398
>
> Added:
>   trunk/modules/loader/src/org/kepler/KeplerApplicationListener.java
> Modified:
>   trunk/modules/loader/src/org/kepler/Kepler.java
> Log:
> made kepler listen for apple events
>
>
> Modified: trunk/modules/loader/src/org/kepler/Kepler.java
> ===================================================================
> --- trunk/modules/loader/src/org/kepler/Kepler.java	2009-05-19  
> 23:50:15 UTC (rev 18397)
> +++ trunk/modules/loader/src/org/kepler/Kepler.java	2009-05-19  
> 23:50:16 UTC (rev 18398)
> @@ -45,6 +45,8 @@
> import org.kepler.sms.util.OntologyConfiguration;
> import org.kepler.util.AuthNamespace;
>
> +import com.apple.eawt.*;
> +
> import ptolemy.kernel.util.IllegalActionException;
>
> /**
> @@ -72,8 +74,14 @@
>         try
>         {
>             SystemPropertyLoader.load();
> -            System.setProperty("apple.laf.useScreenMenuBar", "true");
> -             
> System 
> .setProperty("com.apple.mrj.application.apple.menu.about.name",  
> "Kepler");
> +            //System.out.println("os: " +  
> System.getProperty("os.name"));
> +            if(System.getProperty("os.name").equals("Mac OS X"))
> +            {
> +              System.setProperty("apple.laf.useScreenMenuBar",  
> "true");
> +               
> System 
> .setProperty("com.apple.mrj.application.apple.menu.about.name",  
> "Kepler");
> +              Application osxApplication =  
> Application.getApplication();
> +              osxApplication.addApplicationListener(new  
> KeplerApplicationListener());
> +            }
>
>             Project project = new Project();
>             project.setBaseDir(ProjectLocator.getProjectDir());
>
> Added: trunk/modules/loader/src/org/kepler/ 
> KeplerApplicationListener.java
> ===================================================================
> --- trunk/modules/loader/src/org/kepler/ 
> KeplerApplicationListener.java	                        (rev 0)
> +++ trunk/modules/loader/src/org/kepler/ 
> KeplerApplicationListener.java	2009-05-19 23:50:16 UTC (rev 18398)
> @@ -0,0 +1,59 @@
> +package org.kepler;
> +
> +import com.apple.eawt.*;
> +
> +import org.kepler.gui.*;
> +
> +import java.io.File;
> +import java.net.URL;
> +
> +import org.ecoinformatics.util.Config;
> +
> +public class KeplerApplicationListener implements ApplicationListener
> +{
> +  public void handleAbout(ApplicationEvent event)
> +  {
> +    System.out.println("opening about");
> +    String splashname = Config.getValue("//splash/image");
> +    final URL splashURL = ClassLoader.getSystemClassLoader()
> +        .getResource(splashname);
> +    // lines containing //DFH commented out in attempt to avoid
> +    // occasional all white splash screenss
> +    // DFH SwingUtilities.invokeAndWait(new Runnable() {
> +    // DFH public void run() {
> +    SplashWindow.splash(splashURL);
> +    event.setHandled(true);
> +  }
> +
> +  public void handleOpenApplication(ApplicationEvent event)
> +  {
> +
> +  }
> +
> +  public void handleOpenFile(ApplicationEvent event)
> +  {
> +
> +  }
> +
> +  public void handlePreferences(ApplicationEvent event)
> +  {
> +
> +  }
> +
> +  public void handlePrintFile(ApplicationEvent event)
> +  {
> +
> +  }
> +
> +  public void handleQuit(ApplicationEvent event)
> +  {
> +    System.out.println("quitting...");
> +    event.setHandled(true);
> +  }
> +
> +  public void handleReOpenApplication(ApplicationEvent event)
> +  {
> +
> +  }
> +
> +}
>
> _______________________________________________
> Kepler-cvs mailing list
> Kepler-cvs at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-cvs
>



More information about the Kepler-dev mailing list