Issue #344 Reload opened swf

This commit is contained in:
Jindra Petk
2013-08-24 19:02:18 +02:00
parent eab0128c1c
commit 8bfbceec03
4 changed files with 44 additions and 13 deletions

View File

@@ -304,6 +304,29 @@ public class Main {
}
}
public static boolean reloadSWF(){
if (Main.inputStream == null) {
mainFrame.setVisible(false);
Helper.emptyObject(mainFrame);
Cache.clearAll();
System.gc();
mainFrame = null;
showModeFrame();
return true;
} else {
if (inputStream instanceof FileInputStream) {
openFile(file);
} else if (inputStream instanceof BufferedInputStream) {
try {
((BufferedInputStream) inputStream).reset();
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
return openFile(fileTitle, inputStream);
}
return false;
}
}
public static void reloadApp() {
if (loadingDialog != null) {
loadingDialog.setVisible(false);
@@ -313,16 +336,11 @@ public class Main {
proxyFrame.setVisible(false);
proxyFrame = null;
}
if (Main.file == null) {
mainFrame.setVisible(false);
Helper.emptyObject(mainFrame);
Cache.clearAll();
System.gc();
mainFrame = null;
showModeFrame();
} else {
openFile(Main.file);
if(loadFromMemoryFrame != null){
loadFromMemoryFrame.setVisible(false);
loadFromMemoryFrame = null;
}
reloadSWF();
}
public static boolean openFile(String swfFile) {