Thanks to visit codestin.com
Credit goes to github.com

Skip to content

2021 Feb/Mar updates #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
dda5491
Frame not necessary; shutdown does not prevent process.
Jan 15, 2021
91adc23
adds Class.getConstructors()
Feb 1, 2021
2fd912c
JSTextPaneUI proper preferredSize, text components "pass through" for
Feb 1, 2021
29ef080
comment out
Feb 1, 2021
eacad56
passthrough
Feb 1, 2021
fe0eac1
JViewport cleanup
Feb 1, 2021
11d5e99
Component peer == null on JPopupMenu
Feb 1, 2021
a3ba6d0
tainting only, no validation if width of AbstractButton unchanged
Feb 1, 2021
5ef07d8
passthrough
Feb 1, 2021
b746bd7
csscolor, JPopupMenu, Constructor
Feb 1, 2021
bd14dd3
JSTableUI width inherit
Feb 1, 2021
b569007
tests and SwingJS-site.zip
Feb 1, 2021
349e09e
JSTableUI fix for column removed that has editor
Feb 4, 2021
48e33cd
site
Feb 4, 2021
cadde2a
issue #208 CompletionStageTest fixed
Feb 4, 2021
54babfd
Long constructor fix for new Long([r,m,s])
Feb 8, 2021
b5af7ae
CSS cursor fix for JSTextUI
Feb 8, 2021
2b591f5
SwingJS-site update with J11 (unnecessary J11.jar; no changes)
Feb 8, 2021
8499222
fix for FocusManager.getCurrentManager()
Feb 13, 2021
54e9d47
implements order for interface with $defaults$
Feb 13, 2021
9817087
Finally! JTextPane and JEditorPane for CTRL-V and tabs
Feb 13, 2021
d56fca9
SwingJS-site.zip update
Feb 13, 2021
c062412
DOMNode setStyles optimization
Feb 27, 2021
5eab2f4
JSTableUI uses own canvas
Feb 27, 2021
c8fcb07
Assets update
Mar 1, 2021
df9b674
Merge pull request #210 from BobHanson/hanson1
BobHanson Mar 2, 2021
371f107
JTableHeader update fix
Mar 21, 2021
f0b6655
JSEditorPane fix for setPage(URL)
Mar 21, 2021
89084da
JTextComponent to set focus only when appropriate
Mar 21, 2021
5820a2b
Allow JSUtil.getBytes to work on URL stream
Mar 21, 2021
1269324
SwingJS-site.zip update; Assets fix for missing item in zip file
Mar 21, 2021
0fe5b83
Merge pull request #211 from BobHanson/hanson1
BobHanson Mar 21, 2021
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-j11.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 @@
20210115055921
20210321064238
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20210115055845
20210208070817
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.3.1/SwingJS-site.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/ver/3.3.1/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20210115055921
20210321064238
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions sources/net.sf.j2s.java.core/src/java/awt/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,8 @@ private void reshapeNativePeer(int x, int y, int width, int height, int op) {
// nativeY += c.y;
// }
// peer.setBounds(nativeX, nativeY, width, height, op);
peer.setBounds(0, 0, width, height, op);
if (peer != null)
peer.setBounds(0, 0, width, height, op);
}

@SuppressWarnings("deprecation")
Expand Down Expand Up @@ -2411,8 +2412,7 @@ protected Dimension prefSizeComp() {
if (dim == null || !(isPreferredSizeSet() || isValid())) {
// synchronized (getTreeLock()) {
dim = (width != 0 || height != 0 ? null
: isDisplayable() ? //
// peer != null) ?
: isDisplayable() && peer != null ? //
peer.getPreferredSize() :
getMinimumSize());
prefSize = dim;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ public ActionEvent(Object source, int id, String command, long when,
this.actionCommand = command;
this.when = when;
this.modifiers = modifiers;
this.bdata = new byte[0];// for e.bdata.doPropagate
}

/**
Expand Down
56 changes: 50 additions & 6 deletions sources/net.sf.j2s.java.core/src/java/lang/Class.java
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,7 @@ public Method[] getMethods() throws SecurityException {
* @since JDK1.1
*/
public Constructor<?>[] getConstructors() throws SecurityException {
return null;// TODO
return /*copyMethods*/(privateGetConstructors());
// // be very careful not to change the stack depth of this
// // checkMemberAccess call for security reasons
// // see java.lang.SecurityManager.checkMemberAccess
Expand Down Expand Up @@ -2043,12 +2043,7 @@ public Method getMethod(String name, Class<?>... paramTypes) throws NoSuchMethod
* @since JDK1.1
*/
public Constructor<T> getConstructor(Class<?>... parameterTypes) throws NoSuchMethodException, SecurityException {
// be very careful not to change the stack depth of this
// checkMemberAccess call for security reasons
// see java.lang.SecurityManager.checkMemberAccess
// checkMemberAccess(Member.PUBLIC, ClassLoader.getCallerClassLoader());
return new Constructor(this, parameterTypes, new Class<?>[0], Member.PUBLIC);
// return getConstructor0(parameterTypes, Member.PUBLIC);
}

/**
Expand Down Expand Up @@ -3111,6 +3106,7 @@ private Method[] privateGetPublicMethods(boolean isAll) {

return ms;


// checkInitted();
// Method[] res = null;
// if (useCaches) {
Expand Down Expand Up @@ -3172,6 +3168,54 @@ private Method[] privateGetPublicMethods(boolean isAll) {
// return res;
}


public Constructor[] $constructors$;


// Returns an array of "root" methods. These Method objects must NOT
// be propagated to the outside world, but must instead be copied
// via ReflectionFactory.copyMethod.
private Constructor[] privateGetConstructors() {
Constructor[] ms;
if ($constructors$ != null) {
// interface hack
ms = new Constructor[$constructors$.length];
for (int i = ms.length; --i >= 0;) {
ms[i] = new Constructor(this, $constructors$[i].getParameterTypes(), null, java.lang.reflect.Modifier.PUBLIC);
}
return ms;
}

ms = new Constructor[0];
String attr = null;
Object o = null;
/**
* @j2sNative
*
*
* var p = this.$clazz$;
*
* for (attr in p) { o = p[attr]; if (
* typeof o == "function"
* && o.exName && o.exName.startsWith("c$")
* && !o.__CLASS_NAME__
* && (o.exClazz == this.$clazz$)
* ) {
*/

Constructor m = new Constructor(this, UNKNOWN_PARAMETERS, null, Modifier.PUBLIC);
m._setJSMethod(o, Modifier.PUBLIC);

/**
* @j2sNative
*
* ms.push(m);
* }}
*/

return ms;
}

// //
// // Helpers for fetchers of one field, method, or constructor
// //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.Map;

import sun.reflect.annotation.AnnotationParser;
import swingjs.api.js.JSFunction;

/**
* This class must be implemented by the VM vendor. This class models a
Expand Down Expand Up @@ -53,12 +54,20 @@ public Constructor(Class<T> declaringClass, Class<?>[] paramTypes, Class<?>[] ch
//parameterTypes = null;
// Special case - constructors with parameters have c$$, not just c$. For whatever reason!
// This signals NOT to add "$" if there are no parameters.
if (paramTypes == null)
paramTypes = Class.NO_PARAMETERS;
this.signature = "c$" + Class.argumentTypesToString(paramTypes);
if (paramTypes != null && paramTypes.length == 0)
paramTypes = null;
this.signature = (paramTypes == Class.UNKNOWN_PARAMETERS
|| paramTypes == null || declaringClass.$constructors$ != null
? "c$" : "c$" + Class.argumentTypesToString(paramTypes));
constr = /** @j2sNative this.Class_.$clazz$[this.signature] || */ null;
}

public void _setJSMethod(Object o, int modifiers) {
constr = o;
signature = /** @j2sNative o && o.exName || */ null;
this.modifiers |= modifiers;
}

/**
* Return a new instance of the declaring class, initialized by dynamically
* invoking the modelled constructor. This reproduces the effect of
Expand Down Expand Up @@ -298,7 +307,8 @@ public String getName() {
* @return the parameter types
*/
public Class<?>[] getParameterTypes() {
return parameterTypes;
return (parameterTypes == Class.UNKNOWN_PARAMETERS ?
parameterTypes = AnnotationParser.JSAnnotationObject.guessMethodParameterTypes(signature) : parameterTypes);
}

/**
Expand Down
Loading