JAL-1807 includes ?j2sdebug flag and DebugJS._(msg)
[jalviewjs.git] / bin / jalview / util / AWTConsole.js
diff --git a/bin/jalview/util/AWTConsole.js b/bin/jalview/util/AWTConsole.js
deleted file mode 100644 (file)
index d03b9fa..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-Clazz.declarePackage ("jalview.util");\r
-Clazz.load (["java.awt.event.ActionListener", "$.WindowAdapter", "$.WindowListener", "java.io.PipedInputStream"], "jalview.util.AWTConsole", ["jalview.util.MessageManager", "java.awt.BorderLayout", "$.Button", "$.Dimension", "$.Frame", "$.GraphicsEnvironment", "$.Panel", "$.TextArea", "$.Toolkit", "java.io.PipedOutputStream", "java.lang.NullPointerException", "$.Thread"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.frame = null;\r
-this.textArea = null;\r
-this.reader = null;\r
-this.reader2 = null;\r
-this.quit = false;\r
-this.pin = null;\r
-this.pin2 = null;\r
-this.errorThrower = null;\r
-Clazz.instantialize (this, arguments);\r
-}, jalview.util, "AWTConsole", java.awt.event.WindowAdapter, [java.awt.event.WindowListener, java.awt.event.ActionListener, Runnable]);\r
-Clazz.prepareFields (c$, function () {\r
-this.pin =  new java.io.PipedInputStream ();\r
-this.pin2 =  new java.io.PipedInputStream ();\r
-});\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-Clazz.superConstructor (this, jalview.util.AWTConsole, []);\r
-this.frame =  new java.awt.Frame ("Java Console");\r
-var screenSize = java.awt.Toolkit.getDefaultToolkit ().getScreenSize ();\r
-var frameSize =  new java.awt.Dimension ((Clazz.doubleToInt (screenSize.width / 2)), (Clazz.doubleToInt (screenSize.height / 2)));\r
-var x = (Clazz.doubleToInt (frameSize.width / 2));\r
-var y = (Clazz.doubleToInt (frameSize.height / 2));\r
-this.frame.setBounds (x, y, frameSize.width, frameSize.height);\r
-this.textArea =  new java.awt.TextArea ();\r
-this.textArea.setEditable (false);\r
-var button =  new java.awt.Button ("clear");\r
-var panel =  new java.awt.Panel ();\r
-panel.setLayout ( new java.awt.BorderLayout ());\r
-panel.add (this.textArea, "Center");\r
-panel.add (button, "South");\r
-this.frame.add (panel);\r
-this.frame.setVisible (true);\r
-this.frame.addWindowListener (this);\r
-button.addActionListener (this);\r
-try {\r
-var pout =  new java.io.PipedOutputStream (this.pin);\r
-System.setOut ( new java.io.PrintStream (pout, true));\r
-} catch (e$$) {\r
-if (Clazz.exceptionOf (e$$, java.io.IOException)) {\r
-var io = e$$;\r
-{\r
-this.textArea.append ("Couldn't redirect STDOUT to this console\n" + io.getMessage ());\r
-}\r
-} else if (Clazz.exceptionOf (e$$, SecurityException)) {\r
-var se = e$$;\r
-{\r
-this.textArea.append ("Couldn't redirect STDOUT to this console\n" + se.getMessage ());\r
-}\r
-} else {\r
-throw e$$;\r
-}\r
-}\r
-try {\r
-var pout2 =  new java.io.PipedOutputStream (this.pin2);\r
-System.setErr ( new java.io.PrintStream (pout2, true));\r
-} catch (e$$) {\r
-if (Clazz.exceptionOf (e$$, java.io.IOException)) {\r
-var io = e$$;\r
-{\r
-this.textArea.append ("Couldn't redirect STDERR to this console\n" + io.getMessage ());\r
-}\r
-} else if (Clazz.exceptionOf (e$$, SecurityException)) {\r
-var se = e$$;\r
-{\r
-this.textArea.append ("Couldn't redirect STDERR to this console\n" + se.getMessage ());\r
-}\r
-} else {\r
-throw e$$;\r
-}\r
-}\r
-this.quit = false;\r
-this.reader =  new Thread (this);\r
-this.reader.setDaemon (true);\r
-this.reader.start ();\r
-this.reader2 =  new Thread (this);\r
-this.reader2.setDaemon (true);\r
-this.reader2.start ();\r
-System.out.println ("Hello World 2");\r
-System.out.println ("All fonts available to Graphic2D:\n");\r
-var ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ();\r
-var fontNames = ge.getAvailableFontFamilyNames ();\r
-for (var n = 0; n < fontNames.length; n++) System.out.println (fontNames[n]);\r
-\r
-System.out.println ("\nLets throw an error on this console");\r
-this.errorThrower =  new Thread (this);\r
-this.errorThrower.setDaemon (true);\r
-this.errorThrower.start ();\r
-});\r
-Clazz.overrideMethod (c$, "windowClosed", \r
-function (evt) {\r
-this.quit = true;\r
-this.notifyAll ();\r
-try {\r
-this.reader.join (1000);\r
-this.pin.close ();\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, Exception)) {\r
-} else {\r
-throw e;\r
-}\r
-}\r
-try {\r
-this.reader2.join (1000);\r
-this.pin2.close ();\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, Exception)) {\r
-} else {\r
-throw e;\r
-}\r
-}\r
-System.exit (0);\r
-}, "java.awt.event.WindowEvent");\r
-Clazz.overrideMethod (c$, "windowClosing", \r
-function (evt) {\r
-this.frame.setVisible (false);\r
-this.frame.dispose ();\r
-}, "java.awt.event.WindowEvent");\r
-Clazz.overrideMethod (c$, "actionPerformed", \r
-function (evt) {\r
-this.textArea.setText ("");\r
-}, "java.awt.event.ActionEvent");\r
-Clazz.overrideMethod (c$, "run", \r
-function () {\r
-try {\r
-while (Thread.currentThread () === this.reader) {\r
-try {\r
-this.wait (100);\r
-} catch (ie) {\r
-if (Clazz.exceptionOf (ie, InterruptedException)) {\r
-} else {\r
-throw ie;\r
-}\r
-}\r
-if (this.pin.available () != 0) {\r
-var input = this.readLine (this.pin);\r
-this.textArea.append (input);\r
-}if (this.quit) return;\r
-}\r
-while (Thread.currentThread () === this.reader2) {\r
-try {\r
-this.wait (100);\r
-} catch (ie) {\r
-if (Clazz.exceptionOf (ie, InterruptedException)) {\r
-} else {\r
-throw ie;\r
-}\r
-}\r
-if (this.pin2.available () != 0) {\r
-var input = this.readLine (this.pin2);\r
-this.textArea.append (input);\r
-}if (this.quit) return;\r
-}\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, Exception)) {\r
-this.textArea.append ("\nConsole reports an Internal error.");\r
-this.textArea.append ("The error is: " + e);\r
-} else {\r
-throw e;\r
-}\r
-}\r
-if (Thread.currentThread () === this.errorThrower) {\r
-try {\r
-this.wait (1000);\r
-} catch (ie) {\r
-if (Clazz.exceptionOf (ie, InterruptedException)) {\r
-} else {\r
-throw ie;\r
-}\r
-}\r
-throw  new NullPointerException (jalview.util.MessageManager.getString ("exception.application_test_npe"));\r
-}});\r
-Clazz.defineMethod (c$, "readLine", \r
-function ($in) {\r
-var input = "";\r
-do {\r
-var available = $in.available ();\r
-if (available == 0) break;\r
-var b =  Clazz.newByteArray (available, 0);\r
-$in.read (b);\r
-input = input +  String.instantialize (b, 0, b.length);\r
-} while (!input.endsWith ("\n") && !input.endsWith ("\r\n") && !this.quit);\r
-return input;\r
-}, "java.io.PipedInputStream");\r
-});\r