2003/06/16 08:03:16
[org.ibex.core.git] / src / org / xwt / plat / Java2.java
index 1b54053..9b413ff 100644 (file)
@@ -18,26 +18,26 @@ public class Java2 extends AWT {
 
     private boolean isJava14 = false;
     protected boolean _supressDirtyOnResize() {
-       return (isJava14 && !System.getProperty("os.name", "").equals("Mac OS X"))? false : true;
+        return (isJava14 && !System.getProperty("os.name", "").equals("Mac OS X"))? false : true;
     }
 
     public Java2() {
         // 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, secondDecimal);
-       double version = Double.parseDouble(versionString);
-       if (version >= 1.4) {
-           isJava14 = true;
-           try {
-               Toolkit t = java.awt.Toolkit.getDefaultToolkit();
-               Method m = java.awt.Toolkit.class.getMethod("setDynamicLayout", new Class[] { Boolean.class });
-               m.invoke(t, new Object[] { Boolean.TRUE });
-           } catch (Exception e) {
-               Log.log(this, "Exception while trying to enable AWT Dynamic Layout");
-               Log.log(this, e);
-           }
-       }
+        String versionString = System.getProperty("java.version", "");
+        int secondDecimal = versionString.substring(versionString.indexOf('.') + 1).indexOf('.');
+        if (secondDecimal != -1) versionString = versionString.substring(0, secondDecimal);
+        double version = Double.parseDouble(versionString);
+        if (version >= 1.4) {
+            isJava14 = true;
+            try {
+                Toolkit t = java.awt.Toolkit.getDefaultToolkit();
+                Method m = java.awt.Toolkit.class.getMethod("setDynamicLayout", new Class[] { Boolean.class });
+                m.invoke(t, new Object[] { Boolean.TRUE });
+            } catch (Exception e) {
+                Log.log(this, "Exception while trying to enable AWT Dynamic Layout");
+                Log.log(this, e);
+            }
+        }
         javax.swing.FocusManager.setCurrentManager(new javax.swing.FocusManager() {
                 public void processKeyEvent(Component focusedComponent, KeyEvent anEvent) { }
                 public void focusPreviousComponent(Component aComponent) { }
@@ -107,20 +107,20 @@ public class Java2 extends AWT {
     protected Surface _createSurface(final Box root, final boolean framed) {
         return (Surface)java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
                 public Object run() {
-                   if (isJava14) {
-                       try {
-                            // weaken the binding here to avoid link errors on 1.3.x
-                            Class java14SurfaceClass = Class.forName(Java2.class.getName() + "$Java14Surface");
-                            Constructor ctor = java14SurfaceClass.getConstructor(new Class[] { Box.class, Boolean.TYPE });
-                            return (Surface)ctor.newInstance(new Object[] { root, new Boolean(framed) });
-                       } catch (Exception e) {
-                           Log.log(this, e);
-                           throw new LinkageError("error: " + e);
-                       }
-                   } else {
-                       return new Java2Surface(root, framed);
-                   }
-               }
+                    if (isJava14) {
+                        try {
+                             // weaken the binding here to avoid link errors on 1.3.x
+                             Class java14SurfaceClass = Class.forName(Java2.class.getName() + "$Java14Surface");
+                             Constructor ctor = java14SurfaceClass.getConstructor(new Class[] { Box.class, Boolean.TYPE });
+                             return (Surface)ctor.newInstance(new Object[] { root, new Boolean(framed) });
+                        } catch (Exception e) {
+                            Log.log(this, e);
+                            throw new LinkageError("error: " + e);
+                        }
+                    } else {
+                        return new Java2Surface(root, framed);
+                    }
+                }
             });
     }
 
@@ -282,8 +282,8 @@ public class Java2 extends AWT {
     protected String getDescriptiveName() { return isJava14 ? "Java 1.4+ JVM" : "Java 1.2+ JVM"; }
 
     protected void _newBrowserWindow(String url) {
-       /*
-         FIXME
+        /*
+          FIXME
         if (Main.applet == null) {
             if (Log.on) Log.log(this, "Main.applet is null; cannot invoke showDocument()");
             return;
@@ -294,7 +294,7 @@ public class Java2 extends AWT {
         } catch (MalformedURLException e) {
             if (Log.on) Log.log(this, e);
         }
-       */
+        */
     }
 
 }