mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-22 23:35:49 +00:00
asX.swfs added to recompile test, actionpanel initalization shoud be called from UI thread, other small fixes
This commit is contained in:
@@ -1079,9 +1079,9 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
}
|
||||
|
||||
public Map<String, ASMSource> getASMs() {
|
||||
Map<String, ASMSource> asms2 = new HashMap<>();
|
||||
getASMs("", tags, asms2);
|
||||
return asms2;
|
||||
Map<String, ASMSource> asms = new HashMap<>();
|
||||
getASMs("", tags, asms);
|
||||
return asms;
|
||||
}
|
||||
|
||||
private static void getASMs(String path, List<? extends ContainerItem> items, Map<String, ASMSource> asms) {
|
||||
|
||||
@@ -16,9 +16,12 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.helpers;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
import java.awt.image.*;
|
||||
import java.awt.Component;
|
||||
import java.awt.Image;
|
||||
import java.awt.image.PixelGrabber;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Adapted from
|
||||
@@ -31,25 +34,25 @@ public class BMPFile extends Component {
|
||||
private final static int BITMAPINFOHEADER_SIZE = 40;
|
||||
//--- Private variable declaration
|
||||
//--- Bitmap file header
|
||||
private byte bitmapFileHeader[] = new byte[14];
|
||||
private byte bfType[] = {'B', 'M'};
|
||||
private final byte bitmapFileHeader[] = new byte[14];
|
||||
private final byte bfType[] = {'B', 'M'};
|
||||
private int bfSize = 0;
|
||||
private int bfReserved1 = 0;
|
||||
private int bfReserved2 = 0;
|
||||
private int bfOffBits = BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE;
|
||||
private final int bfReserved1 = 0;
|
||||
private final int bfReserved2 = 0;
|
||||
private final int bfOffBits = BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE;
|
||||
//--- Bitmap info header
|
||||
private byte bitmapInfoHeader[] = new byte[40];
|
||||
private int biSize = BITMAPINFOHEADER_SIZE;
|
||||
private final byte bitmapInfoHeader[] = new byte[40];
|
||||
private final int biSize = BITMAPINFOHEADER_SIZE;
|
||||
private int biWidth = 0;
|
||||
private int biHeight = 0;
|
||||
private int biPlanes = 1;
|
||||
private int biBitCount = 24;
|
||||
private int biCompression = 0;
|
||||
private final int biPlanes = 1;
|
||||
private final int biBitCount = 24;
|
||||
private final int biCompression = 0;
|
||||
private int biSizeImage = 0x030000;
|
||||
private int biXPelsPerMeter = 0x0;
|
||||
private int biYPelsPerMeter = 0x0;
|
||||
private int biClrUsed = 0;
|
||||
private int biClrImportant = 0;
|
||||
private final int biXPelsPerMeter = 0x0;
|
||||
private final int biYPelsPerMeter = 0x0;
|
||||
private final int biClrUsed = 0;
|
||||
private final int biClrImportant = 0;
|
||||
//--- Bitmap raw data
|
||||
private int bitmap[];
|
||||
//--- File section
|
||||
|
||||
@@ -160,9 +160,12 @@ public class RecompileTest {
|
||||
return name.toLowerCase().endsWith(".swf");
|
||||
}
|
||||
});
|
||||
Object[][] ret = new Object[files.length][1];
|
||||
Object[][] ret = new Object[files.length + 2][1];
|
||||
ret[0][0] = "..\\as2\\as2.swf";
|
||||
ret[1][0] = "..\\as3\\as3.swf";
|
||||
ret[1][0] = ret[0][0]; // todo: remove this line
|
||||
for (int f = 0; f < files.length; f++) {
|
||||
ret[f][0] = files[f].getName();
|
||||
ret[f + 2][0] = files[f].getName();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -54,15 +54,13 @@ public class AboutDialog extends AppDialog {
|
||||
//setSize(new Dimension(300, 320));
|
||||
setTitle(translate("dialog.title"));
|
||||
|
||||
JPanel twoPanes=new JPanel();
|
||||
JPanel twoPanes = new JPanel();
|
||||
twoPanes.setLayout(new BoxLayout(twoPanes, BoxLayout.X_AXIS));
|
||||
|
||||
|
||||
Container cnt = getContentPane();
|
||||
JPanel cp = new JPanel();
|
||||
cp.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
|
||||
cnt.setLayout(new BorderLayout());
|
||||
|
||||
|
||||
|
||||
JPanel appNamePanel = new JPanel(new FlowLayout());
|
||||
JLabel jpLabel = new JLabel("JPEXS");
|
||||
@@ -85,27 +83,24 @@ public class AboutDialog extends AppDialog {
|
||||
decLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
appNamePanel.add(decLabel);
|
||||
appNamePanel.setAlignmentX(0.5f);
|
||||
|
||||
|
||||
|
||||
cp = new JPanel();
|
||||
cp.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
|
||||
cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
|
||||
cp.add(appNamePanel);
|
||||
JLabel verLabel = new JLabel(translate("version") + " " + ApplicationInfo.version);
|
||||
verLabel.setAlignmentX(0.5f);
|
||||
JLabel verLabel = new JLabel(translate("version") + " " + ApplicationInfo.version);
|
||||
verLabel.setAlignmentX(0.5f);
|
||||
//verLabel.setPreferredSize(new Dimension(300, 15));
|
||||
verLabel.setFont(new Font("Tahoma", Font.BOLD, 15));
|
||||
verLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
cp.add(verLabel);
|
||||
|
||||
|
||||
cnt.add(cp,BorderLayout.NORTH);
|
||||
cnt.add(cp, BorderLayout.NORTH);
|
||||
|
||||
cp = new JPanel();
|
||||
cp.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
|
||||
cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
|
||||
|
||||
|
||||
|
||||
JLabel byLabel = new JLabel(translate("by"));
|
||||
byLabel.setAlignmentX(0.5f);
|
||||
byLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
@@ -124,7 +119,7 @@ public class AboutDialog extends AppDialog {
|
||||
//dateLabel.setPreferredSize(new Dimension(300, 10));
|
||||
dateLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
cp.add(dateLabel);
|
||||
|
||||
|
||||
LinkLabel wwwLabel = new LinkLabel(ApplicationInfo.PROJECT_PAGE);
|
||||
wwwLabel.setAlignmentX(0.5f);
|
||||
wwwLabel.setForeground(Color.blue);
|
||||
@@ -148,36 +143,31 @@ public class AboutDialog extends AppDialog {
|
||||
developersLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
developersLabel.setFont(developersLabel.getFont().deriveFont(Font.BOLD));
|
||||
cp.add(developersLabel);
|
||||
|
||||
|
||||
|
||||
for (String c : DEVELOPERS) {
|
||||
JLabel developerNameLabel = new JLabel(c);
|
||||
developerNameLabel.setAlignmentX(0.5f);
|
||||
developerNameLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
cp.add(developerNameLabel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cp.setAlignmentY(0);
|
||||
twoPanes.add(cp);
|
||||
cp = new JPanel();
|
||||
cp.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
|
||||
cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
|
||||
|
||||
cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
|
||||
|
||||
JLabel translatorsLabel = new JLabel(translate("translators"));
|
||||
translatorsLabel.setAlignmentX(0.5f);
|
||||
translatorsLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
translatorsLabel.setFont(translatorsLabel.getFont().deriveFont(Font.BOLD));
|
||||
cp.add(translatorsLabel);
|
||||
|
||||
List<String> translators=new ArrayList<>();
|
||||
for(String code:SelectLanguageDialog.languages){
|
||||
|
||||
List<String> translators = new ArrayList<>();
|
||||
for (String code : SelectLanguageDialog.languages) {
|
||||
Locale l = Locale.forLanguageTag(code.equals("en") ? "" : code);
|
||||
ResourceBundle b = ResourceBundle.getBundle(AppStrings.getResourcePath(AboutDialog.class),l);
|
||||
translators.add(Locale.forLanguageTag(code).getDisplayName()+" - "+b.getString("translation.author"));
|
||||
ResourceBundle b = ResourceBundle.getBundle(AppStrings.getResourcePath(AboutDialog.class), l);
|
||||
translators.add(Locale.forLanguageTag(code).getDisplayName() + " - " + b.getString("translation.author"));
|
||||
}
|
||||
for (String c : translators) {
|
||||
JLabel translatorName = new JLabel(c);
|
||||
@@ -189,10 +179,10 @@ public class AboutDialog extends AppDialog {
|
||||
cp.add(Box.createVerticalStrut(10));
|
||||
cp.setAlignmentY(0);
|
||||
twoPanes.add(cp);
|
||||
|
||||
|
||||
cnt.add(twoPanes, BorderLayout.CENTER);
|
||||
cp = new JPanel(new FlowLayout());
|
||||
cnt.add(cp,BorderLayout.SOUTH);
|
||||
cnt.add(cp, BorderLayout.SOUTH);
|
||||
JButton okButton = new JButton(translate("button.ok"));
|
||||
okButton.setAlignmentX(0.5f);
|
||||
cp.add(okButton);
|
||||
@@ -207,6 +197,6 @@ public class AboutDialog extends AppDialog {
|
||||
View.setWindowIcon(this);
|
||||
setResizable(false);
|
||||
pack();
|
||||
View.centerScreen(this);
|
||||
View.centerScreen(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,11 +136,9 @@ import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FilenameFilter;
|
||||
@@ -158,7 +156,6 @@ import java.util.concurrent.CancellationException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.sound.sampled.LineUnavailableException;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import javax.swing.Box;
|
||||
@@ -185,7 +182,6 @@ import javax.swing.event.TreeSelectionListener;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
import javax.swing.plaf.basic.BasicTreeUI;
|
||||
import javax.swing.tree.TreePath;
|
||||
import org.monte.media.io.ByteArrayImageInputStream;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -611,8 +607,14 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
|
||||
private void ensureActionPanel() {
|
||||
if (actionPanel == null) {
|
||||
actionPanel = new ActionPanel(this);
|
||||
displayPanel.add(actionPanel, CARDACTIONSCRIPTPANEL);
|
||||
final MainPanel diz = this;
|
||||
View.execInEventDispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
actionPanel = new ActionPanel(diz);
|
||||
displayPanel.add(actionPanel, CARDACTIONSCRIPTPANEL);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1098,7 +1100,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void searchAs() {
|
||||
if (searchDialog == null) {
|
||||
searchDialog = new SearchDialog(getMainFrame().getWindow());
|
||||
@@ -1900,8 +1902,8 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
if (selectedFile != null) {
|
||||
Configuration.lastOpenDir.set(Helper.fixDialogFile(selectedFile).getParentFile().getAbsolutePath());
|
||||
File selfile = Helper.fixDialogFile(selectedFile);
|
||||
byte[] data = Helper.readFile(selfile.getAbsolutePath());
|
||||
try {
|
||||
byte[] data = Helper.readFile(selfile.getAbsolutePath());
|
||||
try {
|
||||
Tag newTag = new ShapeImporter().importImage(st, data);
|
||||
if (newTag != null) {
|
||||
refreshTree();
|
||||
|
||||
@@ -44,8 +44,7 @@ public class SelectLanguageDialog extends AppDialog implements ActionListener {
|
||||
JComboBox<Language> languageCombobox = new JComboBox<>();
|
||||
public String languageCode = null;
|
||||
public static final String[] languages = new String[]{"en", "ca", "cs", "zh", "de", "es", "fr", "hu", "nl", "pl", "pt", "pt-BR", "ru", "sv", "uk"};
|
||||
|
||||
|
||||
|
||||
public SelectLanguageDialog() {
|
||||
setSize(350, 130);
|
||||
Container cnt1 = getContentPane();
|
||||
|
||||
@@ -491,7 +491,7 @@ public class ProxyFrame extends AppFrame implements ActionListener, CatchedListe
|
||||
Logger.getLogger(ProxyFrame.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
tableModel.setRowCount(0);
|
||||
tableModel.setRowCount(0);
|
||||
reps.clear();
|
||||
break;
|
||||
case ACTION_REMOVE:
|
||||
|
||||
Reference in New Issue
Block a user