Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2a8774e
Test_Regex additional test
BobHanson Jun 26, 2020
aa42c8e
HttpClient v 2
BobHanson Jun 26, 2020
06a0148
HttpClient URI space to %20, not +
BobHanson Jun 26, 2020
5af3957
dev notes "+" vs "%20" in URI.
BobHanson Jun 26, 2020
a069530
Formatter fix after Java8 regex upgrade
BobHanson Jun 30, 2020
7cc1cce
PaintImmediately fix (part 1)
BobHanson Jun 30, 2020
1f19ffe
removing simple buttons from self-painting when border is set
BobHanson Jun 30, 2020
9f10d71
JSGraphics2D adds public getContext2D() (not used)
BobHanson Jun 30, 2020
f8d2b2e
JSSplitPaneUI fix for undispose not resetting drag event handler
BobHanson Jun 30, 2020
c25eb45
JSTabbedPaneUI optimization for not repainting on lost focus if ntabs 1
BobHanson Jun 30, 2020
15241a9
normalizing JSUtil.getAppletCodePath()
BobHanson Jun 30, 2020
b83b53d
Matcher.getGroup(int) was passing undefined; should be null
BobHanson Jun 30, 2020
4925844
new tests; minor fixes
BobHanson Jun 30, 2020
0ebc402
Fixes for JInternalPane, JMenuBar, some refactoring
BobHanson Jun 30, 2020
1c2d463
JSSPlitPaneUI fixes JSButtonUI CSS outline "none"
BobHanson Jul 3, 2020
89cb592
SwingJS update
BobHanson Jul 3, 2020
7c3a882
// BH 2020.07.04 -- 3.2.9.v1m fix for X.super.y() in anonymous class
BobHanson Jul 8, 2020
513679d
BufferedImage for video
BobHanson Jul 8, 2020
81b7164
UI upgrade
BobHanson Jul 8, 2020
f394e45
transpiler test for "let" instead of "var"
BobHanson Jul 8, 2020
e85d222
various fixes
BobHanson Jul 13, 2020
c0330ff
Update from LenovoII
Jul 13, 2020
dde5583
not significant
Jul 14, 2020
d750ccb
?
Jul 14, 2020
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.
Binary file modified sources/net.sf.j2s.core/dist/swingjs/net.sf.j2s.core.jar
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 @@
20200625205024
20200713172416
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.9/SwingJS-site.zip
Binary file not shown.
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.9/net.sf.j2s.core.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/ver/3.2.9/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20200625205024
20200713172416
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class CorePlugin extends Plugin {
// j2sApplet.js and also (Bob only) update.bat, update-clean.bat


// BH 2020.07.04 -- 3.2.9.v1m fix for X.super.y() in anonymous class
// BH 2020.06.22 -- 3.2.9.v1k fix for varargs not proper qualified arrays
// BH 2020.06.17 -- 3.2.9-v1j fix for functional interface this::privateMethod
// BH 2020.05.01 -- 3.2.9-v1i fix for nested lambda methods
Expand Down
171 changes: 97 additions & 74 deletions sources/net.sf.j2s.core/src/net/sf/j2s/core/Java2ScriptVisitor.java

Large diffs are not rendered by default.

Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
24 changes: 24 additions & 0 deletions sources/net.sf.j2s.java.core/jars/notused/README-SWINGJS
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
We are using the 2015 closure compiler because it does not completely mangle
FOR loops and does not have the 10K $jscomp header. For example:

for (; start < hi; start++) {
let pivot=a[start];
let left=lo;
let right=start;
...

in the newer compiler is converted to:

for(var n={};a<b;
n={$jscomp$loop$prop$left$287:n.$jscomp$loop$prop$left$287,
$jscomp$loop$prop$right$288:n.$jscomp$loop$prop$right$288},a++){
var e=c[a];
n.$jscomp$loop$prop$left$287=d;
n.$jscomp$loop$prop$right$288=a;
...

so every time through the loop n is recreated?

I don't get it.


Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion sources/net.sf.j2s.java.core/src/java/applet/JSApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ public class JSApplet extends JSPanel {
* @since 1.4
*/
public JSApplet() {
秘winOrApplet = true;

// if (GraphicsEnvironment.isHeadless()) {
// if (GraphicsEnvironment.isHeadless()) {
// throw new HeadlessException();
// }
}
Expand Down
16 changes: 5 additions & 11 deletions sources/net.sf.j2s.java.core/src/java/awt/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -972,8 +972,6 @@ public synchronized DropTarget getDropTarget() {

public GraphicsConfiguration graphicsConfig;

protected boolean isWindow;

/**
* Gets the <code>GraphicsConfiguration</code> associated with this
* <code>Component</code>. If the <code>Component</code> has not been assigned a
Expand Down Expand Up @@ -1546,7 +1544,7 @@ public void hide() {
}
}
Container parent = this.parent;
if (!isWindow && parent != null) {
if (parent != null && !((JSComponent) this).秘winOrApplet) {
parent.invalidate();
}
// }
Expand Down Expand Up @@ -2129,12 +2127,7 @@ public void reshape(int x, int y, int width, int height) {
}

private void repaintParentIfNeeded(int oldX, int oldY, int oldWidth, int oldHeight) {
if (parent != null && peer instanceof LightweightPeer && isShowing()) {
// Have the parent redraw the area this component occupied.
parent.repaint(oldX, oldY, oldWidth, oldHeight);
// Have the parent redraw the area this component *now* occupies.
((JSComponent)this).秘repaint();
}
((JSComponent)this).秘repaintParentIfNeeded(oldX, oldY, oldWidth, oldHeight);
}

/**
Expand Down Expand Up @@ -6704,8 +6697,9 @@ final boolean requestFocusHelper(boolean temporary, boolean focusedWindowChangeA
}

public boolean isWindowOrJSApplet() {
// SwingJS treating embedded applet as window here
return this instanceof Window || this instanceof JSApplet;
return ((JSComponent) this).秘winOrApplet;
// // SwingJS treating embedded applet as window here
// return this instanceof Window || this instanceof JSApplet;
}

public boolean isJ2SWindowButNotJInternalFrame() {
Expand Down
32 changes: 12 additions & 20 deletions sources/net.sf.j2s.java.core/src/java/awt/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import sun.awt.SunGraphicsCallback;
import swingjs.JSFrameViewer;
import swingjs.JSMouse;
import swingjs.plaf.JSComponentUI;


/**
Expand Down Expand Up @@ -364,16 +363,9 @@ final Component[] getComponents_NoClientCode() {
* @see LayoutManager
* @since JDK1.1
*/
public Insets getInsets() {
// Panel, ScrollPane, and Window only
return (peer instanceof ContainerPeer ? this.秘getInsetsC() : NULL_INSETS);
}

public Insets 秘getInsetsC() {
// in SwingJS, we do not clone. Everything is a ContainerPeer.
// it is inconsistent with other classes that this would need cloning.
Insets i = (peer == null ? null : ((ContainerPeer) peer).getInsets());
return (i == null ? NULL_INSETS : i);
@Override
public Insets getInsets() {
return super.getInsets();
}

@Deprecated
Expand Down Expand Up @@ -765,15 +757,15 @@ public void setComponentZOrder(Component comp, int index) {
}
}

/**
* Traverses the tree of components and reparents children heavyweight component
* to new heavyweight parent.
* @since 1.5
*/
@SuppressWarnings("deprecation")
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
// JSComponentUI.reparent is not implemented. It just gets tainted.
}
// /**
// * Traverses the tree of components and reparents children heavyweight component
// * to new heavyweight parent.
// * @since 1.5
// */
// @SuppressWarnings("deprecation")
// private void reparentTraverse(ContainerPeer parentPeer, Container child) {
// // JSComponentUI.reparent is not implemented. It just gets tainted.
// }
// checkTreeLock();
//
// for (int i = 0; i < child.getComponentCount(); i++) {
Expand Down
37 changes: 36 additions & 1 deletion sources/net.sf.j2s.java.core/src/java/awt/JSComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public interface A2SWrappedComponent {

public String 秘htmlName;

protected boolean 秘winOrApplet;

protected int 秘num;
private static int 秘incr;
private Insets 秘tempInsets;
Expand Down Expand Up @@ -242,7 +244,15 @@ public Graphics getGraphics() {
if (width == 0 || height == 0 || !isVisible())
return null;
Graphics g;
if (秘frameViewer != null) {
// this was 秘frameViewer != null, but that
// fails for paintImmediately, because all components
// have a reference to FrameViewer now, and so the
// offset was not being applied. The special case for
// ContentPane adds its insets. parent == null is a
// proxy for Applet or Window since only they can be
// here and not have a parent.
if (秘isRootPane || 秘winOrApplet || 秘isContentPane) {
// this next call adds the necessary transform.
g = 秘frameViewer.getGraphics().create();
if (秘isContentPane) {
if (秘tempInsets == null)
Expand Down Expand Up @@ -824,4 +834,29 @@ public static enum ModalExclusionType {
TOOLKIT_EXCLUDE
}



public Insets getInsets() {
// Panel, ScrollPane, and Window only
return 秘getInsets();
}

public Insets 秘getInsets() {
// in SwingJS, we do not clone. Everything is a ContainerPeer.
// it is inconsistent with other classes that this would need cloning.
Insets i = (ui == null ? null : 秘getUI().getInsets());
return (i == null ? Container.NULL_INSETS : i);
}

public void 秘repaintParentIfNeeded(int oldX, int oldY, int oldWidth, int oldHeight) {
if (parent != null && peer instanceof LightweightPeer && isShowing()) {
// Have the parent redraw the area this component occupied.
// Have the parent redraw the area this component *now* occupies.
if (秘getUI().allowPaintedBackground && 秘paintsSelf()) {
parent.repaint(oldX, oldY, oldWidth, oldHeight);
秘repaint();
}
}
}

}
14 changes: 5 additions & 9 deletions sources/net.sf.j2s.java.core/src/java/awt/JSFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public class JSFrame extends Window {
*
*/
public JSFrame() {
initTitleGC(null, null);
this(null, null);
}

/**
Expand All @@ -404,7 +404,7 @@ public JSFrame() {
*
*/
public JSFrame(GraphicsConfiguration gc) {
initTitleGC(null, gc);
this(null, gc);
}

/**
Expand All @@ -420,7 +420,7 @@ public JSFrame(GraphicsConfiguration gc) {
*
*/
public JSFrame(String title) {
initTitleGC(title, null);
this(title, null);
}

/**
Expand Down Expand Up @@ -449,14 +449,10 @@ public JSFrame(String title) {
*
*/
public JSFrame(String title, GraphicsConfiguration gc) {
initTitleGC(title, gc);
super(gc);
this.title = (title == null ? "" : title);
}

protected void initTitleGC(String title, GraphicsConfiguration gc) {
this.title = (title == null ? "" : title);
initWinGC(null, gc); // Window
}

/**
* Construct a name for this component. Called by getName() when the
* name is null.
Expand Down
Loading