Skip to content

Commit 25e2e1e

Browse files
hansonrhansonr
authored andcommitted
adds JSToolkit.checkJ2SFlag and j2sdebugpaint
1 parent ca3e8ba commit 25e2e1e

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

sources/net.sf.j2s.java.core/src/javax/swing/RepaintManager.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import sun.awt.AWTAccessor;
5353
import sun.awt.AppContext;
5454
import sun.awt.SunToolkit;
55+
import swingjs.JSToolkit;
5556

5657
/**
5758
* This class manages repaint requests, allowing the number of repaints to be
@@ -1419,6 +1420,14 @@ private void scheduleProcessingRunnable(Component c) {
14191420

14201421
private void scheduleProcessingRunnable(AppContext context) {
14211422
if (processingRunnable.markPending()) {
1423+
if (JSToolkit.checkJ2SFlag("_debugPaint"))
1424+
System.out.println("RepaintManager"
1425+
+ "\n invalid:" + invalidComponents
1426+
+ "\n dirty:" + dirtyComponents);
1427+
1428+
/**
1429+
* @j2sNative
1430+
*/
14221431
SunToolkit.getSystemEventQueueImplPP(context).postEvent(
14231432
new InvocationEvent(Toolkit.getDefaultToolkit(), InvocationEvent.INVOCATION_DEFAULT, processingRunnable, null, false));
14241433
}

sources/net.sf.j2s.java.core/src/swingjs/JSToolkit.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,4 +996,8 @@ public static boolean isOverWritten(JComponent jc, String method) {
996996
return s.indexOf("java") != 0 && s.indexOf("swingjs") != 0;
997997
}
998998

999+
public static boolean checkJ2SFlag(String flag) {
1000+
return (/** @j2sNative J2S[flag] || */ false);
1001+
}
1002+
9991003
}

sources/net.sf.j2s.java.core/srcjs/js/j2sApplet.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ if (!J2S._version)
127127
var ref = document.location.href.toLowerCase();
128128
j._debugCode = (ref.indexOf("j2sdebugcode") >= 0);
129129
j._debugCore = (ref.indexOf("j2sdebugcore") >= 0);
130+
j._debugPaint = (ref.indexOf("j2sdebugpaint") >= 0);
130131
j._debugName = J2S.getURIField("j2sdebugname", null);
131132
j._lang = J2S.getURIField("j2slang", null);
132133
j._httpProto = (ref.indexOf("https") == 0 ? "https://" : "http://");

0 commit comments

Comments
 (0)