Revision: 3824
          http://vexi.svn.sourceforge.net/vexi/?rev=3824&view=rev
Author:   clrg
Date:     2010-03-26 06:43:33 +0000 (Fri, 26 Mar 2010)

Log Message:
-----------
Code cleanup only

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/core/Blessing.java
    trunk/core/org.vexi.core/src/org/vexi/core/Surface.java
    trunk/core/org.vexi.core/src/org/vexi/core/VML.java
    trunk/core/org.vexi.core/src/org/vexi/plat/AWT.java
    trunk/core/org.vexi.core/src/org/vexi/plat/JVM.java
    trunk/core/org.vexi.core/src/org/vexi/plat/Java2.java
    trunk/core/org.vexi.core/src/org/vexi/plat/Platform.java

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Blessing.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Blessing.java    2010-03-26 
06:35:59 UTC (rev 3823)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Blessing.java    2010-03-26 
06:43:33 UTC (rev 3824)
@@ -11,7 +11,7 @@
 public class Blessing extends JS.Clone implements Constants {
     
     static final String[] EXTS_IMAGES = new String[] { ".png", ".jpeg", 
".gif", ".jpg" };
-    static final String[] EXTS_TTF = new String[] { ".ttf"};
+    static final String[] EXTS_TTF = new String[] { ".ttf" };
     
     
     private JS vexi;
@@ -51,23 +51,24 @@
         if (SC_.equals(key)) {
             return getStatic();
         }
-        if (cache.get(key) != null) {
-            return (JS)cache.get(key);
+        JS ret = (JS)cache.get(key);
+        if (ret != null) {
+            return ret;
         }
-        String key_ = JSU.toString(key);
+        String keystr = JSU.toString(key);
         // x.t is equivalent to x
-        if (key_.endsWith(".t")) {
-            key_ = key_.substring(0,key_.length()-2);
+        if (keystr.endsWith(".t")) {
+            keystr = keystr.substring(0,keystr.length()-2);
             JS origKey = key;
-            key = JSU.S(key_);
-            if (cache.get(key) != null) {
-                JS ret = (JS)cache.get(key);
+            key = JSU.S(keystr);
+            ret = (JS)cache.get(key);
+            if (ret != null) {
                 cache.put(origKey, ret);
                 return ret;
             }
         }
         // HACK - calling getAndTriggerTraps in a plain get
-        JS ret = new Blessing(Main.SCHEDULER.getAndTriggerTraps(clonee, key), 
vexi, this, key);
+        ret = new Blessing(Main.SCHEDULER.getAndTriggerTraps(clonee, key), 
vexi, this, key);
         cache.put(key, ret);
         return ret;
     }
@@ -92,7 +93,7 @@
         super.addTrap(key, f);
     }
     
-    private InputStream getForExtensions(String[] exts) throws JSExn{
+    private InputStream getForExtensions(String[] exts) throws JSExn {
         try {
             InputStream in = JSU.getInputStream(this);
             if (in != null) {
@@ -125,7 +126,9 @@
     
     private long getTimestamp(JS res){
         Fountain f = JSU.getFountain(res);
-        if(f==null) return -1;
+        if (f==null) {
+            return -1;
+        }
         return f.getTimestamp();
     }
     
@@ -139,14 +142,17 @@
         try {
             // FEATURE: Might want to handle the ".t" part better
             JS res = (parent==null) ? this : parent.getTemplateRes(parentkey);
-            if(Main.hotreplace){
+            if (Main.hotreplace) {
                 long timestamp = getTimestamp(res);
-                if(static_!=null){
-                    if(timestamp==oldtimestamp) return;
-                    else Log.system.warn(Blessing.class, "hot replace: "+res);
+                if (static_!=null) {
+                    if (timestamp==oldtimestamp) {
+                        return;
+                    } else {
+                        Log.system.warn(Blessing.class, "hot replace: "+res);
+                    }
                 }
                 oldtimestamp = timestamp;
-            }else if(static_!=null){
+            } else if (static_!=null) {
                 return;
             }
             static_ = new Static(vexi, this, description());
@@ -156,7 +162,7 @@
         }
     }
 
-    private JS getTemplateRes(JS key) throws JSExn{
+    private JS getTemplateRes(JS key) throws JSExn {
         String key_ = JSU.toString(key);
         if (!key_.endsWith(".t")) {
             key = JSU.S(key_ + ".t");
@@ -164,7 +170,6 @@
         return Main.SCHEDULER.getAndTriggerTraps(JSU.unclone(clonee),key);
     }
     
-
     JS getStatic() throws JSExn {
         resolve();
         return static_ != null ? static_.object: null;
@@ -213,8 +218,6 @@
         }
     }
     
-
- 
     public String coerceToString() {
         return description()+"$"+Integer.toHexString(hashCode());
     }

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Surface.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Surface.java     2010-03-26 
06:35:59 UTC (rev 3823)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Surface.java     2010-03-26 
06:43:33 UTC (rev 3824)
@@ -144,7 +144,7 @@
      *  the Java version does not work on Linux
      */
     static protected boolean isLockingKeyOn(int k) throws JSExn {
-        for(int i=0; i<allSurfaces.size(); i++) {
+        for (int i=0; i<allSurfaces.size(); i++) {
             Surface s = (Surface)allSurfaces.elementAt(i);
             if (Box.testDisplay(s.root)) {
                 try {

Modified: trunk/core/org.vexi.core/src/org/vexi/core/VML.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/VML.java 2010-03-26 06:35:59 UTC 
(rev 3823)
+++ trunk/core/org.vexi.core/src/org/vexi/core/VML.java 2010-03-26 06:43:33 UTC 
(rev 3824)
@@ -12,7 +12,7 @@
 import org.ibex.util.Tree;
 import org.vexi.core.VML.Static.Template;
 
-public class VML implements Constants{
+public class VML implements Constants {
 
     static class Static extends CodeBlock implements Backtraceable{
         final JS vexi;
@@ -86,14 +86,14 @@
 
             // Instance Members 
///////////////////////////////////////////////////////
 
-            String id = null;           ///< the id of this box
-            JS[] keys;                  ///< keys to be "put" to instances of 
this template; elements correspond to those of vals
-            JS[] vals;                  ///< values to be "put" to instances 
of this template; elements correspond to those of keys
+            String id = null;                  ///< the id of this box
+            JS[] keys;                         ///< keys to be "put" to 
instances of this template; elements correspond to those of vals
+            JS[] vals;                         ///< values to be "put" to 
instances of this template; elements correspond to those of keys
             Object script = null;              ///< the script on this node
 
             List children = new ArrayList();   ///< during XML parsing, this 
holds the list of currently-parsed children; null otherwise
-            Object preapply = null;   /// Preapplied template (~linked list) 
in root node only (unless js:apply)
-            Object principal = null;  /// Template to be applied
+            Object preapply = null;            ///< Preapplied template 
(~linked list) in root node only (unless js:apply)
+            Object principal = null;           ///< Template to be applied
             
             JS.Constructor type = null;      
             boolean isBox() {
@@ -140,11 +140,13 @@
             }
             
             private Template preapply(JS[] thisHolder, JS[] args, Object o) 
throws JSExn{
-                if (o==null) return null;
+                if (o==null) {
+                    return null;
+                }
                 Template t;
-                if(o instanceof String){
+                if (o instanceof String){
                     t = 
((Blessing)Vexi.resolveString(vexi,(String)o)).getTemplate();
-                }else {
+                } else {
                     t = (Template)o;
                     if(Main.hotreplace  && t.isTop()){
                         t = 
((Blessing)Vexi.resolveString(vexi,t.getStatic().sourceName)).getTemplate();
@@ -155,12 +157,6 @@
             }
             
             
-
-
-
-
-
-
             private void apply(JS[] thisHolder, JS[] args, 
PerInstantiationScope parentPis) throws JSExn {
                 Main.SCHEDULER.findCurrentInterpreter().enterNonJSCall(this);
                 try {
@@ -218,7 +214,7 @@
                                         val = pis.get(JSU.S(str));
                                     } else {
                                         String[] ab = str.split("\\.",2);
-                                        val = (JS) 
uriPrefixes.get(JSU.S(ab[0]), true);
+                                        val = 
(JS)uriPrefixes.get(JSU.S(ab[0]), true);
                                         while (ab.length==2 && val!=null) {
                                             ab = ab[1].split("\\.",2);
                                             val = 
Main.SCHEDULER.getAndTriggerTraps(val,JSU.S(ab[0]));
@@ -293,7 +289,7 @@
                 }
                 // JS:FIXME: ugly
                 void sput(JS key, JS val) throws JSExn { 
-                    if(subComponents==null){ 
+                    if (subComponents==null) { 
                         subComponents = new JS.Obj();
                         box.put(SC_subComponents, subComponents);
                     }
@@ -315,7 +311,7 @@
                         // FEATURE store null placeholder here if uri prefix 
doesn't
                         // exist and cache values using super.put to save one 
hash lookup
                         //  2.return prefix
-                        r= (JS) uriPrefixes.get(key, true);
+                        r = (JS)uriPrefixes.get(key, true);
                         if (r!=null) {
                             return r;
                         }
@@ -346,7 +342,7 @@
                 public void addTrap(JS key, JS f) throws JSExn { 
box.addTrap(key,f); }
                 public void delTrap(JS key, JS f) throws JSExn { 
box.delTrap(key,f); }
                 public Trap getTrap(JS key) { return box.getTrap(key); }
-                public String toString(){ return "PIS of " + 
Template.this.toString(); }
+                public String toString() { return "PIS of " + 
Template.this.toString(); }
                 
             }
             

Modified: trunk/core/org.vexi.core/src/org/vexi/plat/AWT.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/plat/AWT.java 2010-03-26 06:35:59 UTC 
(rev 3823)
+++ trunk/core/org.vexi.core/src/org/vexi/plat/AWT.java 2010-03-26 06:43:33 UTC 
(rev 3824)
@@ -72,7 +72,7 @@
 
     protected void postInit() {
         Log.system.diag(Platform.class, "               color depth = " +
-                            
Toolkit.getDefaultToolkit().getColorModel().getPixelSize() + "bpp");
+                Toolkit.getDefaultToolkit().getColorModel().getPixelSize() + 
"bpp");
     }
     
     
@@ -88,7 +88,7 @@
     }
 
     protected void _criticalAbort(String message) {
-       Log.system.error(this, message);
+        Log.system.error(this, message);
         final Dialog d = new Dialog(new Frame(), "Vexi Cannot Continue");
         d.setLayout(new BorderLayout());
         TextArea ta = new TextArea("Vexi cannot continue because:\n\n" + 
message, 10, 80);
@@ -217,7 +217,9 @@
                 i = Toolkit.getDefaultToolkit().createImage(mis);
                 MediaTracker mediatracker = new MediaTracker(new Canvas());
                 mediatracker.addImage(i, 1);
-                try { mediatracker.waitForAll(); } catch (InterruptedException 
e) { }
+                try {
+                    mediatracker.waitForAll();
+                } catch (InterruptedException e) { }
                 mediatracker.removeImage(i);
                 synchronized(AWTPixelBuffer.class) { 
                     if (AWTPixelBuffer.component == null) {
@@ -248,7 +250,9 @@
             i = Toolkit.getDefaultToolkit().createImage(mis);
             MediaTracker mediatracker = new MediaTracker(new Canvas());
             mediatracker.addImage(i, 1);
-            try { mediatracker.waitForAll(); } catch (InterruptedException e) 
{ }
+            try {
+                mediatracker.waitForAll();
+            } catch (InterruptedException e) { }
             mediatracker.removeImage(i);
             synchronized(AWTPixelBuffer.class) { 
                 if (AWTPixelBuffer.component == null) {
@@ -410,11 +414,11 @@
             window.setSize(width + (leftInset + rightInset), height + 
(topInset + bottomInset));
         }
         protected void _setMinimized(boolean b) {
-               Log.warn(this, "JDK 1.1 platforms cannot minimize or unminimize 
windows");
+            Log.warn(this, "JDK 1.1 platforms cannot minimize or unminimize 
windows");
         }
         protected void _setMaximized(boolean b) {
             if (!b) {
-               Log.warn(this, "JDK 1.1 platforms cannot unmaximize windows");
+                Log.warn(this, "JDK 1.1 platforms cannot unmaximize windows");
                 return;
             }
             window.setLocation(new Point(0, 0));
@@ -464,7 +468,9 @@
         }
 
         class InnerWindow extends Window {
-            public InnerWindow() throws 
java.lang.UnsupportedOperationException { super(new Frame()); }
+            public InnerWindow() throws 
java.lang.UnsupportedOperationException {
+                super(new Frame());
+            }
             /** overrides the native Window method to enforce a minimum size */
             private Dimension minimumSize = new Dimension(0, 0);
             public void setMinimumDimensions(int w, int h) { minimumSize = new 
Dimension(w, h); }
@@ -553,7 +559,7 @@
 
             // this is here to catch HeadlessException on jdk1.4
             } catch (java.lang.UnsupportedOperationException e) {
-               Log.system.error(this, "Exception thrown creating Surface 
"+(framed?"frame":"window"));
+                Log.system.error(this, "Exception thrown creating Surface 
"+(framed?"frame":"window"));
                 Log.system.error(this, e);
             }
             
@@ -650,15 +656,24 @@
             // an old (dirty) copy of that buffer part gets painted
             // REMARK - synchronized so we won't fill during render
             synchronized(this) {
+                discoverInsets();
                 AWTPixelBuffer buf = (AWTPixelBuffer)backbuffer;
                 buf.g.setColor(new java.awt.Color((root.fillcolor >> 16) & 
0xff,
                         (root.fillcolor >> 8) & 0xff,
                         (root.fillcolor) & 0xff));
                 if (pendingWidth < newwidth) {
+                    //  ______
+                    // |    | |
+                    // |    | |
+                    // '----'-'
                     buf.g.fillRect(pendingWidth, 0, newwidth, newheight);
                     dirty(pendingWidth, 0, newwidth, newheight);
                 }
                 if (pendingHeight < newheight) {
+                    //  ______
+                    // |      |
+                    // |______|
+                    // '------'
                     buf.g.fillRect(0, pendingHeight, newwidth, newheight);
                     dirty(0, pendingHeight, newwidth, newheight);
                 }
@@ -803,7 +818,9 @@
             Image i = 
Toolkit.getDefaultToolkit().createImage(IOUtil.toByteArray(is));
             MediaTracker mediatracker = new MediaTracker(new Canvas());
             mediatracker.addImage(i, 1);
-            try { mediatracker.waitForAll(); } catch (InterruptedException e) 
{ }
+            try {
+                mediatracker.waitForAll();
+            } catch (InterruptedException e) { }
             mediatracker.removeImage(i);
             final int width = i.getWidth(null);
             final int height = i.getHeight(null);
@@ -817,8 +834,8 @@
             p.height = height;
             p.data = data;
         } catch (Exception e) {
-               Log.system.warn(this, "Exception caught while decoding JPEG 
image");
-               Log.system.warn(this, e);
+            Log.system.warn(this, "Exception caught while decoding JPEG 
image");
+            Log.system.warn(this, e);
         }
     }
 }

Modified: trunk/core/org.vexi.core/src/org/vexi/plat/JVM.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/plat/JVM.java 2010-03-26 06:35:59 UTC 
(rev 3823)
+++ trunk/core/org.vexi.core/src/org/vexi/plat/JVM.java 2010-03-26 06:43:33 UTC 
(rev 3824)
@@ -25,11 +25,16 @@
                 //assume Unix or Linux
                 String[] browsers = { "firefox", "opera", "konqueror", 
"epiphany", "mozilla", "netscape" };
                 String browser = null;
-                for (int count = 0; count < browsers.length && browser == 
null; count++)
-                    if (Runtime.getRuntime().exec( new String[] {"which", 
browsers[count]}).waitFor() == 0)
+                for (int count = 0; count < browsers.length && browser == 
null; count++) {
+                    if (Runtime.getRuntime().exec( new String[] {"which", 
browsers[count]}).waitFor() == 0) {
                         browser = browsers[count];
-                if (browser == null) throw new Exception("Could not find web 
browser");
-                else Runtime.getRuntime().exec(new String[] {browser, url});
+                    }
+                }
+                if (browser == null) {
+                    throw new Exception("Could not find web browser");
+                } else {
+                    Runtime.getRuntime().exec(new String[] {browser, url});
+                }
             }
         } catch (Exception e) {
             throw new JSExn("Error opening browser:\n" + 
e.getLocalizedMessage());

Modified: trunk/core/org.vexi.core/src/org/vexi/plat/Java2.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/plat/Java2.java       2010-03-26 
06:35:59 UTC (rev 3823)
+++ trunk/core/org.vexi.core/src/org/vexi/plat/Java2.java       2010-03-26 
06:43:33 UTC (rev 3824)
@@ -42,32 +42,32 @@
 
 /** Platform class for most reasonable Java1.2+ Java2s */
 public class Java2 extends AWT {
-       {
-               Platform.systemfonts = new JS.Immutable() {
-                       File dir = null;
-                       {
-                               String osname = System.getProperty("os.name");
-                               Log.info(Java2.class, osname);
-                               if(osname.indexOf("Windows")!=-1){
-                                       dir = new File("c:/Windows/Fonts");
-                               }
-                       }
-                       public JS get(JS key) throws JSExn {
-                               if(dir!=null){
-                                       String s = JSU.toString(key);
-                                       File f = new File(dir, s + ".ttf");
-                                       if(f.exists()){
-                                               return new 
Fountain.File(f.getPath());
-                                       }
-                                       f = new File(dir, s + ".ttc");
-                                       if(f.exists()){
-                                               return new 
Fountain.File(f.getPath());
-                                       }
-                               }
-                               return super.get(key);
-                       }
-               };
-       }
+    {
+        Platform.systemfonts = new JS.Immutable() {
+            File dir = null;
+            {
+                String osname = System.getProperty("os.name");
+                Log.info(Java2.class, osname);
+                if (osname.indexOf("Windows")!=-1) {
+                    dir = new File("c:/Windows/Fonts");
+                }
+            }
+            public JS get(JS key) throws JSExn {
+                if (dir!=null) {
+                    String s = JSU.toString(key);
+                    File f = new File(dir, s + ".ttf");
+                    if (f.exists()) {
+                        return new Fountain.File(f.getPath());
+                    }
+                    f = new File(dir, s + ".ttc");
+                    if (f.exists()) {
+                        return new Fountain.File(f.getPath());
+                    }
+                }
+                return super.get(key);
+            }
+        };
+    }
 
     private boolean isJava14 = false;
 
@@ -75,7 +75,9 @@
         // disable the focus manager so we can intercept the tab key
         String versionString = System.getProperty("java.version", "");
         int secondDecimal = versionString.substring(versionString.indexOf('.') 
+ 1).indexOf('.');
-        if (secondDecimal != -1) versionString = versionString.substring(0, 
versionString.indexOf('.') + 1 + secondDecimal);
+        if (secondDecimal != -1) {
+            versionString = versionString.substring(0, 
versionString.indexOf('.') + 1 + secondDecimal);
+        }
         double version = Double.parseDouble(versionString);
         if (version >= 1.4) {
             isJava14 = true;
@@ -106,7 +108,7 @@
                             Constructor ctor = 
java14SurfaceClass.getConstructor(new Class[] { Box.class, Boolean.TYPE });
                             return ctor.newInstance(new Object[] { root, 
Boolean.valueOf(framed) });
                         } catch (Exception e) {
-                               Log.system.error(this, e);
+                            Log.system.error(this, e);
                             throw new LinkageError("error: " + e);
                         }
                     }
@@ -127,14 +129,21 @@
         public Java2Surface(Box root, boolean framed) { super(root, framed); }
 
         protected void _setMinimized(boolean b) {
-            if (frame == null) Log.info(this, "JDK 1.2 can only minimize 
frames, not windows");
-            else if (b) frame.setState(java.awt.Frame.ICONIFIED);
-            else frame.setState(java.awt.Frame.NORMAL);
+            if (frame == null) {
+                Log.info(this, "JDK 1.2 can only minimize frames, not 
windows");
+            } else if (b) {
+                frame.setState(java.awt.Frame.ICONIFIED);
+            } else {
+                frame.setState(java.awt.Frame.NORMAL);
+            }
         }
 
         public void syncCursor() {
-            if (cursor.equals("invisible")) window.setCursor(invisibleCursor);
-            else super.syncCursor();
+            if (cursor.equals("invisible")) {
+                window.setCursor(invisibleCursor);
+            } else {
+                super.syncCursor();
+            }
         }
     }
 
@@ -145,11 +154,11 @@
             // Is this dead code? TODO - verify that 
             // (!framed && window instance Frame) can ever be true
             try {
-               if (!framed && window instanceof Frame) {
-                       ((Frame)window).setUndecorated(true);
-               }
+                if (!framed && window instanceof Frame) {
+                    ((Frame)window).setUndecorated(true);
+                }
             } catch(Exception e){
-               Log.system.warn(Java2.class, e);
+                Log.system.warn(Java2.class, e);
             }
             window.addWindowStateListener(this);
             window.addMouseWheelListener(this);
@@ -173,15 +182,18 @@
         }
         public void windowStateChanged(WindowEvent e) {
             if (e.getOldState() != e.getNewState()) {
-                if ((e.getNewState() & Frame.MAXIMIZED_BOTH) != 0) 
Maximized(true);
-                else if (((e.getOldState() & Frame.MAXIMIZED_BOTH) != 0) && 
(e.getNewState() & Frame.MAXIMIZED_BOTH) == 0)
+                if ((e.getNewState() & Frame.MAXIMIZED_BOTH) != 0) {
+                    Maximized(true);
+                } else if (((e.getOldState() & Frame.MAXIMIZED_BOTH) != 0) && 
(e.getNewState() & Frame.MAXIMIZED_BOTH) == 0) {
                     Maximized(false);
+                }
             }
         }
 
         public void mouseWheelMoved(MouseWheelEvent m) {
-            if (m.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL)
+            if (m.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
                 VScroll(m.getUnitsToScroll());
+            }
         }
     }
     
@@ -210,7 +222,9 @@
         private DataBuffer buf = null;
 
         public void drawGlyph(org.vexi.graphics.Font.Glyph glyph, int dx, int 
dy, int cx1, int cy1, int cx2, int cy2, int argb) {
-            if (glyph.width == 0 || glyph.height == 0) return;
+            if (glyph.width == 0 || glyph.height == 0) {
+                return;
+            }
             int w = cx2 - cx1;
             int h = cy2 - cy1;
             BufferedImage g = ((Java2Glyph)glyph).getBufferedImage();

Modified: trunk/core/org.vexi.core/src/org/vexi/plat/Platform.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/plat/Platform.java    2010-03-26 
06:35:59 UTC (rev 3823)
+++ trunk/core/org.vexi.core/src/org/vexi/plat/Platform.java    2010-03-26 
06:43:33 UTC (rev 3824)
@@ -30,16 +30,16 @@
  *  it in the org.vexi.plat package, and add code to this file's static
  *  block to detect the new platform.
  */
-public abstract class Platform implements Constants{
-       public static JS systemfonts = null;
-       
+public abstract class Platform implements Constants {
+    public static JS systemfonts = null;
+    
     public Platform() { platform = this; }
 
     // Static Data 
/////////////////////////////////////////////////////////////////////////////////////
 
     public static boolean clipboardReadEnabled = false;       ///< true iff 
inside a C-v/A-v/Press3 trap handler
     public static Platform platform = null;                   ///< The 
appropriate Platform object for this JVM
-    public static String build = "unknown";            ///< the current build
+    public static String build = "unknown";                   ///< the current 
build
 
     // VM Detection Logic 
/////////////////////////////////////////////////////////////////////
 
@@ -48,8 +48,8 @@
     // reflection.
 
     public static void forceLoad() {
-       Logger slog = Log.system;
-       Logger ulog = Log.user;
+        Logger slog = Log.system;
+        Logger ulog = Log.user;
         try {
             String vendor = System.getProperty("java.vendor", "");
             String version = System.getProperty("java.version", "");
@@ -59,14 +59,14 @@
             
             boolean hasJOGL = false;
             try {
-               Class.forName("org.vexi.plat.JOGL");
-               hasJOGL = true;
+                Class.forName("org.vexi.plat.JOGL");
+                hasJOGL = true;
             } catch (ClassNotFoundException cnfe) {
-               hasJOGL = false;
+                hasJOGL = false;
             }
             if (hasJOGL) {
                 // OpenGL is cross-platform and as such must be detected first
-               platform_class = "JOGL";
+                platform_class = "JOGL";
             } else if (vendor.startsWith("Free Software Foundation")) {
                 // compiled natively with GCJ
                 if (os_name.startsWith("Window")) {
@@ -87,14 +87,14 @@
             }
 
             if (platform_class == null) {
-               ulog.error(Platform.class, "Unable to detect JVM");
+                ulog.error(Platform.class, "Unable to detect JVM");
                 criticalAbort("Unable to detect JVM");
             }
             
             if (slog.isInfo()) {
                 slog.info(Platform.class, "Detecting JVM..." + os_name + " ==> 
org.vexi.plat." + platform_class);
             }
-                               
+                
             try {
                 if (platform_class != null) {
                     Class.forName("org.vexi.plat." + 
platform_class).newInstance();
@@ -110,7 +110,7 @@
                 build = 
(String)Class.forName("org.ibex.Build").getField("build").get(null);
                 ulog.info(Platform.class, "Vexi build: " + build);
             } catch (ClassNotFoundException cnfe) {
-               ulog.info(Platform.class, "Vexi build: unknown");
+                ulog.info(Platform.class, "Vexi build: unknown");
             } catch (Exception e) {
                 slog.warn(Platform.class, "exception while detecting build:");
                 slog.warn(Platform.class, e);
@@ -169,8 +169,8 @@
     /** used to notify the user of very serious failures; usually used when 
logging is not working or unavailable */
     protected void _criticalAbort(String message) { System.exit(-1); }
     public static void criticalAbort(String message) {
-       Log.system.error(Platform.class, "Critical Abort:");
-       Log.system.error(Platform.class, message);
+        Log.system.error(Platform.class, "Critical Abort:");
+        Log.system.error(Platform.class, message);
         platform._criticalAbort(message);
     }
 
@@ -215,8 +215,8 @@
                 }
             }
         } catch (Exception e) {
-               Log.system.info(this, "Exception while reading from 
environment:");
-               Log.system.info(this, e);
+            Log.system.info(this, "Exception while reading from environment:");
+            Log.system.info(this, e);
         }
         return null;
     }
@@ -258,47 +258,47 @@
     public static Scheduler newScheduler() { return platform._newScheduler(); }
     
     static public class Scheduler extends org.ibex.js.Scheduler {
-       public Scheduler() { this(false); }
-       public Scheduler(boolean quitOnExn) { super(Log.user, quitOnExn); }
-       
-       //DEBUG//protected void check(Callable t) { }
-       
-       private static volatile boolean rendering = false;
-       private static volatile boolean again = false;
+        public Scheduler() { this(false); }
+        public Scheduler(boolean quitOnExn) { super(Log.user, quitOnExn); }
+        
+        //DEBUG//protected void check(Callable t) { }
+        
+        private static volatile boolean rendering = false;
+        private static volatile boolean again = false;
 
-       /**
-        * This indirectly invokes reflow, which always preempts any render()
-        * call.  Without it, any boxes [in a surface tree] that are marked
-        * for reflow but not yet dirtied [because any visual adjustments are
-        * dependent on the mechanisms of reflow] will not get updated until
-        * another event causes the box tree surface to queue render() again.
-        */
-       public void renderAll() {
-               if (rendering) {
-                   again = true;
-                   return;
-               }
-               synchronized (Scheduler.class) {
-                       try {
-                               rendering = true;
-                               do {
-                                       // FEATURE: this could be cleaner
-                                       again = false;
-                                       for (int i=0; 
i<Surface.allSurfaces.size(); i++) {
-                                               Surface s = 
((Surface)Surface.allSurfaces.elementAt(i));
-                                               do { s.render(); }
-                                               while (s.renderAborted());
-                                       }
-                               } while (again);
-                       } finally {
-                               rendering = false;
-                       }
-               }
-       }
-       
-       protected boolean isFinished() {
-               return super.isFinished() && Surface.allSurfaces.size()==0;
-       }
+        /**
+         * This indirectly invokes reflow, which always preempts any render()
+         * call.  Without it, any boxes [in a surface tree] that are marked
+         * for reflow but not yet dirtied [because any visual adjustments are
+         * dependent on the mechanisms of reflow] will not get updated until
+         * another event causes the box tree surface to queue render() again.
+         */
+        public void renderAll() {
+            if (rendering) {
+                again = true;
+                return;
+            }
+            synchronized (Scheduler.class) {
+                try {
+                    rendering = true;
+                    do {
+                        // FEATURE: this could be cleaner
+                        again = false;
+                        for (int i=0; i<Surface.allSurfaces.size(); i++) {
+                            Surface s = 
((Surface)Surface.allSurfaces.elementAt(i));
+                            do { s.render(); }
+                            while (s.renderAborted());
+                        }
+                    } while (again);
+                } finally {
+                    rendering = false;
+                }
+            }
+        }
+        
+        protected boolean isFinished() {
+            return super.isFinished() && Surface.allSurfaces.size()==0;
+        }
     }
     
 
@@ -345,11 +345,11 @@
                         cacheDir = null;
                     }
                 } catch (Exception e) {
-                       Log.system.warn(LocalStorage.class, "unable to create 
cache directory " +
+                    Log.system.warn(LocalStorage.class, "unable to create 
cache directory " +
                              vexiDirName + File.separatorChar + "cache");
                 }
             } catch (Exception e) {
-               Log.system.warn(LocalStorage.class, "unable to create ibex 
directory " + vexiDirName);
+                Log.system.warn(LocalStorage.class, "unable to create ibex 
directory " + vexiDirName);
             }
         }
 


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

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to