Skip to content

Commit 82076af

Browse files
authored
Merge pull request #78 from BobHanson/master
update after physicsapplets work (Haverford)
2 parents 64996e3 + ce8c441 commit 82076af

File tree

22 files changed

+803
-458
lines changed

22 files changed

+803
-458
lines changed
3.77 MB
Binary file not shown.

sources/net.sf.j2s.core/dist/README.txt

Lines changed: 318 additions & 97 deletions
Large diffs are not rendered by default.
3.77 MB
Binary file not shown.
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<<<<<<< Upstream, based on branch 'yadav1' of https://github.com/BobHanson/java2script.git
2-
20180827111114
3-
=======
4-
20180827113308
5-
>>>>>>> 7e507a2 refactoring mouse events and tooltip
1+
20180913053826
3.77 MB
Binary file not shown.
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<<<<<<< Upstream, based on branch 'yadav1' of https://github.com/BobHanson/java2script.git
2-
20180827111114
3-
=======
4-
20180827113308
5-
>>>>>>> 7e507a2 refactoring mouse events and tooltip
1+
20180913053826

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

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
* @author Bob Hanson
3333
*
3434
*/
35-
public class Java2ScriptCompiler {
35+
class Java2ScriptCompiler {
3636
/**
3737
* The name of the J2S options file, aka as the "Dot-j2s" file.
3838
*/
39-
public static final String J2S_OPTIONS_FILE_NAME = ".j2s";
39+
private static final String J2S_OPTIONS_FILE_NAME = ".j2s";
4040

4141
// BH: added "true".equals(getProperty(props,
4242
// "j2s.compiler.allow.compression")) to ensure compression only occurs when
@@ -77,15 +77,15 @@ public class Java2ScriptCompiler {
7777

7878
private IJavaProject project;
7979

80-
public static boolean isActive(IJavaProject project) {
80+
static boolean isActive(IJavaProject project) {
8181
try {
8282
return new File(project.getProject().getLocation().toOSString(), J2S_OPTIONS_FILE_NAME).exists();
8383
} catch (@SuppressWarnings("unused") Exception e) {
8484
return false;
8585
}
8686
}
8787

88-
public Java2ScriptCompiler() {
88+
Java2ScriptCompiler() {
8989
// initialized only once using CompilationParticipant; every time using
9090
// older Builder idea
9191
}
@@ -94,7 +94,7 @@ public Java2ScriptCompiler() {
9494
* only for CompilationParticipant
9595
* @param isClean
9696
*/
97-
public void startBuild(boolean isClean) {
97+
void startBuild(boolean isClean) {
9898
// at the beginning of a clean build, clear data
9999
isCleanBuild = isClean;
100100
htmlTemplate = null;
@@ -106,19 +106,7 @@ public void startBuild(boolean isClean) {
106106

107107
}
108108

109-
// /**
110-
// * old way from original builder
111-
// *
112-
// */
113-
// public void process(ICompilationUnit sourceUnit, IContainer binaryFolder) {
114-
// if (!(sourceUnit instanceof SourceFile))
115-
// return;
116-
// if (!initializeProject(binaryFolder.getProject(), false))
117-
// return;
118-
// compileToJavaScript(((SourceFile) sourceUnit).resource);
119-
// }
120-
121-
/**
109+
/**
122110
* from Java2ScriptCompilationParticipant.java
123111
*
124112
* get all necessary .j2s params for a build
@@ -128,7 +116,7 @@ public void startBuild(boolean isClean) {
128116
* @return true if this is a j2s project and is enabled
129117
*
130118
*/
131-
public boolean initializeProject(IJavaProject project, boolean isCompilationParticipant) {
119+
boolean initializeProject(IJavaProject project, boolean isCompilationParticipant) {
132120
this.project = project;
133121
this.isCompilationParticipant = isCompilationParticipant;
134122
if (!isActive(project)) {
@@ -246,7 +234,7 @@ public boolean initializeProject(IJavaProject project, boolean isCompilationPart
246234
*
247235
* @param javaSource
248236
*/
249-
public boolean compileToJavaScript(IFile javaSource) {
237+
boolean compileToJavaScript(IFile javaSource) {
250238

251239
String fileName = new String(javaSource.getName());
252240
if (lstExcludedPaths != null) {
@@ -312,6 +300,9 @@ public boolean compileToJavaScript(IFile javaSource) {
312300
return true;
313301
}
314302

303+
//// private methods ////
304+
305+
315306
private void logMethods(String logCalled, String logDeclared, boolean doAppend) {
316307
if (htMethodsCalled != null)
317308
try {
@@ -353,7 +344,7 @@ private String getProperty(String key) {
353344
return val;
354345
}
355346

356-
public void outputJavaScript(Java2ScriptVisitor visitor,
347+
private void outputJavaScript(Java2ScriptVisitor visitor,
357348
// DependencyASTVisitor dvisitor, CompilationUnit fRoot,
358349
String j2sPath) {
359350

@@ -420,6 +411,8 @@ private void writeToFile(File file, String data) {
420411
/**
421412
* The default .j2s file. Replaces .j2s only if it is found but is empty.
422413
*
414+
* OK, I know this should be a resource.
415+
*
423416
*
424417
*
425418
*/

sources/net.sf.j2s.java.core/build_core_applet.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
java/util/Hashtable.js
126126
java/util/IdentityHashMap.js
127127
java/util/Locale.js
128-
java/util/MapEntry.js
129128
javajs/api/JSFunction.js
130129
javajs/util/AjaxURLConnection.js
131130
javajs/util/AjaxURLStreamHandlerFactory.js
3.77 MB
Binary file not shown.

sources/net.sf.j2s.java.core/src/java/awt/Component.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7217,6 +7217,7 @@ protected String paramString() {
72177217
protected String paramStringComp() {
72187218
String thisName = getName();
72197219
String str = (thisName != null ? thisName : "");
7220+
str += (/** @j2sNative this.__JSID__ + */"");
72207221
if (!isValid()) {
72217222
str += ",invalid";
72227223
}

0 commit comments

Comments
 (0)