Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
fb0d7c6
simple labels not resizing after text change
Feb 5, 2019
f9d0228
debug comment removed
Feb 5, 2019
d1b7a73
AWT component fonts inheritable; defaults to UI default
Feb 6, 2019
4d5d29a
AWT UI defaults -- simpler idea
Feb 6, 2019
dc84e1b
AWT UI defaults -- simpler idea
Feb 6, 2019
a31a96d
adds graphics2d.drawChars
Feb 6, 2019
7330d1c
new SwingJS-site.zip
Feb 6, 2019
7e3e3f3
fixes antialias issue with JSGraphics2D.fillPoly
Feb 6, 2019
435d6ab
fixes stray "offsets undefined" in j2sApplet.js
Feb 6, 2019
0ff2fe0
at least for AWT Applet, JRootPane should assume insets of Applet
Feb 6, 2019
922f504
this.isAWT added to JSComponentUI
Feb 6, 2019
9f4a22f
Scrollbar background color is for the track itself
Feb 6, 2019
ec8310c
scrollbar visibility fixes for AWT TextArea
Feb 6, 2019
e60b27f
SwingjS-site update
Feb 6, 2019
636e51b
forcing use of getInsets(), not getInsets(insets) for AWT components
Feb 6, 2019
d043d06
+2 pixel y offset fudge for labels.
Feb 6, 2019
bc23df8
adds isOverwritten() to JSToolkit
Feb 6, 2019
bd07fda
updated SwingJS-site.zip
Feb 6, 2019
960ee5c
redesigned A2SEvent, extensive AWT controls work.
Feb 7, 2019
c0b020b
A2SEvent reworking; getResource() for inner class
Feb 8, 2019
cef305c
radix || 10, not radix | 10; fixes new Integer(s, radix)
Feb 8, 2019
b8fa6e6
test files
Feb 8, 2019
990a194
TextArea work.
Feb 8, 2019
412498a
A2S AWT component work (for Math(Prism))
Feb 8, 2019
5f7f549
fix for removing \u0000 in text, background setting, clearing
Feb 9, 2019
dcd7e31
focus management for java.awt.TextArea and JTextArea
Feb 10, 2019
7c0ec55
fixes for Scrollbar events
Feb 11, 2019
8306a03
fix for no mouse click for right-mouse button
Feb 11, 2019
09d609b
Scrollbar fixes
Feb 11, 2019
e20c1e4
JTextComponent implements TextComponent in SwingJS
Feb 11, 2019
18254a2
JSGraphics2D.setClip(null)
Feb 11, 2019
2cc1ca1
java.awt.TextComponent as interface
Feb 11, 2019
8cb8a9e
SwingJS-site.zip
Feb 11, 2019
a9af8ff
null should be g in paintWithBackgroundCheck
Feb 13, 2019
0dd1863
setting AWT Button default background to #EEEEEE
Feb 13, 2019
7f513b3
adds setTextFromUI, allowing special handling for AWT text components
Feb 13, 2019
b7d0d2b
new SwingJS-site.zip
Feb 13, 2019
310ecf9
Slider/Scrollbar proper AdjustmentListener events
Feb 13, 2019
b8c4cce
AWT Checkbox as group, textarea fixes for selecting text
Feb 13, 2019
8a7eb1b
fixes new Random().nextInt(n) among others
Feb 17, 2019
c34a21b
ScrollPaneConstants
Feb 17, 2019
b0b614e
allows drawLine(x,y,x,y) to draw a point
Feb 17, 2019
5987ab0
making sure font names are independent of case
Feb 17, 2019
bbde6ef
adding internal borderbox for TextArea and TextEditor -- untested
Feb 17, 2019
1ca93c7
increasing checkbox/radio button to 80% from 60% (still 60% for menus)
Feb 17, 2019
19b2563
fixes typo in Integer.parseInt(s,radix)
Feb 17, 2019
7ea4938
updates Differences.txt
Feb 17, 2019
65aa556
corrects AWT Choice to use ItemEevent, not ActionEvent
Feb 17, 2019
867fc5d
AWT Applet sets content pane transparent
Feb 17, 2019
e48878e
A2SListener adds ItemEvent for Choice
Feb 17, 2019
5463fb6
test files
Feb 17, 2019
d07294c
removes JScrollPane wrapper for AWT TextArea.
Feb 17, 2019
ce2c5b2
removes default color:#FFFFFF in Info
Feb 17, 2019
e471e9d
core/swingjs2.js update
Feb 17, 2019
fa27f92
JSTextUI/TextArea fix for SeaMonkey bug
Feb 17, 2019
9fd8ea7
AWT fixes for Checkbox events; working on JButton focus/key accel
Feb 20, 2019
bff7628
fix loss of focus when checking size, various AWT-related fixes
Feb 20, 2019
b30611b
naming bindJQueryEvents event id, addJ2SKeyHandler --> addFocuHandler
Feb 20, 2019
e8df197
fixes noneditable background color
Feb 20, 2019
7066afc
fixes AWT column width based on _ not m
Feb 20, 2019
7beb86f
fixes press-and-hold key rep 401 text update instead of 402 update;
Feb 20, 2019
b3216fa
fixes AWT missing super.paint(g) in Panel
Feb 20, 2019
3f1e853
fixes AWT font inheritance
Feb 20, 2019
b0694cf
removes unnec. synchronized
Feb 20, 2019
7ec3c64
swingjs update -- not clear why all the early versions are updating
Feb 20, 2019
334a72b
AWT Checkbox setState needs to bypass listeners but still set ui
Feb 21, 2019
8b4131d
JApplet validate/invalidate needs to pass to content pane
Feb 21, 2019
0a76a3b
SwingJS-site.zip update
Feb 21, 2019
33ccd01
AWT foreground color fix
Feb 25, 2019
f204051
setting default HTML5LookAndFeel for JLabel to bold font. (Windows
Feb 25, 2019
1043db3
fixing ?j2smouse debug flag
Feb 25, 2019
92c9856
transpiler fix for int/byte missing numerator
Feb 25, 2019
889c3ca
slider/scrollbar upgrade for visualAmount
Feb 25, 2019
99f554c
AWT fixing inheritance
Feb 25, 2019
0ddc1b8
minor refactoring
Feb 25, 2019
4f3929c
allows JSUtil.getStackTrace() to work in Java
Feb 25, 2019
6dc52cf
fixing AWT defaults
Feb 25, 2019
a697e53
allows enable foreground change for labels
Feb 25, 2019
2735791
List and JList work -- unfinished
Feb 25, 2019
70c04cd
scrollabar/slider work
Feb 25, 2019
218c6b4
minor refactoring
Feb 25, 2019
cc61ebd
cleanup
Feb 25, 2019
f73a8f0
handleEnter fix for text components
Feb 25, 2019
6bac005
test classes
Feb 25, 2019
8095bbc
transpiler and runtime upgrade
Feb 25, 2019
d726663
AWT Choice no background inheritance
Feb 25, 2019
c31b4f7
SwingJS-site.zip
Feb 25, 2019
615e860
BigInteger getLowestSetBit coding error for 24-bit int
Feb 28, 2019
b70b00c
adds JSComponent.isWindowOrJSApplet(), selfOrChildIsPainted()
Feb 28, 2019
e1b0c1f
adds initial clip; not critical
Feb 28, 2019
7ea6ee9
isWindowOrJSApplet()
Feb 28, 2019
3f70c3b
sets isRootPane
Feb 28, 2019
9259f6c
ScrollPane/JScrollPane fixes for painted components needing paint()
Feb 28, 2019
d5bddb5
AWT TextArea caretUpdatedByProgram() removed; not compatible with typing
Feb 28, 2019
df28751
Adds JSUtil.getJ2SAlias(Component c, String name) and .isOverridden()
Feb 28, 2019
554dba0
minor refactoring
Feb 28, 2019
7da9cea
comp.isJ2SWindowButNotJInternalFrame()
Feb 28, 2019
a8ab1e9
JSApplet/Window alias methods
Feb 28, 2019
0b7213f
.isWindowOrJSApplet()
Feb 28, 2019
750d713
JTextArea better row height calculation for preferred size
Feb 28, 2019
a554ee4
JComponent .isRootPane bypasses paintImmediately clip for root pane
Feb 28, 2019
b2b3e50
minor refactoring
Feb 28, 2019
bdc67b1
isWindowOrJSApplet()
Feb 28, 2019
bc47990
SwingJS-site.zip and test files
Feb 28, 2019
f331ae1
BigInteger tests passing; BigDecimal testing
Mar 5, 2019
6e9bd38
image inheritance of Component font, background, foreground
Mar 5, 2019
3625a35
allows access to package-private constructor
Mar 5, 2019
8886fb9
proper Component.isDisplayable()
Mar 5, 2019
a4303ac
early Thread loading
Mar 5, 2019
1726bfb
SwingJS-site.zip
Mar 5, 2019
a0e6377
BigInteger complete; working on BigDecimal
Mar 7, 2019
ec0ba05
focus peer fix for should not set focus to applet window
Mar 7, 2019
2cdeaf0
allows checking first in class package for Class.forName(name, init,
Mar 8, 2019
ad5561d
back to Y-translate of -50% for buttons and labels, AWT and Swing
Mar 8, 2019
797cb13
adds default font for JFrame, though not implemented.
Mar 8, 2019
ae4840c
AWT Menu/MenuBar work - preliminary
Mar 8, 2019
968c5f0
button/label y-translate AWT and Swing
Mar 8, 2019
4e683a6
BigDecimal fixes
Mar 8, 2019
ad54257
sun.reflect.Reflection.getCallingClass
Mar 8, 2019
5d274e6
better Component.peer initialization.
Mar 8, 2019
c818617
AWT Dialog default font/background/color
Mar 8, 2019
6d374ec
AWT/Swing List - working; not functional
Mar 8, 2019
a564fb7
unnecessary AWT TextArea overwriting removed
Mar 8, 2019
1e93f7c
AWT Frame/Dialog defaults
Mar 8, 2019
4b6f06a
new SwingJS-site.zip
Mar 8, 2019
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 @@
20190205134840
20190307200127
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.4/SwingJS-site.zip
Binary file not shown.
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 @@
20190205134840
20190307200127
Original file line number Diff line number Diff line change
Expand Up @@ -3047,6 +3047,7 @@ public boolean visit(InfixExpression node) {
return false;
String leftName = leftTypeBinding.getName();
String rightName = rightTypeBinding.getName();

boolean leftIsInt = leftTypeBinding.isPrimitive() && isIntegerType(leftName);
boolean rightIsInt = rightTypeBinding.isPrimitive() && isIntegerType(rightName);
if ("/".equals(operator) && leftIsInt && rightIsInt) {
Expand Down Expand Up @@ -4055,13 +4056,13 @@ private boolean addPrimitiveTypedExpression(Expression left, IVariableBinding as
}
break;
case "int":
if (op != null && (!isDiv && fromIntType) || fromChar || rightName.equals("short")
|| rightName.equals("byte")) {
if (!isDiv && (op != null && (!isDiv && fromIntType) || fromChar || rightName.equals("short")
|| rightName.equals("byte"))) {
left = null;
break;
} else {
more = "|0)";
addParens = true;
}
more = "|0)";
addParens = true;
break;
case "short":
if ((rightName.equals("short") || rightName.equals("byte")) && !isDiv) {
Expand Down
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
3 changes: 1 addition & 2 deletions sources/net.sf.j2s.java.core/doc/Differences.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,7 @@ Glyph/composite/outline fonts are not supported
specific AWT components not implemented
---------------------------------------

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


threads
Expand Down
67 changes: 65 additions & 2 deletions sources/net.sf.j2s.java.core/src/java/applet/JSApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*/
package java.applet;

import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.Image;
Expand All @@ -35,10 +37,21 @@
import java.net.URL;
import java.util.Locale;

import javax.swing.JApplet;
import javax.swing.JComponent;
import javax.swing.JRootPane;
import javax.swing.RepaintManager;

import swingjs.plaf.JSComponentUI;

/**
* SwingJS note: This class is the original java.applet.Applet class.
* It is subclassed by JApplet. The replacement java.applet.Applet class
* subclassed java.applet.Applet, which subclasses JApplet.
* subclassed java.applet.Applet, which subclasses JApplet. In addition,
* it includes methods from Window allowing it to be treated as a window
* with respect to focus.
*
*
*
* An applet is a small program that is intended not to be run on
* its own, but rather to be embedded inside another application.
Expand Down Expand Up @@ -74,6 +87,47 @@ public JSApplet() {
// }
}


/**
* SwingJS -- from Window
*
* @return true
*/
public boolean isFocusableWindow() {
// mascarading as Window here
return true;
}

public Dialog getModalBlocker() {
// mascarading as Window here
return null; //??
}


/**
* Holds the reference to the component which last had focus in this window
* before it lost focus.
*/
private transient Component temporaryLostComponent;

Component getTemporaryLostComponent() {
return temporaryLostComponent;
}
Component setTemporaryLostComponent(Component component) {
Component previousComp = temporaryLostComponent;
// Check that "component" is an acceptable focus owner and don't store it otherwise
// - or later we will have problems with opposite while handling WINDOW_GAINED_FOCUS
if (component == null || component.canBeFocusOwner()) {
temporaryLostComponent = component;
} else {
temporaryLostComponent = null;
}
return previousComp;
}




/**
* Applets can be serialized but the following conventions MUST be followed:
*
Expand Down Expand Up @@ -218,8 +272,17 @@ public void resize(int width, int height) {
}

public void resizeHTML(int width, int height) {
if (appletViewer != null)
if (appletViewer != null) {
appletViewer.html5Applet._resizeApplet(new int[] {width, height});
if (stub != null) {
// Added 2/23/2019 to force layout prior to Canvas painting in mpFrakta.Applets.Geomet
JRootPane root = ((JApplet) this).getRootPane();
root.invalidate();
((JSComponentUI)root.getUI()).setPainted(null);
root._isBackgroundPainted = false;
RepaintManager.currentManager(this).addInvalidComponent(root);
}
}
}

@SuppressWarnings("deprecation")
Expand Down
Loading