Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified sources/net.sf.j2s.core/dist/swingjs/SwingJS-site.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20191020181703
20191021071533
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.4/SwingJS-site.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/ver/3.2.4/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20191020181703
20191021071533
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions sources/net.sf.j2s.java.core/src/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public static void yield() {
*/
public static void sleep(long millis) throws InterruptedException {
JSUtil.notImplemented(null);
JSUtil.warn("SwingJS does not implement Thread.sleep(long)");
throw new InterruptedException("SwingJS does not implement Thread.sleep(long)");
}
/**
* Causes the currently executing thread to sleep (cease execution)
Expand Down Expand Up @@ -354,7 +354,7 @@ public static void sleep(long millis, int nanos)
millis++;
}
JSUtil.notImplemented(null);
JSUtil.warn("SwingJS does not implement Thread.sleep(long,int)");
throw new InterruptedException("SwingJS does not implement Thread.sleep(long,int)");
// sleep(millis);
}

Expand Down
23 changes: 9 additions & 14 deletions sources/net.sf.j2s.java.core/src/swingjs/JSAppletViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ public int run1(int mode) {
}
// BH: This should not be necessary.
// It is causing validation to happen twice,
// But actually that is a good thing, because we don't
// But actually that is a good thing, because we don't
// see the flash of incomplete to complete layout.
applet.getRootPane().addNotify();
// force peer creation now
Expand All @@ -472,18 +472,10 @@ public int run1(int mode) {
ok = true;
break;
case APPLET_READY:
applet.getContentPane().setBounds(applet.getBounds()); // added
// 7/13/17;
// applet
// background
// was
// not
// painting
// if
// setContentPane()
// was
// used
applet.setVisible(true);
applet.getContentPane().setBounds(applet.getBounds());
// added 7/13/17; applet background was not painting
// if setContentPane() was used
applet.setVisible(true);
applet.validate(); // one last validation necessary for PolyhedronApplet
showAppletStatus("ready");
JSUtil.readyCallback(appletName, fullName, applet, this);
Expand All @@ -492,7 +484,10 @@ public int run1(int mode) {
if (resizer != null)
resizer.show();
}
JSFocusPeer.setFocusLast(applet);
// NO! JSFocusPeer.setFocusLast(applet);
// 2019.10.21 Problem here is that the page will scroll to the
// applet even if it is down on the page.

applet.秘repaint();
break;
case APPLET_STOP:
Expand Down
4 changes: 0 additions & 4 deletions sources/net.sf.j2s.java.core/src/swingjs/JSToolkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,6 @@ public static JSComponentUI getComponentUI(JComponent target) {
return ui;
}

public static String getSwingDivId() {
return Thread.currentThread().getName() + "_swingdiv";
}

private static int dispatchID = 0;

/**
Expand Down
9 changes: 0 additions & 9 deletions sources/net.sf.j2s.java.core/src/swingjs/plaf/JSFrameUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ public class JSFrameUI extends JSWindowUI implements FramePeer, JSComponentUI.Em
// for our purposes, a frame will be synonymous with a non-imbedded applet or a
// dialog.

// Applet: xxx_appletinfotablediv (fixed w&h)
// / \
// z 200000 xxx_swingdiv (rootpane, fixed w&h) \
// z 200001 xxx_appletdiv (w,h 100%) xxx_infotablediv (System.out)
// z 200002 xxx_canvas2d (w,h 100%)
// z 200003 xxx_contentLayer (fixed w&h)
// xxx_2dappletdiv (w,h 100%; could be used for the glassPane)
//

protected JFrame frame;
// private String title;
private int state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ void setJSText() {

@Override
public boolean focus() {
if (!super.focus())
if (!editor.isEditable() || !super.focus())
return false;
if (haveFocus()) {

Expand Down
3 changes: 1 addition & 2 deletions sources/net.sf.j2s.java.core/srcjs/js/j2sApplet.js
Original file line number Diff line number Diff line change
Expand Up @@ -3046,8 +3046,7 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
J2S.getResourcePath = function(path, isJavaPath) {
if (!path || path.indexOf("https:/") != 0
&& path.indexOf("https:/") != 0 && path.indexOf("file:/") != 0) {
var applet = J2S._applets[Clazz.loadClass("java.lang.Thread").currentThread$()
.getName$()];
var applet = Thread.currentThread$().getThreadGroup$().秘html5Applet;
path = (!isJavaPath && applet.__Info.resourcePath || applet.__Info.j2sPath)
+ "/" + (path || "");
}
Expand Down
3 changes: 1 addition & 2 deletions sources/net.sf.j2s.java.core/srcjs/swingjs2.js
Original file line number Diff line number Diff line change
Expand Up @@ -13715,8 +13715,7 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
J2S.getResourcePath = function(path, isJavaPath) {
if (!path || path.indexOf("https:/") != 0
&& path.indexOf("https:/") != 0 && path.indexOf("file:/") != 0) {
var applet = J2S._applets[Clazz.loadClass("java.lang.Thread").currentThread$()
.getName$()];
var applet = Thread.currentThread$().getThreadGroup$().秘html5Applet;
path = (!isJavaPath && applet.__Info.resourcePath || applet.__Info.j2sPath)
+ "/" + (path || "");
}
Expand Down