[Picross-commit] SF.net SVN: picross: [44] trunk
Status: Pre-Alpha
Brought to you by:
yvan_norsa
From: <yva...@us...> - 2008-04-16 09:31:03
|
Revision: 44 http://picross.svn.sourceforge.net/picross/?rev=44&view=rev Author: yvan_norsa Date: 2008-04-16 02:31:04 -0700 (Wed, 16 Apr 2008) Log Message: ----------- added debug target Modified Paths: -------------- trunk/build.xml trunk/src/picross/app/PicrossApp.java Added Paths: ----------- trunk/lib/debug.jar Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2008-04-16 09:24:40 UTC (rev 43) +++ trunk/build.xml 2008-04-16 09:31:04 UTC (rev 44) @@ -19,6 +19,8 @@ <property name="bundleHelper.jar" value="${lib.dir}/bundleHelper.jar" /> + <property name="debug.jar" + value="${lib.dir}/debug.jar" /> <property name="junit.jar" value="${lib.dir}/junit.jar" /> <property name="log4j.jar" @@ -109,6 +111,22 @@ </java> </target> + <target name="run-debug" + depends="dist"> + <java classname="picross.app.PicrossApp" + failonerror="true" + fork="true" + dir="."> + <classpath> + <pathelement location="${jar.name}" /> + <pathelement location="${bundleHelper.jar}" /> + <pathelement location="${log4j.jar}" /> + <pathelement location="${mmvcs.jar}" /> + <pathelement location="${debug.jar}" /> + </classpath> + </java> + </target> + <target name="test" depends="dist"> <junit haltonfailure="yes" Added: trunk/lib/debug.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/debug.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/src/picross/app/PicrossApp.java =================================================================== --- trunk/src/picross/app/PicrossApp.java 2008-04-16 09:24:40 UTC (rev 43) +++ trunk/src/picross/app/PicrossApp.java 2008-04-16 09:31:04 UTC (rev 44) @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (c) 2007 + * Copyright (c) 2007-2008 * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, @@ -68,9 +68,50 @@ public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { + PicrossApp.setupDebugging(); new PicrossApp(); } }); } + + /*** Static method ***/ + + /** Tries to load the debugging tools from debug.jar. */ + private static void setupDebugging() { + try { + Class managerClass = Class.forName( + "org.jdesktop.swinghelper.debug.CheckThreadViolationRepaintManager"); + java.lang.reflect.Constructor construct = + managerClass.getConstructor((Class) null); + javax.swing.RepaintManager manag = + (javax.swing.RepaintManager) construct + .newInstance((Class) null); + javax.swing.RepaintManager.setCurrentManager(manag); + } catch (ClassNotFoundException classEx) { + } catch (NoSuchMethodException methodEx) { + methodEx.printStackTrace(); + } catch (InstantiationException instantiationEx) { + instantiationEx.printStackTrace(); + } catch (IllegalAccessException accessEx) { + accessEx.printStackTrace(); + } catch (java.lang.reflect.InvocationTargetException targetEx) { + targetEx.printStackTrace(); + } + + try { + Class monitorClass = Class.forName( + "org.jdesktop.swinghelper.debug.EventDispatchThreadHangMonitor"); + java.lang.reflect.Method method = + monitorClass.getMethod("initMonitoring"); + method.invoke(null); + } catch (ClassNotFoundException classEx) { + } catch (NoSuchMethodException methodEx) { + methodEx.printStackTrace(); + } catch (IllegalAccessException accessEx) { + accessEx.printStackTrace(); + } catch (java.lang.reflect.InvocationTargetException targetEx) { + targetEx.printStackTrace(); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |