lazy loading of shaperecords in DefineShape tags

This commit is contained in:
2014-11-09 14:11:50 +01:00
parent f3690a0e3c
commit ebe45ebc7f
9 changed files with 97 additions and 26 deletions
@@ -30,13 +30,11 @@ import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.helpers.Cache;
import com.jpexs.helpers.SerializableImage;
import com.sun.javafx.scene.control.skin.VirtualFlow;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@@ -59,7 +57,7 @@ import javax.swing.JPanel;
*/
public class FolderPreviewPanel extends JPanel {
private static final ExecutorService executor;
private static ExecutorService executor;
private List<TreeItem> items;
private int selectedIndex = -1;
@@ -143,6 +141,8 @@ public class FolderPreviewPanel extends JPanel {
public synchronized void setItems(List<TreeItem> items) {
this.items = items;
executor.shutdownNow();
executor = Executors.newFixedThreadPool(Configuration.parallelSpeedUp.get() ? Configuration.parallelThreadCount.get() : 1);
cachedPreviews.clear();
revalidate();
repaint();
@@ -666,7 +666,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
SWFInputStream tagDataStream = new SWFInputStream(swf, data, 0, data.length);
TagStub copy = new TagStub(swf, tag.getId(), "Unresolved", tag.getOriginalRange(), tagDataStream);
copy.forceWriteAsLong = tag.forceWriteAsLong;
this.editedTag = SWFInputStream.resolveTag(copy, 0, false, true);
this.editedTag = SWFInputStream.resolveTag(copy, 0, false, true, false);
} catch (InterruptedException ex) {
} catch (IOException ex) {
Logger.getLogger(GenericTagTreePanel.class.getName()).log(Level.SEVERE, null, ex);
@@ -630,11 +630,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
showDetail(DETAILCARDEMPTYPANEL);
showCard(CARDEMPTYPANEL);
updateUi(swf);
/*if (first && Configuration.gotoMainClassOnStartup.get()) {
gotoDocumentClass(swf);
}*/
first = false;
}
}
@@ -100,7 +100,7 @@ public class DumpTreeModel implements TreeModel {
SWFInputStream sis = tagStub.getDataStream();
sis.seek(tagStub.getDataPos());
sis.dumpInfo = di;
SWFInputStream.resolveTag(tagStub, 0, false, true);
SWFInputStream.resolveTag(tagStub, 0, false, true, false);
} catch (InterruptedException | IOException ex) {
Logger.getLogger(DumpTreeModel.class.getName()).log(Level.SEVERE, null, ex);
}