Skip to content

Commit e47365d

Browse files
authored
Merge pull request #101 from BobHanson/master
removes issue of first-char capitalization in package names
2 parents 4e25f7d + b57a1a2 commit e47365d

File tree

10 files changed

+231
-110
lines changed

10 files changed

+231
-110
lines changed
4.09 KB
Binary file not shown.
252 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190204180153
1+
20190205030857
4.09 KB
Binary file not shown.
252 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190204180153
1+
20190205030857

sources/net.sf.j2s.core/src/net/sf/j2s/core/Java2ScriptVisitor.java

Lines changed: 113 additions & 103 deletions
Large diffs are not rendered by default.
4.09 KB
Binary file not shown.

sources/net.sf.j2s.java.core/src/java/lang/reflect/Method.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,21 @@ public Object invoke(Object receiver, Object... args)
109109
// proxy does
110110
Object[] a = Class.getArgumentArray(parameterTypes, args, isProxy);
111111
Object c = (isProxy ? receiver : this.Class_);
112-
Object m = null;
112+
Object m = null, val = null;
113113
/**
114114
* @j2sNative
115115
*
116116
* if (!this.isProxy) c = c.$clazz$;
117117
* m= c[this.signature] || c.prototype && c.prototype[this.signature];
118-
* if (m != null) {
119-
* m = this.wrap$O(m.apply(receiver,a));
120-
* }
118+
* val = (m == null ? null : m.apply(receiver,a));
119+
* if (val != null && !this.isProxy) val = this.wrap$O(val);
121120
*/
122121
if (m == null) {
123122
String message = "Method " + getDeclaringClass().getName()
124123
+ "." + signature + " was not found";
125124
throw new IllegalArgumentException(message);
126125
}
127-
return m;
126+
return val;
128127
}
129128

130129
Object wrap(Object o) {
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
package test.Testing.common;
2+
3+
import java.applet.Applet;
4+
import java.awt.AlphaComposite;
5+
import java.awt.BasicStroke;
6+
import java.awt.Color;
7+
import java.awt.Graphics;
8+
import java.awt.Graphics2D;
9+
import java.awt.GridLayout;
10+
import java.awt.Label;
11+
import java.awt.List;
12+
import java.awt.Polygon;
13+
import java.awt.Scrollbar;
14+
import java.awt.TextArea;
15+
16+
import javax.swing.JLabel;
17+
import javax.swing.JPanel;
18+
19+
import swingjs.JSGraphics2D;
20+
21+
22+
public class TApp2 extends Applet {
23+
public void init() {
24+
List l = new List();
25+
l.add("Text");
26+
System.out.println(l.getItems());
27+
28+
setBackground(Color.white);
29+
setLayout(null);
30+
JPanel panel = new JPanel();
31+
panel.setBounds(10, 10, 100, 150);
32+
add(panel);
33+
panel.setLayout(null);
34+
panel.setBackground(Color.red);
35+
JLabel label = new JLabel("OK");
36+
label.setBounds(10, 10, 50, 60);
37+
panel.add(label);
38+
39+
JPanel panel2 = new JPanel();
40+
panel2.setLayout(new GridLayout(2, 1));
41+
Label label2 = new Label("1");
42+
label2.setAlignment(Label.CENTER);
43+
panel2.add(label2);
44+
panel2.add(new JLabel("2"));
45+
panel2.setBounds(200, 150, 100, 150);
46+
// add(panel2);
47+
48+
TextArea ta = new TextArea("A text\nwith some\nlines and\n no content.");
49+
ta.setBounds(200, 70, 100, 80);
50+
add(ta);
51+
// ta.getSelectionEnd();
52+
ta.setBackground(Color.red);
53+
ta.appendText("A text\nwith some\nlines and\n no content.");
54+
55+
// Scrollbar sb = new Scrollbar(0, 10, 0, 0, 1);
56+
}
57+
58+
public void paint(Graphics g) {
59+
super.paint(g);
60+
// ((Graphics2D) g).setStroke((new BasicStroke(0)));
61+
// g.drawRect(130, 150, 40, 60);
62+
// g.fillRect(140, 5, 1, 200);
63+
// g.drawLine(150, 150, 150, 350);
64+
//
65+
//
66+
//
67+
68+
69+
70+
71+
72+
g.setColor(Color.red);
73+
g.fillRect(10, 200, 100, 100);
74+
((Graphics2D)g).setComposite(AlphaComposite.Clear);
75+
g.setColor(Color.white);
76+
g.fillRect(10, 200, 100, 100);
77+
g.setPaintMode();
78+
79+
80+
//
81+
//
82+
// Polygon poly = new Polygon();
83+
// poly.addPoint(10, 200);
84+
// poly.addPoint(110, 200);
85+
// poly.addPoint(110, 300);
86+
// poly.addPoint(10, 300);
87+
// g.setColor(Color.white);
88+
// g.fillPolygon(poly);
89+
// g.setColor(Color.blue);
90+
// g.fillPolygon(poly);
91+
//
92+
93+
94+
95+
96+
97+
// g.fillRect(10, 200, 100, 100);
98+
//
99+
//
100+
//
101+
//
102+
// g.setColor(Color.red);
103+
// g.fillOval(200, 10, 10, 10);
104+
// g.setColor(Color.white);
105+
// g.fillOval(200, 10, 10, 10);
106+
//
107+
// g.setColor(Color.red);
108+
// g.drawString("SwingJS", 200, 30);
109+
// g.setColor(Color.white);
110+
// g.drawString("SwingJS", 200, 30);
111+
}
112+
}

0 commit comments

Comments
 (0)