Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1437a63
fixes missing JPopupMenu.isPopupTrigger(), event.isPopupTrigger()
Jan 21, 2019
7664c0f
JSSpinnerUI replace with *original* Java8 version.
Jan 22, 2019
37e561f
JSlider, Float, JRadioButton
Jan 22, 2019
12092e6
PopupMenu efficiencies, Slider, j2sClazz
Jan 23, 2019
e277a21
testing StringBuilder
Jan 29, 2019
51fc340
more JSON support as swingjs/json with JSUtil.parseJSON$O
Jan 29, 2019
6f03e61
Back to original java char[] based StringBuilder.
Jan 29, 2019
09c6a87
popup focus issue
Jan 29, 2019
59b7f5c
Window must not gain focus via UI class on activation
Jan 29, 2019
00a7b1a
tooltip ui must check component listening
Jan 29, 2019
f1fdf06
minor
Jan 29, 2019
0f87eb3
slider upgrade for clicking off-handle
Jan 29, 2019
fb5fc25
Sysout.println() missing; Clazz.getProfile() better
Jan 29, 2019
94e5ade
tabbed pane not showing some tabs
Jan 29, 2019
c3cd2b9
frame movement blocking at window top and left
Jan 29, 2019
399c3b1
DnD fix
Jan 29, 2019
55e5378
last edited 1/23/2019 -- fixes for mouse-down effector (mac) operation
Jan 29, 2019
599b507
logic error in invalidate(); isContentPane issue
Jan 29, 2019
3d01ae1
minor issues
Jan 29, 2019
2d1c749
SwingJS.zip
Jan 29, 2019
2ef1315
fix for mnemonic -1
Jan 29, 2019
0ee0717
missing String.join() and Float.isNaN()
Jan 29, 2019
92e68e2
slider tests
Jan 29, 2019
67ab173
Swingjs2.js and SwingJS-site.zip
Jan 29, 2019
63ed007
fixes JTextAreaUI and JTextUI
Jan 31, 2019
b82bc48
fixes JSONObject for fully qualified method names
Jan 31, 2019
ba68372
SwingJS-site.zip update
Jan 31, 2019
ccf132d
j2sMenu.js CLICK_OUT_DELAY increased to 200 ms
Jan 31, 2019
58c71ae
allowing for undecorated JInternalFrame and Frame
Jan 31, 2019
2044506
minimal support for java.awt.MouseInfo (pt only)
Jan 31, 2019
4d152e8
fixes missing cursor on split pane
Jan 31, 2019
80b2856
SwingJS-site.zip
Jan 31, 2019
407f485
removing test/json
Feb 3, 2019
978b65f
fix for button vertical alignment -- should use fm.ascent()
Feb 3, 2019
f939389
org.json.JSON fixing Java error in writer for BigDecimal, BigInteger
Feb 3, 2019
9c213ef
removing unnecessary layout manager call in JSPanelUI.getMinimumSize()
Feb 3, 2019
2ff8235
nominal Toolkit.getDefaultToolkit().getScreenResolution() as 96
Feb 3, 2019
aedb793
tests
Feb 3, 2019
25d12df
fixes Method.invoke for primitives
Feb 3, 2019
1af9bc6
// BH 2/3/2019 -- 3.2.4.07 fixes "final static Float = (float)" missing
Feb 3, 2019
9de8d05
// BH 2/3/2019 -- 3.2.4.07 transpiler; various runtime fixes
Feb 3, 2019
3d6e9f0
Method.invoke correction
Feb 3, 2019
76e5f01
Method.invoke fix
Feb 3, 2019
6be7ecb
setting lock to just "", not the actual string or object
Feb 4, 2019
014119c
JSON reader fix for String reader
Feb 4, 2019
7408e9e
adds ?j2sprofile
Feb 4, 2019
8eb0480
SwingJS_site.zip update
Feb 4, 2019
78ee834
adds AWT PopupMenu support
Feb 5, 2019
1d27a62
Fixes AWT Label("") not still having height
Feb 5, 2019
0b85ce9
test for AWT label
Feb 5, 2019
0afb37f
SwingJS-site.zip
Feb 5, 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 @@
20190121000416
20190204180153
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 @@
20190121000416
20190204180153
4 changes: 3 additions & 1 deletion sources/net.sf.j2s.core/src/net/sf/j2s/core/CorePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public class CorePlugin extends Plugin {
* register the bundle version properly. So we use VERSION here instead.
*
*/
public static String VERSION = "3.2.4.06";
public static String VERSION = "3.2.4.07";
// TODO/NOTE final static int FOO = (/**@j2sNative 5 || */3) stated but not recognized when used as its new value
// BH 2/3/2019 -- 3.2.4.07 fixes "final static Float = (float)" missing definition
// BH 1/2/2019 -- 3.2.4.06 fixes try(resources) with more than one resource missing semicolon
// BH 12/13/2018 -- 3.2.4.05 fixes problem with OuterClass.this.foo() not using .apply()
// BH 11/10/2018 -- 3.2.4.04 additional support for JAXB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2198,13 +2198,13 @@ private boolean addFieldDeclaration(FieldDeclaration field, int mode) {
VariableDeclarationFragment identifier = (VariableDeclarationFragment) fragments.get(0);
IVariableBinding var = identifier.resolveBinding();
Type nodeType = (var != null && var.getType().isArray() ? null : field.getType());
Code code = (nodeType == null || !nodeType.isPrimitiveType() ? null
: ((PrimitiveType) nodeType).getPrimitiveTypeCode());
boolean isPrimitive = (nodeType != null && nodeType.isPrimitiveType());
Code code = (isPrimitive ? ((PrimitiveType) nodeType).getPrimitiveTypeCode() : null);
// have to check here for final Object = "foo", as that must not be ignored.
boolean checkFinalConstant = (isStatic && Modifier.isFinal(field.getModifiers()) && var != null
&& !var.getType().getQualifiedName().equals("java.lang.Object"));
boolean checkFinalConstant = ((isPrimitive || var != null && var.getType().getQualifiedName().equals("java.lang.String"))
&& isStatic && Modifier.isFinal(field.getModifiers()));
if (needDefault)
addJ2SDoc(field);
addJ2SDoc(field);
int len0 = buffer.length();
for (Iterator<?> iter = fragments.iterator(); iter.hasNext();) {
VariableDeclarationFragment fragment = (VariableDeclarationFragment) iter.next();
Expand Down
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
62 changes: 34 additions & 28 deletions sources/net.sf.j2s.java.core/src/java/awt/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -2679,7 +2679,7 @@ protected void invalidateComp() {
if (!isMaximumSizeSet()) {
maxSize = null;
}
if (parent != null) {
if (parent != null && _j2sInvalidateOnAdd) {
parent.invalidateIfValid();
}
// }
Expand Down Expand Up @@ -5046,7 +5046,9 @@ protected final void disableEvents(long eventsToDisable) {
* @see #isCoalescingEnabled
* @see #checkCoalescing
*/
transient private boolean coalescingEnabled = checkCoalescing();
transient private boolean coalescingEnabled = checkCoalescing();

public boolean _j2sInvalidateOnAdd = true; // not for menu items?

/**
* Weak map of known coalesceEvent overriders. Value indicates whether
Expand Down Expand Up @@ -5827,7 +5829,8 @@ protected void addNotifyComp() {
// relocateComponent();
// }
// }
invalidate();
if (_j2sInvalidateOnAdd )
invalidate();

// int npopups = (popups != null? popups.size() : 0);
// SwingJS TODO
Expand Down Expand Up @@ -6872,31 +6875,34 @@ boolean isAutoFocusTransferOnDisposal() {
return autoFocusTransferOnDisposal;
}

// /**
// * Adds the specified popup menu to the component.
// * @param popup the popup menu to be added to the component.
// * @see #remove(MenuComponent)
// * @exception NullPointerException if {@code popup} is {@code null}
// * @since JDK1.1
// */
// public void add(PopupMenu popup) {
// synchronized (getTreeLock()) {
// if (popup.parent != null) {
// popup.parent.remove(popup);
// }
// if (popups == null) {
// popups = new Vector();
// }
// popups.addElement(popup);
// popup.parent = this;
//
// if (peer != null) {
// if (popup.peer == null) {
// popup.addNotify();
// }
// }
// }
// }
/**
* Adds the specified popup menu to the component.
*
* @param popup the popup menu to be added to the component.
* @see #remove(MenuComponent)
* @exception NullPointerException if {@code popup} is {@code null}
* @since JDK1.1
*/
public void add(PopupMenu popup) {
popup.setInvoker(this);
// synchronized (getTreeLock()) {
// if (popup.parent != null) {
// popup.parent.remove(popup);
// }
// if (popups == null) {
// popups = new Vector();
// }
// popups.addElement(popup);
// popup.setInvoker(this);
//// popup.parent = (JComponent) this;
//
// if (peer != null) {
// if (popup.peer == null) {
// popup.addNotify();
// }
// }
// }
}

// /**
// * Removes the specified popup menu from the component.
Expand Down
10 changes: 5 additions & 5 deletions sources/net.sf.j2s.java.core/src/java/awt/JSFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -833,12 +833,12 @@ public Rectangle getMaximizedBounds() {
*/
public void setUndecorated(boolean undecorated) {
/* Make sure we don't run in the middle of peer creation.*/
synchronized (getTreeLock()) {
if (isDisplayable()) {
throw new IllegalComponentStateException("The frame is displayable.");
}
// synchronized (getTreeLock()) {
// if (isDisplayable()) {
// throw new IllegalComponentStateException("The frame is displayable.");
// }
this.undecorated = undecorated;
}
// }
}

/**
Expand Down
77 changes: 77 additions & 0 deletions sources/net.sf.j2s.java.core/src/java/awt/MenuComponent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package java.awt;

public interface MenuComponent {

public void addFocusListener(java.awt.event.FocusListener l);

public boolean contains(Point p);

public void dispatchEvent(AWTEvent e);

public Color getBackground();

public Rectangle getBounds();

public Cursor getCursor();

public FontMetrics getFontMetrics(Font f);

public Color getForeground();

public java.util.Locale getLocale();

public Point getLocation();

public Point getLocationOnScreen();

public String getName();

// public MenuContainer getParent();

public Dimension getSize();

public boolean isEnabled();

public boolean isFocusTraversable();

public boolean isShowing();

public boolean isVisible();

public void removeFocusListener(java.awt.event.FocusListener l);

public void removeNotify();

public void requestFocus();

public void setBackground(Color c);

public void setBounds(Rectangle r);

public void setCursor(Cursor cursor);

public void setEnabled(boolean b);

public void setFont(Font f);

public void setForeground(Color c);

public void setLocation(Point p);

public void setName(String name);

public void setSize(Dimension d);

public void setVisible(boolean b);

// original MenuContainer
Font getFont();

@Deprecated
boolean postEvent(Event evt);

void remove(MenuComponent comp);



}
43 changes: 43 additions & 0 deletions sources/net.sf.j2s.java.core/src/java/awt/MenuContainer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.awt;

/**
* The super class of all menu related containers.
*
* @author Arthur van Hoff
*/

public interface MenuContainer {
Font getFont();
void remove(MenuComponent comp);

/**
* @deprecated As of JDK version 1.1
* replaced by dispatchEvent(AWTEvent).
*/
@Deprecated
boolean postEvent(Event evt);
}
Loading