Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.
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 @@
20230124211103
20230202011832
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 @@
20230124211103
20230202011832
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.java.core/.j2s
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ j2s.compiler.read.annotations=true
# customizable list for what annotations to skip
j2s.compiler.ignored.annotations=CallerSensitive;ConstructorProperties;Deprecated;Override;SafeVarargs;SuppressWarnings;FunctionalInterface;Documented;Inherited;Native;Repeatable;Retention;Transient;

#j2s.compiler.nonqualified.packages=org.w3c.dom
j2s.compiler.nonqualified.packages=test.js

#output file name for logging methods declared - delete the file to regenerate a listing
#j2s.log.methods.declared=methodsDeclared.csv
Expand Down
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
9 changes: 6 additions & 3 deletions sources/net.sf.j2s.java.core/src/java/awt/AWTKeyStroke.java
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,12 @@ public String toString() {
}

public String 秘toString() {
// SwingJS just the keycode, avoiding VKCollection.js
return getModifiersText(modifiers)
+ (onKeyRelease ? "released" : "pressed") + " " + keyCode;
if (keyCode == KeyEvent.VK_UNDEFINED) {
return getModifiersText(modifiers) + "typed " + keyChar;
} else {
return getModifiersText(modifiers) +
(onKeyRelease ? "released" : "pressed") + " " + keyCode;
}
}

static private String getModifiersText(int modifiers) {
Expand Down

This file was deleted.

47 changes: 0 additions & 47 deletions sources/net.sf.j2s.java.core/src/javajs/api/GenericZipTools.java

This file was deleted.

6 changes: 0 additions & 6 deletions sources/net.sf.j2s.java.core/src/javajs/api/ZInputStream.java

This file was deleted.

220 changes: 107 additions & 113 deletions sources/net.sf.j2s.java.core/src/javajs/util/PT.java
Original file line number Diff line number Diff line change
Expand Up @@ -1244,124 +1244,118 @@ public static String formatStringF(String strFormat, String key, float floatT) {
return formatString(strFormat, key, null, floatT, Double.NaN, false);
}

public static String formatStringD(String strFormat, String key, double doubleT) {
return formatString(strFormat, key, null, Float.NaN, doubleT, false);
}

public static String formatStringI(String strFormat, String key, int intT) {
return formatString(strFormat, key, "" + intT, Float.NaN, Double.NaN, false);
}

/**
* sprintf emulation uses (almost) c++ standard string formats
*
* 's' string 'i' or 'd' integer, 'e' double, 'f' float, 'p' point3f, 'P' exponential point3f, 'q'
* quaternion/plane/axisangle with added "i" (equal to the insipid "d" --
* digits?)
*
* @param strFormat
* @param list
* a listing of what sort of data will be found in Object[] values, in
* order: s string, f float, i integer, d double, p point3f, q
* quaternion/point4f, S String[], F float[], I int[], and D double[]
* @param values
* Object[] containing above types
* @return formatted string
*/
public static String sprintf(String strFormat, String list, Object[] values) {
if (values == null)
return strFormat;
int n = list.length();
if (n == values.length)
try {
for (int o = 0; o < n; o++) {
if (values[o] == null)
continue;
char c;
switch (c = list.charAt(o)) {
case 's':
strFormat = formatString(strFormat, "s", (String) values[o],
Float.NaN, Double.NaN, true);
break;
case 'f':
strFormat = formatString(strFormat, "f", null,
((Float) values[o]).floatValue(), Double.NaN, true);
break;
case 'i':
strFormat = formatString(strFormat, "d", "" + values[o], Float.NaN,
Double.NaN, true);
strFormat = formatString(strFormat, "i", "" + values[o], Float.NaN,
Double.NaN, true);
break;
case 'd':
strFormat = formatString(strFormat, "e", null, Float.NaN,
((Double) values[o]).doubleValue(), true);
strFormat = formatString(strFormat, "f", null, Float.NaN,
((Double) values[o]).doubleValue(), true);
break;
case 'p':
case 'P':
if (values[o] instanceof T3) {
T3 pVal = (T3) values[o];
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, pVal.x, Double.NaN,
true);
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, pVal.y, Double.NaN,
true);
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, pVal.z, Double.NaN,
true);
} else {
T3d pVal = (T3d) values[o];
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, Float.NaN, pVal.x,
true);
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, Float.NaN, pVal.y,
true);
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, Float.NaN, pVal.z,
true);
}
break;
case 'q':
T4 qVal = (T4) values[o];
strFormat = formatString(strFormat, "q", null, qVal.x, Double.NaN,
true);
strFormat = formatString(strFormat, "q", null, qVal.y, Double.NaN,
true);
strFormat = formatString(strFormat, "q", null, qVal.z, Double.NaN,
true);
strFormat = formatString(strFormat, "q", null, qVal.w, Double.NaN,
true);
break;
case 'S':
String[] sVal = (String[]) values[o];
for (int i = 0; i < sVal.length; i++)
strFormat = formatString(strFormat, "s", sVal[i], Float.NaN,
Double.NaN, true);
break;
case 'F':
float[] fVal = (float[]) values[o];
for (int i = 0; i < fVal.length; i++)
strFormat = formatString(strFormat, "f", null, fVal[i],
Double.NaN, true);
break;
case 'I':
int[] iVal = (int[]) values[o];
for (int i = 0; i < iVal.length; i++)
strFormat = formatString(strFormat, "d", "" + iVal[i], Float.NaN,
Double.NaN, true);
for (int i = 0; i < iVal.length; i++)
strFormat = formatString(strFormat, "i", "" + iVal[i], Float.NaN,
Double.NaN, true);
break;
case 'D':
double[] dVal = (double[]) values[o];
for (int i = 0; i < dVal.length; i++)
strFormat = formatString(strFormat, "e", null, Float.NaN, dVal[i],
true);
}
/**
* sprintf emulation uses (almost) c++ standard string formats
*
* 's' string 'i' or 'd' integer, 'e' double, 'f' float, 'p' point3f, 'P'
* exponential point3f, 'q' quaternion/plane/axisangle with added "i" (equal to
* the insipid "d" -- digits?)
*
* @param strFormat
* @param list a listing of what sort of data will be found in Object[]
* values, in order: s string, f float, i integer, d double, p
* point3f, q quaternion/point4f, S String[], F float[], I
* int[], and D double[]
* @param values Object[] containing above types
* @return formatted string
*/
public static String sprintf(String strFormat, String list, Object[] values) {
if (values == null)
return strFormat;
int n = list.length();
if (n == values.length)
try {
for (int o = 0; o < n; o++) {
if (values[o] == null)
continue;
char c;
switch (c = list.charAt(o)) {
case 's':
strFormat = formatString(strFormat, "s", (String) values[o], Float.NaN, Double.NaN, true);
break;
case 'f':
strFormat = formatString(strFormat, "f", null, ((Float) values[o]).floatValue(), Double.NaN,
true);
break;
case 'i':
strFormat = formatString(strFormat, "d", "" + values[o], Float.NaN, Double.NaN, true);
strFormat = formatString(strFormat, "i", "" + values[o], Float.NaN, Double.NaN, true);
break;
case 'd':
strFormat = formatString(strFormat, "e", null, Float.NaN, ((Double) values[o]).doubleValue(),
true);
strFormat = formatString(strFormat, "f", null, Float.NaN, ((Double) values[o]).doubleValue(),
true);
break;
case 'p':
case 'P':
if (values[o] instanceof T3) {
T3 pVal = (T3) values[o];
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, pVal.x, Double.NaN, true);
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, pVal.y, Double.NaN, true);
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, pVal.z, Double.NaN, true);
} else {
T3d pVal = (T3d) values[o];
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, Float.NaN, pVal.x, true);
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, Float.NaN, pVal.y, true);
strFormat = formatString(strFormat, (c == 'p' ? "p" : "P"), null, Float.NaN, pVal.z, true);
}
break;
case 'q':
if (values[o] instanceof T4) {
T4 qVal = (T4) values[o];
strFormat = formatString(strFormat, "q", null, qVal.x, Double.NaN, true);
strFormat = formatString(strFormat, "q", null, qVal.y, Double.NaN, true);
strFormat = formatString(strFormat, "q", null, qVal.z, Double.NaN, true);
strFormat = formatString(strFormat, "q", null, qVal.w, Double.NaN, true);
} else {
T4d qVal = (T4d) values[o];
strFormat = formatString(strFormat, "q", null, Float.NaN, qVal.x, true);
strFormat = formatString(strFormat, "q", null, Float.NaN, qVal.y, true);
strFormat = formatString(strFormat, "q", null, Float.NaN, qVal.z, true);
strFormat = formatString(strFormat, "q", null, Float.NaN, qVal.w, true);
}
break;

case 'S':
String[] sVal = (String[]) values[o];
for (int i = 0; i < sVal.length; i++)
strFormat = formatString(strFormat, "s", sVal[i], Float.NaN, Double.NaN, true);
break;
case 'F':
float[] fVal = (float[]) values[o];
for (int i = 0; i < fVal.length; i++)
strFormat = formatString(strFormat, "f", null, fVal[i], Double.NaN, true);
break;
case 'I':
int[] iVal = (int[]) values[o];
for (int i = 0; i < iVal.length; i++)
strFormat = formatString(strFormat, "d", "" + iVal[i], Float.NaN, Double.NaN, true);
for (int i = 0; i < iVal.length; i++)
strFormat = formatString(strFormat, "i", "" + iVal[i], Float.NaN, Double.NaN, true);
break;
case 'D':
double[] dVal = (double[]) values[o];
for (int i = 0; i < dVal.length; i++)
strFormat = formatString(strFormat, "e", null, Float.NaN, dVal[i], true);
}

}
return rep(strFormat, "%%", "%");
} catch (Exception e) {
//
}
System.out.println("TextFormat.sprintf error " + list + " " + strFormat);
return rep(strFormat, "%", "?");
}
}
return rep(strFormat, "%%", "%");
} catch (Exception e) {
//
}
System.out.println("TextFormat.sprintf error " + list + " " + strFormat);
return rep(strFormat, "%", "?");
}

/**
*
Expand Down
Loading