mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 05:10:47 +00:00
dump view: basic hex view (should be changed to a real hex view component)
This commit is contained in:
@@ -1526,7 +1526,7 @@ public final class SWF implements TreeItem, Timelined {
|
||||
final Color fbackgroundColor=backgroundColor;
|
||||
final Iterator<BufferedImage> frameImages = new Iterator<BufferedImage>() {
|
||||
|
||||
private int pos=0;
|
||||
private final int pos=0;
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
|
||||
@@ -129,10 +129,10 @@ public class ActionScriptParser {
|
||||
private final boolean debugMode = false;
|
||||
private static final String AS3_NAMESPACE = "http://adobe.com/AS3/2006/builtin";
|
||||
|
||||
private ABC abc;
|
||||
private List<ABC> otherABCs;
|
||||
private final ABC abc;
|
||||
private final List<ABC> otherABCs;
|
||||
|
||||
private static List<ABC> playerABCs = new ArrayList<>();
|
||||
private static final List<ABC> playerABCs = new ArrayList<>();
|
||||
|
||||
private long uniqId() {
|
||||
uniqLast++;
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.parser.script;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class BreakJumpIns extends JumpIns {
|
||||
|
||||
private long loopId;
|
||||
|
||||
public BreakJumpIns(long loopId) {
|
||||
this.loopId = loopId;
|
||||
}
|
||||
|
||||
public long getLoopId() {
|
||||
return loopId;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright (C) 2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.parser.script;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class BreakJumpIns extends JumpIns {
|
||||
|
||||
private final long loopId;
|
||||
|
||||
public BreakJumpIns(long loopId) {
|
||||
this.loopId = loopId;
|
||||
}
|
||||
|
||||
public long getLoopId() {
|
||||
return loopId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.jpexs.decompiler.graph.model.LocalData;
|
||||
public class ConstAVM2Item extends AVM2Item {
|
||||
|
||||
private final int namespace;
|
||||
private boolean isStatic;
|
||||
private final boolean isStatic;
|
||||
public String var;
|
||||
public GraphTargetItem type;
|
||||
public String customNamespace;
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.parser.script;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class ContinueJumpIns extends JumpIns {
|
||||
|
||||
private long loopId;
|
||||
|
||||
public ContinueJumpIns(long loopId) {
|
||||
this.loopId = loopId;
|
||||
}
|
||||
|
||||
public long getLoopId() {
|
||||
return loopId;
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright (C) 2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.parser.script;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class ContinueJumpIns extends JumpIns {
|
||||
|
||||
private final long loopId;
|
||||
|
||||
public ContinueJumpIns(long loopId) {
|
||||
this.loopId = loopId;
|
||||
}
|
||||
|
||||
public long getLoopId() {
|
||||
return loopId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.parser.script;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class FinallyJumpIns extends JumpIns {
|
||||
|
||||
private long finallyClauseId;
|
||||
|
||||
public FinallyJumpIns(long finallyClauseId) {
|
||||
this.finallyClauseId = finallyClauseId;
|
||||
}
|
||||
|
||||
public long getClauseId() {
|
||||
return finallyClauseId;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright (C) 2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.parser.script;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class FinallyJumpIns extends JumpIns {
|
||||
|
||||
private final long finallyClauseId;
|
||||
|
||||
public FinallyJumpIns(long finallyClauseId) {
|
||||
this.finallyClauseId = finallyClauseId;
|
||||
}
|
||||
|
||||
public long getClauseId() {
|
||||
return finallyClauseId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ import java.util.List;
|
||||
*/
|
||||
public class IndexAVM2Item extends AssignableAVM2Item {
|
||||
|
||||
private List<Integer> openedNamespaces;
|
||||
private final List<Integer> openedNamespaces;
|
||||
public GraphTargetItem object;
|
||||
public GraphTargetItem index;
|
||||
public boolean attr;
|
||||
|
||||
@@ -27,9 +27,9 @@ import java.util.List;
|
||||
*/
|
||||
public class MethodAVM2Item extends FunctionAVM2Item {
|
||||
|
||||
private boolean isStatic;
|
||||
private boolean isFinal;
|
||||
private boolean override;
|
||||
private final boolean isStatic;
|
||||
private final boolean isFinal;
|
||||
private final boolean override;
|
||||
public String customNamespace;
|
||||
public boolean isInterface;
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
|
||||
public GraphTargetItem object;
|
||||
public ABC abc;
|
||||
public List<ABC> otherABCs;
|
||||
private List<Integer> openedNamespaces;
|
||||
private List<MethodBody> callStack;
|
||||
private final List<Integer> openedNamespaces;
|
||||
private final List<MethodBody> callStack;
|
||||
public List<GraphTargetItem> scopeStack = new ArrayList<GraphTargetItem>();
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.jpexs.decompiler.graph.model.LocalData;
|
||||
public class SlotAVM2Item extends AVM2Item {
|
||||
|
||||
private final int namespace;
|
||||
private boolean isStatic;
|
||||
private final boolean isStatic;
|
||||
public String var;
|
||||
public GraphTargetItem type;
|
||||
public String customNamespace;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item {
|
||||
//private GraphTargetItem ns = null;
|
||||
public GraphTargetItem resolved;
|
||||
public GraphTargetItem resolvedRoot;
|
||||
private boolean mustBeType;
|
||||
private final boolean mustBeType;
|
||||
public List<String> importedClasses;
|
||||
public List<GraphTargetItem> scopeStack = new ArrayList<GraphTargetItem>();
|
||||
public List<GraphTargetItem> subtypes;
|
||||
|
||||
@@ -153,7 +153,7 @@ import java.util.List;
|
||||
*/
|
||||
public class ActionScriptParser {
|
||||
|
||||
private int swfVersion;
|
||||
private final int swfVersion;
|
||||
|
||||
public ActionScriptParser(int swfVersion) {
|
||||
this.swfVersion = swfVersion;
|
||||
|
||||
@@ -596,7 +596,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
return ret;
|
||||
}
|
||||
private final List<String> constantPool;
|
||||
private int swfVersion;
|
||||
private final int swfVersion;
|
||||
|
||||
public int getSwfVersion() {
|
||||
return swfVersion;
|
||||
|
||||
@@ -56,7 +56,7 @@ import javax.swing.table.DefaultTableModel;
|
||||
*/
|
||||
public class AdvancedSettingsDialog extends AppDialog implements ActionListener {
|
||||
|
||||
private Map<String, Component> componentsMap = new HashMap<>();
|
||||
private final Map<String, Component> componentsMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Creates new form AdvancedSettingsDialog
|
||||
|
||||
@@ -24,6 +24,7 @@ import javax.swing.JTree;
|
||||
import javax.swing.plaf.basic.BasicLabelUI;
|
||||
import javax.swing.plaf.basic.BasicTreeUI;
|
||||
import javax.swing.tree.DefaultTreeCellRenderer;
|
||||
import javax.swing.tree.TreeModel;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -72,4 +73,17 @@ public class DumpTree extends JTree {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setModel(TreeModel tm) {
|
||||
super.setModel(tm);
|
||||
if (tm != null) {
|
||||
int rowCount = tm.getChildCount(tm.getRoot());
|
||||
for (int i = rowCount - 1; i >= 0; i--) {
|
||||
expandRow(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
import javax.swing.table.JTableHeader;
|
||||
import javax.swing.table.TableColumn;
|
||||
import javax.swing.table.TableColumnModel;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class DumpViewPanel extends JPanel {
|
||||
|
||||
private final int bytesInRow = 16;
|
||||
private final JLabel dumpViewLabel;
|
||||
private final JTable dumpViewHexTable;
|
||||
private byte[] data;
|
||||
|
||||
public DumpViewPanel() {
|
||||
super(new BorderLayout());
|
||||
|
||||
dumpViewLabel = new JLabel();
|
||||
dumpViewLabel.setMinimumSize(new Dimension(100, 20));
|
||||
add(dumpViewLabel, BorderLayout.SOUTH);
|
||||
|
||||
dumpViewHexTable = new JTable();
|
||||
dumpViewHexTable.setBackground(Color.white);
|
||||
dumpViewHexTable.setFont(new Font("Monospaced", Font.PLAIN, 12));
|
||||
dumpViewHexTable.setTableHeader(new JTableHeader());
|
||||
dumpViewHexTable.setMaximumSize(new Dimension(200, 200));
|
||||
TableColumnModel columnModel = dumpViewHexTable.getColumnModel();
|
||||
columnModel.addColumn(new TableColumn());
|
||||
columnModel.getColumn(0).setMinWidth(100);
|
||||
for (int i = 0; i < bytesInRow; i++) {
|
||||
columnModel.addColumn(new TableColumn());
|
||||
columnModel.getColumn(i + 1).setWidth(20);
|
||||
}
|
||||
for (int i = 0; i < bytesInRow; i++) {
|
||||
columnModel.addColumn(new TableColumn());
|
||||
columnModel.getColumn(i + bytesInRow + 1).setWidth(10);
|
||||
}
|
||||
dumpViewHexTable.setShowHorizontalLines(false);
|
||||
dumpViewHexTable.setModel(new AbstractTableModel() {
|
||||
|
||||
@Override
|
||||
public int getRowCount() {
|
||||
if (data == null) {
|
||||
return 0;
|
||||
}
|
||||
int byteCount = data.length;
|
||||
int rowCount = byteCount / bytesInRow;
|
||||
if (byteCount + bytesInRow != 0) {
|
||||
rowCount++;
|
||||
}
|
||||
return rowCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColumnCount() {
|
||||
return 2*bytesInRow + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColumnName(int column) {
|
||||
if (column == 0) {
|
||||
return "Address";
|
||||
} else if (column <= bytesInRow) {
|
||||
return String.format("%01X", column - 1);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int row, int column) {
|
||||
if (column == 0) {
|
||||
return String.format("%08X", (long) row * bytesInRow);
|
||||
} else if (column <= bytesInRow) {
|
||||
int pos = row * bytesInRow + column - 1;
|
||||
if (pos < data.length) {
|
||||
return String.format("%02X", data[pos]);
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
int pos = row * bytesInRow + column - bytesInRow - 1;
|
||||
if (pos < data.length) {
|
||||
return (char)data[pos];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
add(new JScrollPane(dumpViewHexTable), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
public void setData(byte[] data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public void setLabelText(String text) {
|
||||
dumpViewLabel.setText(text);
|
||||
}
|
||||
}
|
||||
@@ -1,129 +1,129 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ComponentAdapter;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowStateListener;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public final class MainFrameClassic extends AppFrame implements MainFrame {
|
||||
|
||||
public MainPanel panel;
|
||||
private MainFrameMenu mainMenu;
|
||||
|
||||
public MainFrameClassic() {
|
||||
super();
|
||||
|
||||
FlashPlayerPanel flashPanel = null;
|
||||
try {
|
||||
flashPanel = new FlashPlayerPanel(this);
|
||||
} catch (FlashUnsupportedException fue) {
|
||||
}
|
||||
|
||||
boolean externalFlashPlayerUnavailable = flashPanel == null;
|
||||
mainMenu = new MainFrameClassicMenu(this, externalFlashPlayerUnavailable);
|
||||
|
||||
panel = new MainPanel(this, mainMenu, flashPanel);
|
||||
|
||||
int w = Configuration.guiWindowWidth.get();
|
||||
int h = Configuration.guiWindowHeight.get();
|
||||
Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
|
||||
if (w > dim.width) {
|
||||
w = dim.width;
|
||||
}
|
||||
if (h > dim.height) {
|
||||
h = dim.height;
|
||||
}
|
||||
setSize(w, h);
|
||||
|
||||
boolean maximizedHorizontal = Configuration.guiWindowMaximizedHorizontal.get();
|
||||
boolean maximizedVertical = Configuration.guiWindowMaximizedVertical.get();
|
||||
|
||||
int state = 0;
|
||||
if (maximizedHorizontal) {
|
||||
state |= JFrame.MAXIMIZED_HORIZ;
|
||||
}
|
||||
if (maximizedVertical) {
|
||||
state |= JFrame.MAXIMIZED_VERT;
|
||||
}
|
||||
setExtendedState(state);
|
||||
|
||||
View.setWindowIcon(this);
|
||||
addWindowStateListener(new WindowStateListener() {
|
||||
@Override
|
||||
public void windowStateChanged(WindowEvent e) {
|
||||
int state = e.getNewState();
|
||||
Configuration.guiWindowMaximizedHorizontal.set((state & JFrame.MAXIMIZED_HORIZ) == JFrame.MAXIMIZED_HORIZ);
|
||||
Configuration.guiWindowMaximizedVertical.set((state & JFrame.MAXIMIZED_VERT) == JFrame.MAXIMIZED_VERT);
|
||||
}
|
||||
});
|
||||
addComponentListener(new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
int state = getExtendedState();
|
||||
if ((state & JFrame.MAXIMIZED_HORIZ) == 0) {
|
||||
Configuration.guiWindowWidth.set(getWidth());
|
||||
}
|
||||
if ((state & JFrame.MAXIMIZED_VERT) == 0) {
|
||||
Configuration.guiWindowHeight.set(getHeight());
|
||||
}
|
||||
}
|
||||
});
|
||||
addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
Main.exit();
|
||||
}
|
||||
});
|
||||
|
||||
java.awt.Container cnt = getContentPane();
|
||||
cnt.setLayout(new BorderLayout());
|
||||
cnt.add(panel);
|
||||
|
||||
View.centerScreen(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean b) {
|
||||
super.setVisible(b);
|
||||
panel.setVisible(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MainPanel getPanel() {
|
||||
return panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Window getWindow() {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright (C) 2010-2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ComponentAdapter;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowStateListener;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public final class MainFrameClassic extends AppFrame implements MainFrame {
|
||||
|
||||
public MainPanel panel;
|
||||
private final MainFrameMenu mainMenu;
|
||||
|
||||
public MainFrameClassic() {
|
||||
super();
|
||||
|
||||
FlashPlayerPanel flashPanel = null;
|
||||
try {
|
||||
flashPanel = new FlashPlayerPanel(this);
|
||||
} catch (FlashUnsupportedException fue) {
|
||||
}
|
||||
|
||||
boolean externalFlashPlayerUnavailable = flashPanel == null;
|
||||
mainMenu = new MainFrameClassicMenu(this, externalFlashPlayerUnavailable);
|
||||
|
||||
panel = new MainPanel(this, mainMenu, flashPanel);
|
||||
|
||||
int w = Configuration.guiWindowWidth.get();
|
||||
int h = Configuration.guiWindowHeight.get();
|
||||
Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
|
||||
if (w > dim.width) {
|
||||
w = dim.width;
|
||||
}
|
||||
if (h > dim.height) {
|
||||
h = dim.height;
|
||||
}
|
||||
setSize(w, h);
|
||||
|
||||
boolean maximizedHorizontal = Configuration.guiWindowMaximizedHorizontal.get();
|
||||
boolean maximizedVertical = Configuration.guiWindowMaximizedVertical.get();
|
||||
|
||||
int state = 0;
|
||||
if (maximizedHorizontal) {
|
||||
state |= JFrame.MAXIMIZED_HORIZ;
|
||||
}
|
||||
if (maximizedVertical) {
|
||||
state |= JFrame.MAXIMIZED_VERT;
|
||||
}
|
||||
setExtendedState(state);
|
||||
|
||||
View.setWindowIcon(this);
|
||||
addWindowStateListener(new WindowStateListener() {
|
||||
@Override
|
||||
public void windowStateChanged(WindowEvent e) {
|
||||
int state = e.getNewState();
|
||||
Configuration.guiWindowMaximizedHorizontal.set((state & JFrame.MAXIMIZED_HORIZ) == JFrame.MAXIMIZED_HORIZ);
|
||||
Configuration.guiWindowMaximizedVertical.set((state & JFrame.MAXIMIZED_VERT) == JFrame.MAXIMIZED_VERT);
|
||||
}
|
||||
});
|
||||
addComponentListener(new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
int state = getExtendedState();
|
||||
if ((state & JFrame.MAXIMIZED_HORIZ) == 0) {
|
||||
Configuration.guiWindowWidth.set(getWidth());
|
||||
}
|
||||
if ((state & JFrame.MAXIMIZED_VERT) == 0) {
|
||||
Configuration.guiWindowHeight.set(getHeight());
|
||||
}
|
||||
}
|
||||
});
|
||||
addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
Main.exit();
|
||||
}
|
||||
});
|
||||
|
||||
java.awt.Container cnt = getContentPane();
|
||||
cnt.setLayout(new BorderLayout());
|
||||
cnt.add(panel);
|
||||
|
||||
View.centerScreen(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean b) {
|
||||
super.setVisible(b);
|
||||
panel.setVisible(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MainPanel getPanel() {
|
||||
return panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Window getWindow() {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationM
|
||||
public final class MainFrameRibbon extends AppRibbonFrame implements MainFrame {
|
||||
|
||||
public MainPanel panel;
|
||||
private MainFrameMenu mainMenu;
|
||||
private final MainFrameMenu mainMenu;
|
||||
|
||||
public MainFrameRibbon() {
|
||||
super();
|
||||
|
||||
@@ -619,7 +619,7 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener {
|
||||
mainFrame.panel.reload(true);
|
||||
break;
|
||||
case ACTION_DUMP_VIEW_SWITCH:
|
||||
Configuration.internalFlashViewer.set(miDumpView.isSelected());
|
||||
Configuration.dumpView.set(miDumpView.isSelected());
|
||||
mainFrame.panel.showDumpView(miDumpView.isSelected());
|
||||
break;
|
||||
case ACTION_SEARCH:
|
||||
|
||||
@@ -227,8 +227,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
private final JPanel contentPanel;
|
||||
private final JPanel displayPanel;
|
||||
private JPanel folderPreviewPanel;
|
||||
private JPanel dumpViewPanel;
|
||||
private JLabel dumpViewLabel; // very very simple dump view, todo: hexview with virtual scrolling
|
||||
private boolean isWelcomeScreen = true;
|
||||
private static final String CARDPREVIEWPANEL = "Preview card";
|
||||
private static final String CARDFOLDERPREVIEWPANEL = "Folder preview card";
|
||||
@@ -246,8 +244,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
private JPanel detailPanel;
|
||||
private JTextField filterField = new MyTextField("");
|
||||
private JPanel searchPanel;
|
||||
private PreviewPanel previewPanel;
|
||||
private JPanel treePanel;
|
||||
private final PreviewPanel previewPanel;
|
||||
private DumpViewPanel dumpViewPanel;
|
||||
private final JPanel treePanel;
|
||||
private AbortRetryIgnoreHandler errorHandler = new GuiAbortRetryIgnoreHandler();
|
||||
private CancellableWorker setSourceWorker;
|
||||
public TreeNode oldNode;
|
||||
@@ -502,9 +501,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
|
||||
private JPanel createDumpPreviewCard() {
|
||||
JPanel dumpViewCard = new JPanel(new BorderLayout());
|
||||
dumpViewPanel = new JPanel(new WrapLayout(FlowLayout.LEFT));
|
||||
dumpViewLabel = new JLabel();
|
||||
dumpViewPanel.add(dumpViewLabel);
|
||||
dumpViewPanel = new DumpViewPanel();
|
||||
dumpViewCard.add(new JScrollPane(dumpViewPanel), BorderLayout.CENTER);
|
||||
|
||||
return dumpViewCard;
|
||||
@@ -1761,7 +1758,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
File textsFolder = new File(Path.combine(folder, TextExporter.TEXT_EXPORT_FOLDER));
|
||||
String[] files = textsFolder.list(new FilenameFilter() {
|
||||
|
||||
private Pattern pat = Pattern.compile("\\d+\\.txt", Pattern.CASE_INSENSITIVE);
|
||||
private final Pattern pat = Pattern.compile("\\d+\\.txt", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
@@ -2385,15 +2382,19 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
}
|
||||
|
||||
private void dumpTreeValueChanged(TreeSelectionEvent e) {
|
||||
showCard(CARDDUMPVIEW);
|
||||
DumpInfo dumpInfo = (DumpInfo) e.getPath().getLastPathComponent();
|
||||
if (dumpInfo.lengthBytes != 0 || dumpInfo.lengthBits != 0) {
|
||||
// todo
|
||||
dumpViewLabel.setText("startByte: " + dumpInfo.startByte +
|
||||
dumpViewPanel.setLabelText("startByte: " + dumpInfo.startByte +
|
||||
" startBit: " + dumpInfo.startBit +
|
||||
" lengthBytes: " + dumpInfo.lengthBytes +
|
||||
" lengthBits: " + dumpInfo.lengthBits);
|
||||
}
|
||||
|
||||
// todo honfika: support multiple swf
|
||||
dumpViewPanel.setData(swfs.get(0).swfs.get(0).uncompressedData);
|
||||
dumpViewPanel.revalidate();
|
||||
showCard(CARDDUMPVIEW);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,7 +51,7 @@ public class QuickFindPanel extends JPanel implements ActionListener, jsyntaxpan
|
||||
public JCheckBox ignoreCaseCheckbox,regExpCheckbox,wrapCheckbox;
|
||||
public JLabel statusLabel;
|
||||
|
||||
private Markers.SimpleMarker marker = new Markers.SimpleMarker(Color.PINK);
|
||||
private final Markers.SimpleMarker marker = new Markers.SimpleMarker(Color.PINK);
|
||||
private WeakReference<JTextComponent> target;
|
||||
private WeakReference<DocumentSearchData> dsd;
|
||||
private int oldCaretPosition;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@ import com.jpexs.decompiler.flash.SWFInputStream;
|
||||
*/
|
||||
public class TagStub extends Tag {
|
||||
|
||||
private SWFInputStream dataStream;
|
||||
private final SWFInputStream dataStream;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
Reference in New Issue
Block a user