gcjwebplugin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcjwebplugin-devel] Patch: FYI: do not override doLayout and other fixe


From: Thomas Fitzsimmons
Subject: [Gcjwebplugin-devel] Patch: FYI: do not override doLayout and other fixes
Date: Wed, 05 Apr 2006 15:51:16 -0400

Hi,

This patch fixes some issues reported by Lillian Angel.  doLayout could
be called on PluginAppletWindow before the applet was added to it, which
caused NullPointerExceptions to be thrown.  I removed the doLayout
override since it is unnecessary.  I also removed our manipulation of
System.out which was interfering with debugging.  Along with this change
I removed support for the special stdin and stdout arguments to the
--plugin option, since we can't both print informational output and
communicate with the plugin on the same pipe.

Tom

2006-04-05  Thomas Fitzsimmons  <address@hidden>

        * Makefile.am (TESTFILES_A): Remove tests/t_cmdlineplugin.at.
        * testsuite.at: Likewise.
        * tests/t_cmdlineplugin.at: Remove file.
        * src/gnu/gcjwebplugin/AppletViewer.java: Remove support for stdin
        and stdout arguments to --plugin option.
        * src/gnu/gcjwebplugin/PluginAppletViewer.java: Do not redirect
        stdin and stdout to console window.
        * src/gnu/gcjwebplugin/PluginAppletWindow.java (doLayout): Remove
        method.

Index: Makefile.am
===================================================================
RCS file: /cvsroot/gcjwebplugin/gcjwebplugin/Makefile.am,v
retrieving revision 1.19
diff -u -r1.19 Makefile.am
--- Makefile.am 28 Mar 2006 11:27:55 -0000      1.19
+++ Makefile.am 5 Apr 2006 19:38:32 -0000
@@ -9,7 +9,6 @@
        tests/t_cmdlinecodebase.at \
        tests/t_cmdlinehelp.at \
        tests/t_cmdlineparam.at \
-       tests/t_cmdlineplugin.at \
        tests/t_cmdlinewidthheight.at \
        tests/t_dimensionsnooverrideclass.at \
        tests/t_dimensionsnooverridecode.at \
Index: testsuite.at
===================================================================
RCS file: /cvsroot/gcjwebplugin/gcjwebplugin/testsuite.at,v
retrieving revision 1.13
diff -u -r1.13 testsuite.at
--- testsuite.at        12 Feb 2006 18:09:24 -0000      1.13
+++ testsuite.at        5 Apr 2006 19:38:32 -0000
@@ -21,7 +21,6 @@
 m4_include(tests/t_cmdlinearchive.at)
 m4_include(tests/t_cmdlineparam.at)
 m4_include(tests/t_cmdlinewidthheight.at)
-m4_include(tests/t_cmdlineplugin.at)
 m4_include(tests/t_dimensionsoverride.at)
 m4_include(tests/t_dimensionsnooverrideclass.at)
 m4_include(tests/t_dimensionsnooverridecode.at)
Index: src/gnu/gcjwebplugin/AppletViewer.java
===================================================================
RCS file: 
/cvsroot/gcjwebplugin/gcjwebplugin/src/gnu/gcjwebplugin/AppletViewer.java,v
retrieving revision 1.41
diff -u -r1.41 AppletViewer.java
--- src/gnu/gcjwebplugin/AppletViewer.java      11 Feb 2006 18:06:56 -0000      
1.41
+++ src/gnu/gcjwebplugin/AppletViewer.java      5 Apr 2006 19:38:32 -0000
@@ -274,15 +274,8 @@
        InputStream in;
        OutputStream out;
 
-       if (pipeInName.equals("stdin"))
-         in = System.in;
-       else
-         in = new FileInputStream(pipeInName);
-
-       if (pipeOutName.equals("stdout"))
-         out = System.out;
-       else
-         out = new FileOutputStream(pipeOutName);
+        in = new FileInputStream(pipeInName);
+        out = new FileOutputStream(pipeOutName);
 
        PluginAppletViewer.start(in, out);
       }
Index: src/gnu/gcjwebplugin/PluginAppletViewer.java
===================================================================
RCS file: 
/cvsroot/gcjwebplugin/gcjwebplugin/src/gnu/gcjwebplugin/PluginAppletViewer.java,v
retrieving revision 1.23
diff -u -r1.23 PluginAppletViewer.java
--- src/gnu/gcjwebplugin/PluginAppletViewer.java        30 Mar 2006 04:39:46 
-0000      1.23
+++ src/gnu/gcjwebplugin/PluginAppletViewer.java        5 Apr 2006 19:38:32 
-0000
@@ -43,23 +43,8 @@
   // A mapping of instance IDs to PluginAppletWindows.
   static HashMap appletWindows = new HashMap ();
 
-  private static ConsoleDialog consoleDialog;
-  
   private static BufferedReader pluginInputStream;
   private static BufferedWriter pluginOutputStream;
-  private static PrintStream stdOut;
-  private static PrintStream stdErr;
-
-  static
-  {
-    // FIXME: Shouldn't we do lazy instantiation here ?
-    consoleDialog = new ConsoleDialog();
-
-    stdOut = System.out;
-    System.setOut(consoleDialog.getPrintStream());
-    stdErr = System.err;
-    System.setErr(consoleDialog.getPrintStream());
-  }
 
   static void start(InputStream inputStream, OutputStream outputStream)
     throws MalformedURLException, IOException
@@ -90,10 +75,6 @@
              appletWindows.put(key, new PluginAppletWindow());
 
            currentWindow = (PluginAppletWindow) appletWindows.get(key);
-
-           // Show Java console
-           if (UserConfiguration.showJavaConsole())
-             consoleDialog.show();
          }
        else if (message.startsWith("tag"))
          {
@@ -145,7 +126,7 @@
     pluginOutputStream.newLine();
     pluginOutputStream.flush();
 
-    stdOut.println("  PIPE: applet viewer wrote: " + message);
+    System.out.println("  PIPE: applet viewer wrote: " + message);
   }
 
   /**
@@ -159,7 +140,7 @@
   {
     String message = pluginInputStream.readLine();
 
-    stdOut.println("  PIPE: applet viewer read: " + message);
+    System.out.println("  PIPE: applet viewer read: " + message);
 
     if (message == null || message.equals("shutdown"))
       {
Index: src/gnu/gcjwebplugin/PluginAppletWindow.java
===================================================================
RCS file: 
/cvsroot/gcjwebplugin/gcjwebplugin/src/gnu/gcjwebplugin/PluginAppletWindow.java,v
retrieving revision 1.21
diff -u -r1.21 PluginAppletWindow.java
--- src/gnu/gcjwebplugin/PluginAppletWindow.java        22 Feb 2006 21:13:45 
-0000      1.21
+++ src/gnu/gcjwebplugin/PluginAppletWindow.java        5 Apr 2006 19:38:32 
-0000
@@ -111,28 +111,4 @@
     applet.validate();
     applet.repaint();
   }
-
-  /////////////////////////////
-  ////// Component Method /////
-  /////////////////////////////
-
-  /**
-   * Prompts the layout manager to lay out this component. This is usually
-   * called when the component (more specifically, container) is validated.
-   *
-   * (description copied from java.awt.Component.doLayout())
-   */
-  public void doLayout()
-  {
-    super.doLayout();
-
-    // Assume the applet to be our only child and give it all the
-    // space we have.
-    Component c = this.getComponent(0);
-    if (c != null)
-      {
-       Dimension cs = getSize();
-       c.setBounds(0, 0, cs.width, cs.height);
-      }
-  }
 }
Index: tests/t_cmdlineplugin.at
===================================================================
RCS file: tests/t_cmdlineplugin.at
diff -N tests/t_cmdlineplugin.at
--- tests/t_cmdlineplugin.at    12 Feb 2006 17:40:05 -0000      1.7
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,10 +0,0 @@
-AT_SETUP([parsing the plugin command line option])
-
-AT_CHECK(echo shutdown | ../../gcjappletviewer --verbose 
-J-Djava.class.path=../../gcjappletviewer.jar 
-J-Dgnu.gcjwebplugin.test.windowCount=1 --plugin=stdin[,]stdout, [],
-[running
-  PIPE: applet viewer wrote: running
-  PIPE: applet viewer read: shutdown
-],
-[])
-
-AT_CLEANUP

reply via email to

[Prev in Thread] Current Thread [Next in Thread]