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.
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 @@
20190204180153
20190205030857
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.4/SwingJS-site.zip
Binary file not shown.
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.4/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.4/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20190204180153
20190205030857
216 changes: 113 additions & 103 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.
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,21 @@ public Object invoke(Object receiver, Object... args)
// proxy does
Object[] a = Class.getArgumentArray(parameterTypes, args, isProxy);
Object c = (isProxy ? receiver : this.Class_);
Object m = null;
Object m = null, val = null;
/**
* @j2sNative
*
* if (!this.isProxy) c = c.$clazz$;
* m= c[this.signature] || c.prototype && c.prototype[this.signature];
* if (m != null) {
* m = this.wrap$O(m.apply(receiver,a));
* }
* val = (m == null ? null : m.apply(receiver,a));
* if (val != null && !this.isProxy) val = this.wrap$O(val);
*/
if (m == null) {
String message = "Method " + getDeclaringClass().getName()
+ "." + signature + " was not found";
throw new IllegalArgumentException(message);
}
return m;
return val;
}

Object wrap(Object o) {
Expand Down
112 changes: 112 additions & 0 deletions sources/net.sf.j2s.java.core/src/test/Testing/common/TApp2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package test.Testing.common;

import java.applet.Applet;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.Label;
import java.awt.List;
import java.awt.Polygon;
import java.awt.Scrollbar;
import java.awt.TextArea;

import javax.swing.JLabel;
import javax.swing.JPanel;

import swingjs.JSGraphics2D;


public class TApp2 extends Applet {
public void init() {
List l = new List();
l.add("Text");
System.out.println(l.getItems());

setBackground(Color.white);
setLayout(null);
JPanel panel = new JPanel();
panel.setBounds(10, 10, 100, 150);
add(panel);
panel.setLayout(null);
panel.setBackground(Color.red);
JLabel label = new JLabel("OK");
label.setBounds(10, 10, 50, 60);
panel.add(label);

JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayout(2, 1));
Label label2 = new Label("1");
label2.setAlignment(Label.CENTER);
panel2.add(label2);
panel2.add(new JLabel("2"));
panel2.setBounds(200, 150, 100, 150);
// add(panel2);

TextArea ta = new TextArea("A text\nwith some\nlines and\n no content.");
ta.setBounds(200, 70, 100, 80);
add(ta);
// ta.getSelectionEnd();
ta.setBackground(Color.red);
ta.appendText("A text\nwith some\nlines and\n no content.");

// Scrollbar sb = new Scrollbar(0, 10, 0, 0, 1);
}

public void paint(Graphics g) {
super.paint(g);
// ((Graphics2D) g).setStroke((new BasicStroke(0)));
// g.drawRect(130, 150, 40, 60);
// g.fillRect(140, 5, 1, 200);
// g.drawLine(150, 150, 150, 350);
//
//
//





g.setColor(Color.red);
g.fillRect(10, 200, 100, 100);
((Graphics2D)g).setComposite(AlphaComposite.Clear);
g.setColor(Color.white);
g.fillRect(10, 200, 100, 100);
g.setPaintMode();


//
//
// Polygon poly = new Polygon();
// poly.addPoint(10, 200);
// poly.addPoint(110, 200);
// poly.addPoint(110, 300);
// poly.addPoint(10, 300);
// g.setColor(Color.white);
// g.fillPolygon(poly);
// g.setColor(Color.blue);
// g.fillPolygon(poly);
//





// g.fillRect(10, 200, 100, 100);
//
//
//
//
// g.setColor(Color.red);
// g.fillOval(200, 10, 10, 10);
// g.setColor(Color.white);
// g.fillOval(200, 10, 10, 10);
//
// g.setColor(Color.red);
// g.drawString("SwingJS", 200, 30);
// g.setColor(Color.white);
// g.drawString("SwingJS", 200, 30);
}
}