non null flashPanel is always instance of FlashPlayerPanel

This commit is contained in:
Honfika
2013-11-24 22:20:56 +01:00
parent 7753c39d88
commit f53d825915

View File

@@ -3145,18 +3145,16 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T
}
}
((CardLayout) viewerCards.getLayout()).show(viewerCards, FLASH_VIEWER_CARD);
if (flashPanel instanceof FlashPlayerPanel) {
if (tempFile != null) {
tempFile.delete();
}
try {
tempFile = File.createTempFile("temp", ".swf");
tempFile.deleteOnExit();
swf.saveTo(new FileOutputStream(tempFile));
flashPanel.displaySWF(tempFile.getAbsolutePath(), backgroundColor, swf.frameRate);
} catch (IOException iex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, "Cannot create tempfile", iex);
}
if (tempFile != null) {
tempFile.delete();
}
try {
tempFile = File.createTempFile("temp", ".swf");
tempFile.deleteOnExit();
swf.saveTo(new FileOutputStream(tempFile));
flashPanel.displaySWF(tempFile.getAbsolutePath(), backgroundColor, swf.frameRate);
} catch (IOException iex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, "Cannot create tempfile", iex);
}
}
}
@@ -3557,9 +3555,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T
}
showCard(CARDFLASHPANEL);
if (flashPanel != null) {
if (flashPanel instanceof FlashPlayerPanel) {
flashPanel.displaySWF(tempFile.getAbsolutePath(), backgroundColor, frameRate);
}
flashPanel.displaySWF(tempFile.getAbsolutePath(), backgroundColor, frameRate);
}
} catch (IOException | com.jpexs.decompiler.flash.action.parser.ParseException ex) {