Fixed: #2366 Running simple editor on background slowing down other views

This commit is contained in:
Jindra Petřík
2024-11-20 17:05:37 +01:00
parent 4aa84b3631
commit 594cf5c839
4 changed files with 22 additions and 5 deletions
+3
View File
@@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file.
## [Unreleased]
### Fixed
- [#2366] Running simple editor on background slowing down other views
## [22.0.0] - 2024-11-10
### Added
@@ -3658,6 +3660,7 @@ Major version of SWF to XML export changed to 2.
[alpha 9]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha8...alpha9
[alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8
[alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7
[#2366]: https://www.free-decompiler.com/flash/issues/2366
[#1619]: https://www.free-decompiler.com/flash/issues/1619
[#2360]: https://www.free-decompiler.com/flash/issues/2360
[#2357]: https://www.free-decompiler.com/flash/issues/2357
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.easygui;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.gui.MainPanel;
import com.jpexs.decompiler.flash.gui.View;
import java.awt.BorderLayout;
import java.util.ArrayList;
@@ -37,8 +38,8 @@ public class EasyPanel extends JPanel {
private TabSwitcher<SWF> tabSwitcher;
private EasySwfPanel easySwfPanel;
public EasyPanel() {
easySwfPanel = new EasySwfPanel();
public EasyPanel(MainPanel mainPanel) {
easySwfPanel = new EasySwfPanel(mainPanel);
tabSwitcher = new TabSwitcher<>(easySwfPanel);
setLayout(new BorderLayout());
add(tabSwitcher, BorderLayout.CENTER);
@@ -62,6 +63,10 @@ public class EasyPanel extends JPanel {
tabSwitcher.setValue(swf);
}
public void setNoSwf() {
easySwfPanel.setTimelined(null);
}
public SWF getSwf() {
return tabSwitcher.getSelectedValue();
}
@@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
import com.jpexs.decompiler.flash.gui.FasterScrollPane;
import com.jpexs.decompiler.flash.gui.ImagePanel;
import com.jpexs.decompiler.flash.gui.Main;
import com.jpexs.decompiler.flash.gui.MainPanel;
import com.jpexs.decompiler.flash.gui.RegistrationPointPosition;
import com.jpexs.decompiler.flash.gui.TimelinedMaker;
import com.jpexs.decompiler.flash.gui.TransformPanel;
@@ -104,8 +105,9 @@ public class EasySwfPanel extends JPanel {
private static final String PROPERTIES_INSTANCE = "Instance";
private DocumentPropertiesPanel documentPropertiesPanel;
private InstancePropertiesPanel instancePropertiesPanel;
private final MainPanel mainPanel;
public EasySwfPanel() {
public EasySwfPanel(MainPanel mainPanel) {
setLayout(new BorderLayout());
stagePanel = new ImagePanel();
@@ -539,6 +541,7 @@ public class EasySwfPanel extends JPanel {
}
}
});
this.mainPanel = mainPanel;
}
private void updatePropertiesPanel() {
@@ -563,6 +566,9 @@ public class EasySwfPanel extends JPanel {
if (this.timelined == timelined) {
return;
}
if (mainPanel.getCurrentView() != MainPanel.VIEW_EASY) {
timelined = null;
}
this.timelined = timelined;
if (timelined == null) {
stagePanel.clearAll();
@@ -1302,7 +1302,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
welcomePanel = createWelcomePanel();
add(welcomePanel, BorderLayout.CENTER);
easyPanel = new EasyPanel();
easyPanel = new EasyPanel(this);
contentPanel = new JPanel(new CardLayout());
contentPanel.add(welcomePanel, WELCOME_PANEL);
@@ -5678,6 +5678,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
setTreeModel(view);
switch (view) {
case VIEW_DUMP:
easyPanel.setNoSwf();
pinsPanel.setVisible(false);
currentView = view;
Configuration.lastView.set(currentView);
@@ -5693,6 +5694,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
detailPanel.setVisible(false);
return true;
case VIEW_RESOURCES:
easyPanel.setNoSwf();
pinsPanel.setVisible(true);
currentView = view;
Configuration.lastView.set(currentView);
@@ -5728,6 +5730,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
}
return true;
case VIEW_TAGLIST:
easyPanel.setNoSwf();
pinsPanel.setVisible(true);
currentView = view;
Configuration.lastView.set(currentView);