Skip to content

Commit 7a64a84

Browse files
authored
Merge pull request #85 from BobHanson/hanson1
Hanson1 - MathePrisma work
2 parents fdd5887 + 4b6f06a commit 7a64a84

163 files changed

Lines changed: 11168 additions & 6209 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
15.4 KB
Binary file not shown.
9 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190205134840
1+
20190307200127
15.4 KB
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190205134840
1+
20190307200127

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,6 +3047,7 @@ public boolean visit(InfixExpression node) {
30473047
return false;
30483048
String leftName = leftTypeBinding.getName();
30493049
String rightName = rightTypeBinding.getName();
3050+
30503051
boolean leftIsInt = leftTypeBinding.isPrimitive() && isIntegerType(leftName);
30513052
boolean rightIsInt = rightTypeBinding.isPrimitive() && isIntegerType(rightName);
30523053
if ("/".equals(operator) && leftIsInt && rightIsInt) {
@@ -4055,13 +4056,13 @@ private boolean addPrimitiveTypedExpression(Expression left, IVariableBinding as
40554056
}
40564057
break;
40574058
case "int":
4058-
if (op != null && (!isDiv && fromIntType) || fromChar || rightName.equals("short")
4059-
|| rightName.equals("byte")) {
4059+
if (!isDiv && (op != null && (!isDiv && fromIntType) || fromChar || rightName.equals("short")
4060+
|| rightName.equals("byte"))) {
40604061
left = null;
4061-
break;
4062+
} else {
4063+
more = "|0)";
4064+
addParens = true;
40624065
}
4063-
more = "|0)";
4064-
addParens = true;
40654066
break;
40664067
case "short":
40674068
if ((rightName.equals("short") || rightName.equals("byte")) && !isDiv) {
15.4 KB
Binary file not shown.

sources/net.sf.j2s.java.core/doc/Differences.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,8 +1001,7 @@ Glyph/composite/outline fonts are not supported
10011001
specific AWT components not implemented
10021002
---------------------------------------
10031003

1004-
The only AWT components implemented are Dialog, Frame, Panel, and Window
1005-
They are subclassed as JDialog, JFrame, JPanel/JApplet, and JWindow, respectively
1004+
all AWT components are now implemented as subclasses of Swing counterparts. 2019.02.13 BH
10061005

10071006

10081007
threads

sources/net.sf.j2s.java.core/src/java/applet/JSApplet.java

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
*/
2828
package java.applet;
2929

30+
import java.awt.Component;
31+
import java.awt.Dialog;
3032
import java.awt.Dimension;
3133
import java.awt.HeadlessException;
3234
import java.awt.Image;
@@ -35,10 +37,21 @@
3537
import java.net.URL;
3638
import java.util.Locale;
3739

40+
import javax.swing.JApplet;
41+
import javax.swing.JComponent;
42+
import javax.swing.JRootPane;
43+
import javax.swing.RepaintManager;
44+
45+
import swingjs.plaf.JSComponentUI;
46+
3847
/**
3948
* SwingJS note: This class is the original java.applet.Applet class.
4049
* It is subclassed by JApplet. The replacement java.applet.Applet class
41-
* subclassed java.applet.Applet, which subclasses JApplet.
50+
* subclassed java.applet.Applet, which subclasses JApplet. In addition,
51+
* it includes methods from Window allowing it to be treated as a window
52+
* with respect to focus.
53+
*
54+
*
4255
*
4356
* An applet is a small program that is intended not to be run on
4457
* its own, but rather to be embedded inside another application.
@@ -74,6 +87,47 @@ public JSApplet() {
7487
// }
7588
}
7689

90+
91+
/**
92+
* SwingJS -- from Window
93+
*
94+
* @return true
95+
*/
96+
public boolean isFocusableWindow() {
97+
// mascarading as Window here
98+
return true;
99+
}
100+
101+
public Dialog getModalBlocker() {
102+
// mascarading as Window here
103+
return null; //??
104+
}
105+
106+
107+
/**
108+
* Holds the reference to the component which last had focus in this window
109+
* before it lost focus.
110+
*/
111+
private transient Component temporaryLostComponent;
112+
113+
Component getTemporaryLostComponent() {
114+
return temporaryLostComponent;
115+
}
116+
Component setTemporaryLostComponent(Component component) {
117+
Component previousComp = temporaryLostComponent;
118+
// Check that "component" is an acceptable focus owner and don't store it otherwise
119+
// - or later we will have problems with opposite while handling WINDOW_GAINED_FOCUS
120+
if (component == null || component.canBeFocusOwner()) {
121+
temporaryLostComponent = component;
122+
} else {
123+
temporaryLostComponent = null;
124+
}
125+
return previousComp;
126+
}
127+
128+
129+
130+
77131
/**
78132
* Applets can be serialized but the following conventions MUST be followed:
79133
*
@@ -218,8 +272,17 @@ public void resize(int width, int height) {
218272
}
219273

220274
public void resizeHTML(int width, int height) {
221-
if (appletViewer != null)
275+
if (appletViewer != null) {
222276
appletViewer.html5Applet._resizeApplet(new int[] {width, height});
277+
if (stub != null) {
278+
// Added 2/23/2019 to force layout prior to Canvas painting in mpFrakta.Applets.Geomet
279+
JRootPane root = ((JApplet) this).getRootPane();
280+
root.invalidate();
281+
((JSComponentUI)root.getUI()).setPainted(null);
282+
root._isBackgroundPainted = false;
283+
RepaintManager.currentManager(this).addInvalidComponent(root);
284+
}
285+
}
223286
}
224287

225288
@SuppressWarnings("deprecation")

0 commit comments

Comments
 (0)