From: hansonr Date: Fri, 11 Jan 2019 04:49:20 +0000 (-0600) Subject: (commented out but potentially useful) methods to tap Java release X-Git-Tag: Release_2_11_4_0~45^2~18^2~322 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=15a0e4b34d301c187569de8cb429d5d380bdaf0f;p=jalview.git (commented out but potentially useful) methods to tap Java release logging options -- used for tracing events --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 37f396e..807105a 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -60,6 +60,9 @@ import java.security.Policy; import java.util.HashMap; import java.util.Map; import java.util.Vector; +import java.util.logging.ConsoleHandler; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.LookAndFeel; import javax.swing.UIManager; @@ -204,10 +207,40 @@ public class Jalview */ public static void main(String[] args) { +// setLogging(); // BH - for event debugging in JavaScript instance = new Jalview(); instance.doMain(args); } + private static void logClass(String name) + { + // BH - for event debugging in JavaScript + ConsoleHandler consoleHandler = new ConsoleHandler(); + consoleHandler.setLevel(Level.ALL); + Logger logger = Logger.getLogger(name); + logger.setLevel(Level.ALL); + logger.addHandler(consoleHandler); + } + + @SuppressWarnings("unused") + private static void setLogging() + { + // BH - for event debugging in JavaScript (Java mode only) + if (!(/** @j2sNative true ||*/false)) + { + Logger.getLogger("").setLevel(Level.ALL); + logClass("java.awt.EventDispatchThread"); + logClass("java.awt.EventQueue"); + logClass("java.awt.Component"); + logClass("java.awt.focus.Component"); + logClass("java.awt.focus.DefaultKeyboardFocusManager"); + } + + } + + + + /** * @param args */ @@ -364,7 +397,16 @@ public class Jalview if (!headless) { - desktop = new Desktop(); + desktop = new Desktop() +// { +// // BH testing +// @Override +// protected void processEvent(AWTEvent e) { +// System.out.println("Jalview.java " + e); +// super.processEvent(e); +// } +// } + ; desktop.setInBatchMode(true); // indicate we are starting up desktop.setVisible(true); diff --git a/src/jalview/project/Jalview2XML.java b/src/jalview/project/Jalview2XML.java index fae9e8c..646cab5 100644 --- a/src/jalview/project/Jalview2XML.java +++ b/src/jalview/project/Jalview2XML.java @@ -4602,7 +4602,18 @@ public class Jalview2XML { AlignFrame af = null; af = new AlignFrame(al, safeInt(view.getWidth()), - safeInt(view.getHeight()), uniqueSeqSetId, viewId); + safeInt(view.getHeight()), uniqueSeqSetId, viewId) +// { +// +// @Override +// protected void processKeyEvent(java.awt.event.KeyEvent e) { +// System.out.println("Jalview2XML AF " + e); +// super.processKeyEvent(e); +// +// } +// +// } + ; af.setFileName(file, FileFormat.Jalview);