Skip to content

Commit b5e7018

Browse files
hansonrhansonr
authored andcommitted
Adds J2S.getCachedJavaFile(); update for Frame/Dialog
1 parent c7c7761 commit b5e7018

File tree

7 files changed

+26
-8
lines changed

7 files changed

+26
-8
lines changed
2.96 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181114223438
1+
20181115123646
2.96 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181114223438
1+
20181115123646
2.96 KB
Binary file not shown.

sources/net.sf.j2s.java.core/srcjs/js/j2sApplet.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,10 +671,19 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
671671
return fSuccess;
672672
}
673673

674-
J2S.getSetJavaFileCache = function(cache) {
674+
J2S.getSetJavaFileCache = function(map) {
675675
// called by swingjs.JSUtil
676-
return (cache == null ? J2S._javaFileCache
677-
: (J2S._javaFileCache = cache));
676+
return (map == null ? J2S._javaFileCache
677+
: (J2S._javaFileCache = map));
678+
}
679+
680+
J2S.getCachedJavaFile = function(key) {
681+
// called by Jmol FileManager
682+
if (!J2S._javaFileCache) return null;
683+
var data = J2S._javaFileCache.get$O(key);
684+
if (data == null && key.indexOf("file:/") == 0)
685+
data = J2S._javaFileCache.get$O(key.substring(6));
686+
return data;
678687
}
679688

680689
J2S._loadFileData = function(applet, fileName, fSuccess, fError, info) {

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11327,10 +11327,19 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
1132711327
return fSuccess;
1132811328
}
1132911329

11330-
J2S.getSetJavaFileCache = function(cache) {
11330+
J2S.getSetJavaFileCache = function(map) {
1133111331
// called by swingjs.JSUtil
11332-
return (cache == null ? J2S._javaFileCache
11333-
: (J2S._javaFileCache = cache));
11332+
return (map == null ? J2S._javaFileCache
11333+
: (J2S._javaFileCache = map));
11334+
}
11335+
11336+
J2S.getCachedJavaFile = function(key) {
11337+
// called by swingjs.JSUtil
11338+
if (!J2S._javaFileCache) return null;
11339+
var data = J2S._javaFileCache.get$S(key);
11340+
if (data == null && key.indexOf("file:/") == 0)
11341+
data = J2S._javaFileCache.get$O(key.substring(6));
11342+
return data;
1133411343
}
1133511344

1133611345
J2S._loadFileData = function(applet, fileName, fSuccess, fError, info) {

0 commit comments

Comments
 (0)