Revision: 4093
          http://vexi.svn.sourceforge.net/vexi/?rev=4093&view=rev
Author:   mkpg2
Date:     2011-03-28 13:56:03 +0000 (Mon, 28 Mar 2011)

Log Message:
-----------
Improve. Make splash close after first window is launched.

Modified Paths:
--------------
    trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java
    trunk/org.vexi-core.main/src/main/java/org/vexi/util/Log.java
    trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java

Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java
===================================================================
--- trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java   
2011-03-28 02:39:00 UTC (rev 4092)
+++ trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java   
2011-03-28 13:56:03 UTC (rev 4093)
@@ -607,6 +607,7 @@
         if (visible != Box.testDisplay(root)) {
             visible = Box.testDisplay(root);
             _makeVisible(visible);
+            surfaceDisplayed();
         }
         if (visible) {
             render();
@@ -687,7 +688,7 @@
      *  REMARK: Platform.createSurface implementations should always return an 
invisible
      *  surface - the Refresh function handles the showing and hiding of 
frames. 
      */
-    public static Surface createSurface(Box b, boolean framed) throws JSExn {
+    static public Surface createSurface(Box b, boolean framed) throws JSExn {
         Surface old = fromBox(b);
         boolean firevisible = old==null && Box.testDisplay(b);
         // fire pre-cascade visible traps
@@ -736,6 +737,14 @@
         surface.Refresh();
         return surface;
     }
+    
+    static private boolean nodisplay = true;
+    static public void surfaceDisplayed() {
+        if(nodisplay){
+            Log.error(Surface.class, "**display launched**");
+            nodisplay = false;
+        }
+    }
 
     // unused - private static Affine identity = Affine.identity();
 

Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/util/Log.java
===================================================================
--- trunk/org.vexi-core.main/src/main/java/org/vexi/util/Log.java       
2011-03-28 02:39:00 UTC (rev 4092)
+++ trunk/org.vexi-core.main/src/main/java/org/vexi/util/Log.java       
2011-03-28 13:56:03 UTC (rev 4093)
@@ -25,5 +25,5 @@
        static public void debug(Object o, Object msg) { user.debug(o, msg); }
        static public void info(Object o, Object msg) { user.info(o, msg); }
        static public void warn(Object o, Object msg) { user.warn(o, msg); }
-       static public void error(Object o, Object msg) { user.warn(o, msg); }
+       static public void error(Object o, Object msg) { user.error(o, msg); }
 }

Modified: trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java
===================================================================
--- trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java       
2011-03-28 02:39:00 UTC (rev 4092)
+++ trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java       
2011-03-28 13:56:03 UTC (rev 4093)
@@ -385,9 +385,10 @@
         } catch (Throwable e) {
             updateError("Error; please check the Java console");
             e.printStackTrace();
-        }finally{
-            Splash.close();
         }
+//        finally{
+//            Splash.close();
+//        }
     }
     
     static public class Problem extends Exception {
@@ -411,8 +412,8 @@
         new Thread(new Runnable() {
             public void run() {
                 // catch output
-                StreamReader errorstream = new 
StreamReader(p.getErrorStream(), "ERROR");
-                StreamReader outputstream = new 
StreamReader(p.getInputStream(), "OUTPUT");
+                StreamReader errorstream = new 
StreamReader(p.getErrorStream(), "ERROR", true);
+                StreamReader outputstream = new 
StreamReader(p.getInputStream(), "OUTPUT", false);
                 // kick off output streams
                 errorstream.start();
                 outputstream.start();
@@ -444,10 +445,12 @@
         InputStream is;
         String type;
         
-        StreamReader(InputStream is, String type) {
+        StreamReader(InputStream is, String type, boolean listenDisplay) {
             this.is = is;
             this.type = type;
+            this.listenDisplay = listenDisplay;
         }
+        private boolean listenDisplay;
         
         public void run() {
             try {
@@ -455,6 +458,9 @@
                 BufferedReader br = new BufferedReader(isr);
                 String line=null;
                 while ((line = br.readLine()) != null) {
+                    if(listenDisplay && line.contains("**display launched**")){
+                        Splash.close();
+                    }
                     log(type + ">" + line);
                 }
             } catch (IOException ioe) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to