enable save buttons only when text was changed

This commit is contained in:
honfika@gmail.com
2015-05-08 13:16:12 +02:00
parent 13ea982705
commit fa912d01ea
17 changed files with 5605 additions and 5518 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -18,8 +18,8 @@ package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.gui.abc.LineMarkedEditorPane;
import com.jpexs.decompiler.flash.gui.controls.JRepeatButton;
import com.jpexs.decompiler.flash.gui.editor.LineMarkedEditorPane;
import com.jpexs.decompiler.flash.helpers.HighlightedText;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
import com.jpexs.decompiler.flash.helpers.hilight.Highlighting;
@@ -43,8 +43,6 @@ import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.BadLocationException;
/**
@@ -99,24 +97,8 @@ public class TextPanel extends JPanel implements TagEditorPanel {
textValue = new LineMarkedEditorPane();
add(new JScrollPane(textValue), BorderLayout.CENTER);
textValue.setFont(new Font("Monospaced", Font.PLAIN, textValue.getFont().getSize()));
textValue.setContentType("text/swftext");
textValue.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
textChanged();
}
@Override
public void removeUpdate(DocumentEvent e) {
textChanged();
}
@Override
public void changedUpdate(DocumentEvent e) {
textChanged();
}
});
textValue.changeContentType("text/swftext");
textValue.addTextChangedListener(this::textChanged);
JPanel textButtonsPanel = new JPanel();
textButtonsPanel.setLayout(new FlowLayout(SwingConstants.WEST));
@@ -370,7 +352,6 @@ public class TextPanel extends JPanel implements TagEditorPanel {
private void textChanged() {
setModified(true);
updateButtonsVisibility();
showTextComparingPreview();
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,340 +1,341 @@
/*
* Copyright (C) 2010-2015 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.abc;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2Graph;
import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException;
import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser;
import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.MissingSymbolHandler;
import com.jpexs.decompiler.flash.abc.types.MethodBody;
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
import com.jpexs.decompiler.flash.gui.GraphDialog;
import com.jpexs.decompiler.flash.gui.View;
import com.jpexs.decompiler.flash.helpers.HighlightedText;
import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
import com.jpexs.decompiler.flash.helpers.hilight.Highlighting;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.graph.ScopeStack;
import com.jpexs.helpers.Helper;
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretListener {
public ABC abc;
public int bodyIndex = -1;
private int scriptIndex = -1;
public int getScriptIndex() {
return scriptIndex;
}
private List<Highlighting> disassembledHilights = new ArrayList<>();
private List<Highlighting> specialHilights = new ArrayList<>();
private final DecompiledEditorPane decompiledEditor;
private boolean ignoreCarret = false;
private String name;
private HighlightedText textWithHex;
private HighlightedText textNoHex;
private HighlightedText textHexOnly;
private ScriptExportMode exportMode = ScriptExportMode.PCODE;
private Trait trait;
public ABCPanel getAbcPanel() {
return decompiledEditor.getAbcPanel();
}
public ScriptExportMode getExportMode() {
return exportMode;
}
private HighlightedText getHighlightedText(ScriptExportMode exportMode) {
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), true);
abc.bodies.get(bodyIndex).getCode().toASMSource(abc.constants, trait, abc.method_info.get(abc.bodies.get(bodyIndex).method_info), abc.bodies.get(bodyIndex), exportMode, writer);
return new HighlightedText(writer);
}
public void setHex(ScriptExportMode exportMode, boolean force) {
if (this.exportMode == exportMode && !force) {
return;
}
this.exportMode = exportMode;
long oldOffset = getSelectedOffset();
if (exportMode == ScriptExportMode.PCODE) {
setContentType("text/flasm3");
if (textNoHex == null) {
textNoHex = getHighlightedText(exportMode);
}
setText(textNoHex);
} else if (exportMode == ScriptExportMode.PCODE_HEX) {
setContentType("text/flasm3");
if (textWithHex == null) {
textWithHex = getHighlightedText(exportMode);
}
setText(textWithHex);
} else {
setContentType("text/plain");
if (textHexOnly == null) {
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), true);
Helper.byteArrayToHexWithHeader(writer, abc.bodies.get(bodyIndex).getCode().getBytes());
textHexOnly = new HighlightedText(writer);
}
setText(textHexOnly);
}
hilighOffset(oldOffset);
}
public void setIgnoreCarret(boolean ignoreCarret) {
this.ignoreCarret = ignoreCarret;
}
public ASMSourceEditorPane(DecompiledEditorPane decompiledEditor) {
this.decompiledEditor = decompiledEditor;
addCaretListener(this);
}
public void hilighSpecial(HighlightSpecialType type, String specialValue) {
Highlighting h2 = null;
for (Highlighting sh : specialHilights) {
if (type.equals(sh.getProperties().subtype)) {
if (sh.getProperties().specialValue.equals(specialValue)) {
h2 = sh;
break;
}
}
}
if (h2 != null) {
ignoreCarret = true;
if (h2.startPos <= getDocument().getLength()) {
setCaretPosition(h2.startPos);
}
getCaret().setVisible(true);
ignoreCarret = false;
}
}
public void hilighOffset(long offset) {
if (isEditable()) {
return;
}
Highlighting h2 = Highlighting.searchOffset(disassembledHilights, offset);
if (h2 != null) {
ignoreCarret = true;
if (h2.startPos <= getDocument().getLength()) {
setCaretPosition(h2.startPos);
}
getCaret().setVisible(true);
ignoreCarret = false;
}
}
@Override
public String getName() {
return super.getName();
}
public void setBodyIndex(int bodyIndex, ABC abc, String name, Trait trait, int scriptIndex) {
this.bodyIndex = bodyIndex;
this.abc = abc;
this.name = name;
this.trait = trait;
this.scriptIndex = scriptIndex;
if (bodyIndex == -1) {
return;
}
textWithHex = null;
textNoHex = null;
textHexOnly = null;
setHex(exportMode, true);
}
public void graph() {
try {
AVM2Graph gr = new AVM2Graph(abc.bodies.get(bodyIndex).getCode(), abc, abc.bodies.get(bodyIndex), false, -1, -1, new HashMap<>(), new ScopeStack(), new HashMap<>(), new ArrayList<>(), new HashMap<>(), abc.bodies.get(bodyIndex).getCode().visitCode(abc.bodies.get(bodyIndex)));
(new GraphDialog(getAbcPanel().getMainPanel().getMainFrame().getWindow(), gr, name)).setVisible(true);
} catch (InterruptedException ex) {
Logger.getLogger(ASMSourceEditorPane.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void exec() {
HashMap<Integer, Object> args = new HashMap<>();
args.put(0, new Object()); //object "this"
args.put(1, 466561L); //param1
Object o = abc.bodies.get(bodyIndex).getCode().execute(args, abc.constants);
View.showMessageDialog(this, "Returned object:" + o.toString());
}
public boolean save() {
try {
String text = getText();
if (text.trim().startsWith(Helper.hexData)) {
byte[] data = Helper.getBytesFromHexaText(text);
MethodBody mb = abc.bodies.get(bodyIndex);
mb.setCodeBytes(data);
} else {
AVM2Code acode = ASM3Parser.parse(new StringReader(text), abc.constants, trait, new MissingSymbolHandler() {
//no longer ask for adding new constants
@Override
public boolean missingString(String value) {
return true;
}
@Override
public boolean missingInt(long value) {
return true;
}
@Override
public boolean missingUInt(long value) {
return true;
}
@Override
public boolean missingDouble(double value) {
return true;
}
}, abc.bodies.get(bodyIndex), abc.method_info.get(abc.bodies.get(bodyIndex).method_info));
//acode.getBytes(abc.bodies.get(bodyIndex).getCodeBytes());
abc.bodies.get(bodyIndex).setCode(acode);
}
((Tag) abc.parentTag).setModified(true);
abc.script_info.get(scriptIndex).setModified(true);
textWithHex = null;
textNoHex = null;
textHexOnly = null;
} catch (IOException ex) {
} catch (InterruptedException ex) {
} catch (AVM2ParseException ex) {
View.showMessageDialog(this, (ex.text + " on line " + ex.line));
gotoLine((int) ex.line);
markError();
return false;
}
return true;
}
@Override
public void setText(String t) {
disassembledHilights = new ArrayList<>();
specialHilights = new ArrayList<>();
super.setText(t);
setCaretPosition(0);
}
public void setText(HighlightedText HighlightedText) {
disassembledHilights = HighlightedText.instructionHilights;
specialHilights = HighlightedText.specialHilights;
super.setText(HighlightedText.text);
setCaretPosition(0);
}
public void clear() {
setText("");
bodyIndex = -1;
setCaretPosition(0);
}
public void selectInstruction(int pos) {
String text = getText();
int lineCnt = 1;
int lineStart = 0;
int lineEnd;
int instrCount = 0;
int dot = -2;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) == '\n') {
lineCnt++;
lineEnd = i;
String ins = text.substring(lineStart, lineEnd).trim();
if (!((i > 0) && (text.charAt(i - 1) == ':'))) {
if (!ins.startsWith("exception ")) {
instrCount++;
}
}
if (instrCount == pos + 1) {
break;
}
lineStart = i + 1;
}
}
//if (lineCnt == -1) {
// lineEnd = text.length() - 1;
//}
//select(lineStart, lineEnd);
setCaretPosition(lineStart);
//requestFocus();
}
public Highlighting getSelectedSpecial() {
return Highlighting.searchPos(specialHilights, getCaretPosition());
}
public long getSelectedOffset() {
int pos = getCaretPosition();
Highlighting lastH = null;
for (Highlighting h : disassembledHilights) {
if (pos < h.startPos) {
break;
}
lastH = h;
}
return lastH == null ? 0 : lastH.getProperties().offset;
}
@Override
public void caretUpdate(CaretEvent e) {
if (isEditable()) {
return;
}
if (ignoreCarret) {
return;
}
getCaret().setVisible(true);
decompiledEditor.hilightOffset(getSelectedOffset());
Highlighting spec = getSelectedSpecial();
if (spec != null) {
decompiledEditor.hilightSpecial(spec.getProperties().subtype, spec.getProperties().index);
}
}
}
/*
* Copyright (C) 2010-2015 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.abc;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2Graph;
import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException;
import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser;
import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.MissingSymbolHandler;
import com.jpexs.decompiler.flash.abc.types.MethodBody;
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
import com.jpexs.decompiler.flash.gui.GraphDialog;
import com.jpexs.decompiler.flash.gui.View;
import com.jpexs.decompiler.flash.gui.editor.LineMarkedEditorPane;
import com.jpexs.decompiler.flash.helpers.HighlightedText;
import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
import com.jpexs.decompiler.flash.helpers.hilight.Highlighting;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.graph.ScopeStack;
import com.jpexs.helpers.Helper;
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretListener {
public ABC abc;
public int bodyIndex = -1;
private int scriptIndex = -1;
public int getScriptIndex() {
return scriptIndex;
}
private List<Highlighting> disassembledHilights = new ArrayList<>();
private List<Highlighting> specialHilights = new ArrayList<>();
private final DecompiledEditorPane decompiledEditor;
private boolean ignoreCarret = false;
private String name;
private HighlightedText textWithHex;
private HighlightedText textNoHex;
private HighlightedText textHexOnly;
private ScriptExportMode exportMode = ScriptExportMode.PCODE;
private Trait trait;
public ABCPanel getAbcPanel() {
return decompiledEditor.getAbcPanel();
}
public ScriptExportMode getExportMode() {
return exportMode;
}
private HighlightedText getHighlightedText(ScriptExportMode exportMode) {
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), true);
abc.bodies.get(bodyIndex).getCode().toASMSource(abc.constants, trait, abc.method_info.get(abc.bodies.get(bodyIndex).method_info), abc.bodies.get(bodyIndex), exportMode, writer);
return new HighlightedText(writer);
}
public void setHex(ScriptExportMode exportMode, boolean force) {
if (this.exportMode == exportMode && !force) {
return;
}
this.exportMode = exportMode;
long oldOffset = getSelectedOffset();
if (exportMode == ScriptExportMode.PCODE) {
changeContentType("text/flasm3");
if (textNoHex == null) {
textNoHex = getHighlightedText(exportMode);
}
setText(textNoHex);
} else if (exportMode == ScriptExportMode.PCODE_HEX) {
changeContentType("text/flasm3");
if (textWithHex == null) {
textWithHex = getHighlightedText(exportMode);
}
setText(textWithHex);
} else {
changeContentType("text/plain");
if (textHexOnly == null) {
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), true);
Helper.byteArrayToHexWithHeader(writer, abc.bodies.get(bodyIndex).getCode().getBytes());
textHexOnly = new HighlightedText(writer);
}
setText(textHexOnly);
}
hilighOffset(oldOffset);
}
public void setIgnoreCarret(boolean ignoreCarret) {
this.ignoreCarret = ignoreCarret;
}
public ASMSourceEditorPane(DecompiledEditorPane decompiledEditor) {
this.decompiledEditor = decompiledEditor;
addCaretListener(this);
}
public void hilighSpecial(HighlightSpecialType type, String specialValue) {
Highlighting h2 = null;
for (Highlighting sh : specialHilights) {
if (type.equals(sh.getProperties().subtype)) {
if (sh.getProperties().specialValue.equals(specialValue)) {
h2 = sh;
break;
}
}
}
if (h2 != null) {
ignoreCarret = true;
if (h2.startPos <= getDocument().getLength()) {
setCaretPosition(h2.startPos);
}
getCaret().setVisible(true);
ignoreCarret = false;
}
}
public void hilighOffset(long offset) {
if (isEditable()) {
return;
}
Highlighting h2 = Highlighting.searchOffset(disassembledHilights, offset);
if (h2 != null) {
ignoreCarret = true;
if (h2.startPos <= getDocument().getLength()) {
setCaretPosition(h2.startPos);
}
getCaret().setVisible(true);
ignoreCarret = false;
}
}
@Override
public String getName() {
return super.getName();
}
public void setBodyIndex(int bodyIndex, ABC abc, String name, Trait trait, int scriptIndex) {
this.bodyIndex = bodyIndex;
this.abc = abc;
this.name = name;
this.trait = trait;
this.scriptIndex = scriptIndex;
if (bodyIndex == -1) {
return;
}
textWithHex = null;
textNoHex = null;
textHexOnly = null;
setHex(exportMode, true);
}
public void graph() {
try {
AVM2Graph gr = new AVM2Graph(abc.bodies.get(bodyIndex).getCode(), abc, abc.bodies.get(bodyIndex), false, -1, -1, new HashMap<>(), new ScopeStack(), new HashMap<>(), new ArrayList<>(), new HashMap<>(), abc.bodies.get(bodyIndex).getCode().visitCode(abc.bodies.get(bodyIndex)));
(new GraphDialog(getAbcPanel().getMainPanel().getMainFrame().getWindow(), gr, name)).setVisible(true);
} catch (InterruptedException ex) {
Logger.getLogger(ASMSourceEditorPane.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void exec() {
HashMap<Integer, Object> args = new HashMap<>();
args.put(0, new Object()); //object "this"
args.put(1, 466561L); //param1
Object o = abc.bodies.get(bodyIndex).getCode().execute(args, abc.constants);
View.showMessageDialog(this, "Returned object:" + o.toString());
}
public boolean save() {
try {
String text = getText();
if (text.trim().startsWith(Helper.hexData)) {
byte[] data = Helper.getBytesFromHexaText(text);
MethodBody mb = abc.bodies.get(bodyIndex);
mb.setCodeBytes(data);
} else {
AVM2Code acode = ASM3Parser.parse(new StringReader(text), abc.constants, trait, new MissingSymbolHandler() {
//no longer ask for adding new constants
@Override
public boolean missingString(String value) {
return true;
}
@Override
public boolean missingInt(long value) {
return true;
}
@Override
public boolean missingUInt(long value) {
return true;
}
@Override
public boolean missingDouble(double value) {
return true;
}
}, abc.bodies.get(bodyIndex), abc.method_info.get(abc.bodies.get(bodyIndex).method_info));
//acode.getBytes(abc.bodies.get(bodyIndex).getCodeBytes());
abc.bodies.get(bodyIndex).setCode(acode);
}
((Tag) abc.parentTag).setModified(true);
abc.script_info.get(scriptIndex).setModified(true);
textWithHex = null;
textNoHex = null;
textHexOnly = null;
} catch (IOException ex) {
} catch (InterruptedException ex) {
} catch (AVM2ParseException ex) {
View.showMessageDialog(this, (ex.text + " on line " + ex.line));
gotoLine((int) ex.line);
markError();
return false;
}
return true;
}
@Override
public void setText(String t) {
disassembledHilights = new ArrayList<>();
specialHilights = new ArrayList<>();
super.setText(t);
setCaretPosition(0);
}
public void setText(HighlightedText HighlightedText) {
disassembledHilights = HighlightedText.instructionHilights;
specialHilights = HighlightedText.specialHilights;
super.setText(HighlightedText.text);
setCaretPosition(0);
}
public void clear() {
setText("");
bodyIndex = -1;
setCaretPosition(0);
}
public void selectInstruction(int pos) {
String text = getText();
int lineCnt = 1;
int lineStart = 0;
int lineEnd;
int instrCount = 0;
int dot = -2;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) == '\n') {
lineCnt++;
lineEnd = i;
String ins = text.substring(lineStart, lineEnd).trim();
if (!((i > 0) && (text.charAt(i - 1) == ':'))) {
if (!ins.startsWith("exception ")) {
instrCount++;
}
}
if (instrCount == pos + 1) {
break;
}
lineStart = i + 1;
}
}
//if (lineCnt == -1) {
// lineEnd = text.length() - 1;
//}
//select(lineStart, lineEnd);
setCaretPosition(lineStart);
//requestFocus();
}
public Highlighting getSelectedSpecial() {
return Highlighting.searchPos(specialHilights, getCaretPosition());
}
public long getSelectedOffset() {
int pos = getCaretPosition();
Highlighting lastH = null;
for (Highlighting h : disassembledHilights) {
if (pos < h.startPos) {
break;
}
lastH = h;
}
return lastH == null ? 0 : lastH.getProperties().offset;
}
@Override
public void caretUpdate(CaretEvent e) {
if (isEditable()) {
return;
}
if (ignoreCarret) {
return;
}
getCaret().setVisible(true);
decompiledEditor.hilightOffset(getSelectedOffset());
Highlighting spec = getSelectedSpecial();
if (spec != null) {
decompiledEditor.hilightSpecial(spec.getProperties().subtype, spec.getProperties().index);
}
}
}

View File

@@ -132,20 +132,31 @@ public class DetailPanel extends JPanel implements TagEditorPanel {
//traitInfoPanel.add(new JLabel(" " + translate("abc.detail.traitname")));
traitInfoPanel.add(traitNameLabel);
topPanel.add(traitInfoPanel, BorderLayout.CENTER);
methodTraitPanel.methodCodePanel.getSourceTextArea().addTextChangedListener(this::editorTextChanged);
slotConstTraitPanel.slotConstEditor.addTextChangedListener(this::editorTextChanged);
add(topPanel, BorderLayout.NORTH);
}
private void editorTextChanged() {
setModified(true);
}
private boolean isModified() {
return saveButton.isVisible() && saveButton.isEnabled();
}
private void setModified(boolean value) {
saveButton.setEnabled(value);
}
public void setEditMode(boolean val) {
slotConstTraitPanel.setEditMode(val);
methodTraitPanel.setEditMode(val);
saveButton.setVisible(val);
saveButton.setEnabled(false);
editButton.setVisible(!val);
cancelButton.setVisible(val);
if (val) {
selectedLabel.setIcon(View.getIcon("editing16"));
} else {
selectedLabel.setIcon(null);
}
selectedLabel.setIcon(val ? View.getIcon("editing16") : null);
}
public void showCard(final String name, final Trait trait) {

View File

@@ -1,179 +1,181 @@
/*
* Copyright (C) 2010-2015 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.abc;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
import com.jpexs.decompiler.flash.gui.AppStrings;
import com.jpexs.decompiler.flash.gui.Main;
import com.jpexs.decompiler.flash.gui.View;
import com.jpexs.decompiler.flash.gui.controls.NoneSelectedButtonGroup;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JToggleButton;
/**
*
* @author JPEXS
*/
public class MethodCodePanel extends JPanel {
private final ASMSourceEditorPane sourceTextArea;
public JPanel buttonsPanel;
private final JToggleButton hexButton;
private final JToggleButton hexOnlyButton;
public void focusEditor() {
sourceTextArea.requestFocusInWindow();
}
public int getScriptIndex() {
return sourceTextArea.getScriptIndex();
}
public String getTraitName() {
return sourceTextArea.getName();
}
public void setIgnoreCarret(boolean ignoreCarret) {
sourceTextArea.setIgnoreCarret(ignoreCarret);
}
public void hilighOffset(long offset) {
sourceTextArea.hilighOffset(offset);
}
public void hilighSpecial(HighlightSpecialType type, String specialValue) {
sourceTextArea.hilighSpecial(type, specialValue);
}
public void setBodyIndex(int bodyIndex, ABC abc, Trait trait, int scriptIndex) {
sourceTextArea.setBodyIndex(bodyIndex, abc, sourceTextArea.getName(), trait, scriptIndex);
}
public void setBodyIndex(int bodyIndex, ABC abc, String name, Trait trait, int scriptIndex) {
sourceTextArea.setBodyIndex(bodyIndex, abc, name, trait, scriptIndex);
}
public int getBodyIndex() {
return sourceTextArea.bodyIndex;
}
public void clear() {
sourceTextArea.clear();
}
public boolean save() {
return sourceTextArea.save();
}
public MethodCodePanel(DecompiledEditorPane decompiledEditor) {
sourceTextArea = new ASMSourceEditorPane(decompiledEditor);
setLayout(new BorderLayout());
add(new JScrollPane(sourceTextArea), BorderLayout.CENTER);
sourceTextArea.setContentType("text/flasm3");
sourceTextArea.setFont(new Font("Monospaced", Font.PLAIN, sourceTextArea.getFont().getSize()));
buttonsPanel = new JPanel();
buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS));
JButton graphButton = new JButton(View.getIcon("graph16"));
graphButton.addActionListener(this::graphButtonActionPerformed);
graphButton.setToolTipText(AppStrings.translate("button.viewgraph"));
graphButton.setMargin(new Insets(3, 3, 3, 3));
hexButton = new JToggleButton(View.getIcon("hexas16"));
hexButton.addActionListener(this::hexButtonActionPerformed);
hexButton.setToolTipText(AppStrings.translate("button.viewhex"));
hexButton.setMargin(new Insets(3, 3, 3, 3));
hexOnlyButton = new JToggleButton(View.getIcon("hex16"));
hexOnlyButton.addActionListener(this::hexOnlyButtonActionPerformed);
hexOnlyButton.setToolTipText(AppStrings.translate("button.viewhex"));
hexOnlyButton.setMargin(new Insets(3, 3, 3, 3));
NoneSelectedButtonGroup exportModeButtonGroup = new NoneSelectedButtonGroup();
exportModeButtonGroup.add(hexButton);
exportModeButtonGroup.add(hexOnlyButton);
buttonsPanel.add(graphButton);
buttonsPanel.add(hexButton);
buttonsPanel.add(hexOnlyButton);
buttonsPanel.add(new JPanel());
// buttonsPanel.add(saveButton);
// buttonsPan.add(execButton);
add(buttonsPanel, BorderLayout.NORTH);
}
private void graphButtonActionPerformed(ActionEvent evt) {
if (Main.isWorking()) {
return;
}
sourceTextArea.graph();
}
private void hexButtonActionPerformed(ActionEvent evt) {
if (Main.isWorking()) {
return;
}
sourceTextArea.setHex(getExportMode(), false);
}
private void hexOnlyButtonActionPerformed(ActionEvent evt) {
if (Main.isWorking()) {
return;
}
sourceTextArea.setHex(getExportMode(), false);
}
private ScriptExportMode getExportMode() {
ScriptExportMode exportMode = hexOnlyButton.isSelected() ? ScriptExportMode.HEX
: (hexButton.isSelected() ? ScriptExportMode.PCODE_HEX : ScriptExportMode.PCODE);
return exportMode;
}
public void setEditMode(boolean val) {
ScriptExportMode exportMode = getExportMode();
if (val) {
sourceTextArea.setHex(exportMode == ScriptExportMode.HEX ? ScriptExportMode.HEX : ScriptExportMode.PCODE, false);
} else {
if (exportMode != ScriptExportMode.PCODE) {
sourceTextArea.setHex(exportMode, false);
}
}
sourceTextArea.setEditable(val);
sourceTextArea.getCaret().setVisible(true);
buttonsPanel.setVisible(!val);
}
}
/*
* Copyright (C) 2010-2015 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.abc;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
import com.jpexs.decompiler.flash.gui.AppStrings;
import com.jpexs.decompiler.flash.gui.Main;
import com.jpexs.decompiler.flash.gui.View;
import com.jpexs.decompiler.flash.gui.controls.NoneSelectedButtonGroup;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JToggleButton;
/**
*
* @author JPEXS
*/
public class MethodCodePanel extends JPanel {
private final ASMSourceEditorPane sourceTextArea;
public JPanel buttonsPanel;
private final JToggleButton hexButton;
private final JToggleButton hexOnlyButton;
public void focusEditor() {
sourceTextArea.requestFocusInWindow();
}
public int getScriptIndex() {
return sourceTextArea.getScriptIndex();
}
public String getTraitName() {
return sourceTextArea.getName();
}
public void setIgnoreCarret(boolean ignoreCarret) {
sourceTextArea.setIgnoreCarret(ignoreCarret);
}
public void hilighOffset(long offset) {
sourceTextArea.hilighOffset(offset);
}
public void hilighSpecial(HighlightSpecialType type, String specialValue) {
sourceTextArea.hilighSpecial(type, specialValue);
}
public void setBodyIndex(int bodyIndex, ABC abc, Trait trait, int scriptIndex) {
sourceTextArea.setBodyIndex(bodyIndex, abc, sourceTextArea.getName(), trait, scriptIndex);
}
public void setBodyIndex(int bodyIndex, ABC abc, String name, Trait trait, int scriptIndex) {
sourceTextArea.setBodyIndex(bodyIndex, abc, name, trait, scriptIndex);
}
public int getBodyIndex() {
return sourceTextArea.bodyIndex;
}
public void clear() {
sourceTextArea.clear();
}
public boolean save() {
return sourceTextArea.save();
}
public MethodCodePanel(DecompiledEditorPane decompiledEditor) {
sourceTextArea = new ASMSourceEditorPane(decompiledEditor);
setLayout(new BorderLayout());
add(new JScrollPane(sourceTextArea), BorderLayout.CENTER);
sourceTextArea.changeContentType("text/flasm3");
sourceTextArea.setFont(new Font("Monospaced", Font.PLAIN, sourceTextArea.getFont().getSize()));
buttonsPanel = new JPanel();
buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS));
JButton graphButton = new JButton(View.getIcon("graph16"));
graphButton.addActionListener(this::graphButtonActionPerformed);
graphButton.setToolTipText(AppStrings.translate("button.viewgraph"));
graphButton.setMargin(new Insets(3, 3, 3, 3));
hexButton = new JToggleButton(View.getIcon("hexas16"));
hexButton.addActionListener(this::hexButtonActionPerformed);
hexButton.setToolTipText(AppStrings.translate("button.viewhex"));
hexButton.setMargin(new Insets(3, 3, 3, 3));
hexOnlyButton = new JToggleButton(View.getIcon("hex16"));
hexOnlyButton.addActionListener(this::hexOnlyButtonActionPerformed);
hexOnlyButton.setToolTipText(AppStrings.translate("button.viewhex"));
hexOnlyButton.setMargin(new Insets(3, 3, 3, 3));
NoneSelectedButtonGroup exportModeButtonGroup = new NoneSelectedButtonGroup();
exportModeButtonGroup.add(hexButton);
exportModeButtonGroup.add(hexOnlyButton);
buttonsPanel.add(graphButton);
buttonsPanel.add(hexButton);
buttonsPanel.add(hexOnlyButton);
buttonsPanel.add(new JPanel());
add(buttonsPanel, BorderLayout.NORTH);
}
private void graphButtonActionPerformed(ActionEvent evt) {
if (Main.isWorking()) {
return;
}
sourceTextArea.graph();
}
private void hexButtonActionPerformed(ActionEvent evt) {
if (Main.isWorking()) {
return;
}
sourceTextArea.setHex(getExportMode(), false);
}
private void hexOnlyButtonActionPerformed(ActionEvent evt) {
if (Main.isWorking()) {
return;
}
sourceTextArea.setHex(getExportMode(), false);
}
public ASMSourceEditorPane getSourceTextArea() {
return sourceTextArea;
}
private ScriptExportMode getExportMode() {
ScriptExportMode exportMode = hexOnlyButton.isSelected() ? ScriptExportMode.HEX
: (hexButton.isSelected() ? ScriptExportMode.PCODE_HEX : ScriptExportMode.PCODE);
return exportMode;
}
public void setEditMode(boolean val) {
ScriptExportMode exportMode = getExportMode();
if (val) {
sourceTextArea.setHex(exportMode == ScriptExportMode.HEX ? ScriptExportMode.HEX : ScriptExportMode.PCODE, false);
} else {
if (exportMode != ScriptExportMode.PCODE) {
sourceTextArea.setHex(exportMode, false);
}
}
sourceTextArea.setEditable(val);
sourceTextArea.getCaret().setVisible(true);
buttonsPanel.setVisible(!val);
}
}

View File

@@ -1,55 +1,55 @@
/*
* Copyright (C) 2010-2015 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.abc;
import java.awt.BorderLayout;
import javax.swing.JPanel;
/**
*
* @author JPEXS
*/
public class MethodTraitDetailPanel extends JPanel implements TraitDetail {
public MethodCodePanel methodCodePanel;
public ABCPanel abcPanel;
public MethodTraitDetailPanel(ABCPanel abcPanel) {
this.abcPanel = abcPanel;
methodCodePanel = new MethodCodePanel(abcPanel.decompiledTextArea);
setLayout(new BorderLayout());
add(methodCodePanel, BorderLayout.CENTER);
}
@Override
public boolean save() {
return methodCodePanel.save();
}
@Override
public void setEditMode(boolean val) {
methodCodePanel.setEditMode(val);
}
private boolean active = false;
@Override
public void setActive(boolean val) {
this.active = val;
}
}
/*
* Copyright (C) 2010-2015 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.abc;
import java.awt.BorderLayout;
import javax.swing.JPanel;
/**
*
* @author JPEXS
*/
public class MethodTraitDetailPanel extends JPanel implements TraitDetail {
public MethodCodePanel methodCodePanel;
public ABCPanel abcPanel;
private boolean active = false;
public MethodTraitDetailPanel(ABCPanel abcPanel) {
this.abcPanel = abcPanel;
methodCodePanel = new MethodCodePanel(abcPanel.decompiledTextArea);
setLayout(new BorderLayout());
add(methodCodePanel, BorderLayout.CENTER);
}
@Override
public boolean save() {
return methodCodePanel.save();
}
@Override
public void setEditMode(boolean val) {
methodCodePanel.setEditMode(val);
}
@Override
public void setActive(boolean val) {
this.active = val;
}
}

View File

@@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.gui.AppStrings;
import com.jpexs.decompiler.flash.gui.View;
import com.jpexs.decompiler.flash.gui.editor.LineMarkedEditorPane;
import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
import com.jpexs.decompiler.flash.helpers.hilight.Highlighting;
@@ -33,7 +34,6 @@ import java.io.StringReader;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JEditorPane;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
@@ -46,7 +46,7 @@ import javax.swing.event.CaretListener;
*/
public class SlotConstTraitDetailPanel extends JPanel implements TraitDetail {
public JEditorPane slotConstEditor;
public LineMarkedEditorPane slotConstEditor;
private ABC abc;
@@ -62,7 +62,7 @@ public class SlotConstTraitDetailPanel extends JPanel implements TraitDetail {
slotConstEditor = new LineMarkedEditorPane();
setLayout(new BorderLayout());
add(new JScrollPane(slotConstEditor), BorderLayout.CENTER);
slotConstEditor.setContentType("text/flasm3");
slotConstEditor.changeContentType("text/flasm3");
slotConstEditor.addCaretListener(new CaretListener() {
@Override
public void caretUpdate(CaretEvent e) {

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,7 @@
* 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.abc;
package com.jpexs.decompiler.flash.gui.editor;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.gui.AppStrings;
@@ -59,6 +59,12 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan
private boolean error = false;
private Token lastUnderlined = null;
private static final HighlightPainter underLinePainter = new UnderLinePainter(new Color(0, 0, 255));
private LinkHandler linkHandler = this;
public int getLine() {
return lastLine;
}
@@ -144,12 +150,6 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan
});
}
private Token lastUnderlined = null;
private static final HighlightPainter underLinePainter = new UnderLinePainter(new Color(0, 0, 255));
private LinkHandler linkHandler = this;
private class LinkAdapter extends MouseAdapter implements KeyListener {
private Point lastPos = new Point(0, 0);

View File

@@ -14,7 +14,7 @@
* 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.abc;
package com.jpexs.decompiler.flash.gui.editor;
import javax.swing.text.Highlighter;
import jsyntaxpane.Token;

View File

@@ -1,127 +1,127 @@
/*
* Copyright (C) 2010-2015 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.abc;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.text.BadLocationException;
import javax.swing.text.Highlighter;
import javax.swing.text.JTextComponent;
import jsyntaxpane.SyntaxDocument;
import jsyntaxpane.Token;
import jsyntaxpane.actions.ActionUtils;
/**
*
* @author JPEXS
*/
public class MyMarkers {
/**
* Removes only our private highlights This is public so that we can remove
* the highlights when the editorKit is unregistered. SimpleMarker can be
* null, in which case all instances of our Markers are removed.
*
* @param component the text component whose markers are to be removed
* @param marker the SimpleMarker to remove
*/
public static void removeMarkers(JTextComponent component, Highlighter.HighlightPainter marker) {
Highlighter hilite = component.getHighlighter();
Highlighter.Highlight[] hilites = hilite.getHighlights();
for (int i = 0; i < hilites.length; i++) {
Highlighter.HighlightPainter hMarker = hilites[i].getPainter();
if (marker == null || hMarker.equals(marker)) {
hilite.removeHighlight(hilites[i]);
}
}
}
/**
* Remove all the markers from an JEditorPane
*
* @param editorPane Editor
*/
public static void removeMarkers(JTextComponent editorPane) {
removeMarkers(editorPane, null);
}
/**
* add highlights for the given Token on the given pane
*
* @param pane Editor
* @param token Token
* @param marker Marker
*/
public static void markToken(JTextComponent pane, Token token, Highlighter.HighlightPainter marker) {
markText(pane, token.start, token.end(), marker);
}
/**
* add highlights for the given region on the given pane
*
* @param pane Editor
* @param start Start index
* @param end End index
* @param marker Marker
*/
public static void markText(JTextComponent pane, int start, int end, Highlighter.HighlightPainter marker) {
try {
Highlighter hiliter = pane.getHighlighter();
int selStart = pane.getSelectionStart();
int selEnd = pane.getSelectionEnd();
// if there is no selection or selection does not overlap
if (selStart == selEnd || end < selStart || start > selStart) {
hiliter.addHighlight(start, end, marker);
return;
}
// selection starts within the highlight, highlight before slection
if (selStart > start && selStart < end) {
hiliter.addHighlight(start, selStart, marker);
}
// selection ends within the highlight, highlight remaining
if (selEnd > start && selEnd < end) {
hiliter.addHighlight(selEnd, end, marker);
}
} catch (BadLocationException ex) {
}
}
/**
* Mark all text in the document that matches the given pattern
*
* @param pane control to use
* @param pattern pattern to match
* @param marker marker to use for highlighting
*/
public static void markAll(JTextComponent pane, Pattern pattern, Highlighter.HighlightPainter marker) {
SyntaxDocument sDoc = ActionUtils.getSyntaxDocument(pane);
if (sDoc == null || pattern == null) {
return;
}
Matcher matcher = sDoc.getMatcher(pattern);
// we may not have any matcher (due to undo or something, so don't do anything.
if (matcher == null) {
return;
}
while (matcher.find()) {
markText(pane, matcher.start(), matcher.end(), marker);
}
}
}
/*
* Copyright (C) 2010-2015 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.editor;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.text.BadLocationException;
import javax.swing.text.Highlighter;
import javax.swing.text.JTextComponent;
import jsyntaxpane.SyntaxDocument;
import jsyntaxpane.Token;
import jsyntaxpane.actions.ActionUtils;
/**
*
* @author JPEXS
*/
public class MyMarkers {
/**
* Removes only our private highlights This is public so that we can remove
* the highlights when the editorKit is unregistered. SimpleMarker can be
* null, in which case all instances of our Markers are removed.
*
* @param component the text component whose markers are to be removed
* @param marker the SimpleMarker to remove
*/
public static void removeMarkers(JTextComponent component, Highlighter.HighlightPainter marker) {
Highlighter hilite = component.getHighlighter();
Highlighter.Highlight[] hilites = hilite.getHighlights();
for (int i = 0; i < hilites.length; i++) {
Highlighter.HighlightPainter hMarker = hilites[i].getPainter();
if (marker == null || hMarker.equals(marker)) {
hilite.removeHighlight(hilites[i]);
}
}
}
/**
* Remove all the markers from an JEditorPane
*
* @param editorPane Editor
*/
public static void removeMarkers(JTextComponent editorPane) {
removeMarkers(editorPane, null);
}
/**
* add highlights for the given Token on the given pane
*
* @param pane Editor
* @param token Token
* @param marker Marker
*/
public static void markToken(JTextComponent pane, Token token, Highlighter.HighlightPainter marker) {
markText(pane, token.start, token.end(), marker);
}
/**
* add highlights for the given region on the given pane
*
* @param pane Editor
* @param start Start index
* @param end End index
* @param marker Marker
*/
public static void markText(JTextComponent pane, int start, int end, Highlighter.HighlightPainter marker) {
try {
Highlighter hiliter = pane.getHighlighter();
int selStart = pane.getSelectionStart();
int selEnd = pane.getSelectionEnd();
// if there is no selection or selection does not overlap
if (selStart == selEnd || end < selStart || start > selStart) {
hiliter.addHighlight(start, end, marker);
return;
}
// selection starts within the highlight, highlight before slection
if (selStart > start && selStart < end) {
hiliter.addHighlight(start, selStart, marker);
}
// selection ends within the highlight, highlight remaining
if (selEnd > start && selEnd < end) {
hiliter.addHighlight(selEnd, end, marker);
}
} catch (BadLocationException ex) {
}
}
/**
* Mark all text in the document that matches the given pattern
*
* @param pane control to use
* @param pattern pattern to match
* @param marker marker to use for highlighting
*/
public static void markAll(JTextComponent pane, Pattern pattern, Highlighter.HighlightPainter marker) {
SyntaxDocument sDoc = ActionUtils.getSyntaxDocument(pane);
if (sDoc == null || pattern == null) {
return;
}
Matcher matcher = sDoc.getMatcher(pattern);
// we may not have any matcher (due to undo or something, so don't do anything.
if (matcher == null) {
return;
}
while (matcher.find()) {
markText(pane, matcher.start(), matcher.end(), marker);
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) 2010-2015 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.editor;
/**
*
* @author JPEXS
*/
@FunctionalInterface
public interface TextChangedListener {
public void textChanged();
}

View File

@@ -1,110 +1,170 @@
/*
* Copyright (C) 2010-2015 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.abc;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.gui.View;
import com.jpexs.helpers.Stopwatch;
import java.awt.event.KeyEvent;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JEditorPane;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.EditorKit;
import jsyntaxpane.SyntaxDocument;
/**
*
* @author JPEXS
*/
public class UndoFixedEditorPane extends JEditorPane {
private static final Object setTextLock = new Object();
private String originalContentType;
@Override
public void setText(final String t) {
View.execInEventDispatch(() -> {
setText(t, getContentType());
});
}
private void setText(String t, String contentType) {
synchronized (setTextLock) {
if (!t.equals(getText())) {
boolean plain = t.length() > Configuration.syntaxHighlightLimit.get();
if (plain) {
contentType = "text/plain";
originalContentType = getContentType();
setContentType(contentType);
} else {
if (originalContentType != null) {
setContentType(originalContentType);
originalContentType = null;
}
}
Stopwatch sw = Stopwatch.startNew();
try {
Document doc = getDocument();
setDocument(new SyntaxDocument(null));
doc.remove(0, doc.getLength());
Reader r = new StringReader(t);
EditorKit kit = createEditorKitForContentType(contentType);
kit.read(r, doc, 0);
setDocument(doc);
} catch (BadLocationException | IOException ex) {
Logger.getLogger(UndoFixedEditorPane.class.getName()).log(Level.SEVERE, null, ex);
}
sw.stop();
if (!plain && sw.getElapsedMilliseconds() > 5000) {
Logger.getLogger(UndoFixedEditorPane.class.getName()).log(Level.WARNING, "Syntax highlightig took long time. You can try to decrease the syntax highlight limit in advanced settings.");
}
clearUndos();
}
}
}
@Override
protected void processKeyEvent(KeyEvent ke) {
if (!isEditable()) {
// disable Ctrl-E: delete line
// and Ctrl-H: Search and replace
if ((ke.getKeyCode() == KeyEvent.VK_E && ke.isControlDown())
|| (ke.getKeyCode() == KeyEvent.VK_H && ke.isControlDown())) {
return;
}
}
super.processKeyEvent(ke);
}
public void clearUndos() {
Document doc = getDocument();
if (doc instanceof SyntaxDocument) {
SyntaxDocument sdoc = (SyntaxDocument) doc;
sdoc.clearUndos();
}
}
}
/*
* Copyright (C) 2010-2015 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.editor;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.gui.View;
import com.jpexs.helpers.Stopwatch;
import java.awt.event.KeyEvent;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JEditorPane;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.EditorKit;
import jsyntaxpane.SyntaxDocument;
/**
*
* @author JPEXS
*/
public class UndoFixedEditorPane extends JEditorPane {
private static final Object setTextLock = new Object();
private final List<TextChangedListener> textChangedListeners = new ArrayList<>();
private String originalContentType;
private DocumentListener documentListener;
public UndoFixedEditorPane() {
addDocumentListener();
}
private void fireTextChanged() {
for (TextChangedListener listener : textChangedListeners) {
listener.textChanged();
}
}
private void addDocumentListener() {
documentListener = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
fireTextChanged();
}
@Override
public void removeUpdate(DocumentEvent e) {
fireTextChanged();
}
@Override
public void changedUpdate(DocumentEvent e) {
fireTextChanged();
}
};
getDocument().addDocumentListener(documentListener);
}
private void removeDocumentListener() {
getDocument().removeDocumentListener(documentListener);
}
public void changeContentType(String type) {
if (!type.equals(getContentType())) {
removeDocumentListener();
setContentType(type);
addDocumentListener();
}
}
@Override
public void setText(final String t) {
View.execInEventDispatch(() -> {
setText(t, getContentType());
});
}
private void setText(String t, String contentType) {
synchronized (setTextLock) {
if (!t.equals(getText())) {
boolean plain = t.length() > Configuration.syntaxHighlightLimit.get();
if (plain) {
contentType = "text/plain";
originalContentType = getContentType();
changeContentType(contentType);
} else {
if (originalContentType != null) {
changeContentType(originalContentType);
originalContentType = null;
}
}
Stopwatch sw = Stopwatch.startNew();
try {
Document doc = getDocument();
setDocument(new SyntaxDocument(null));
doc.remove(0, doc.getLength());
Reader r = new StringReader(t);
EditorKit kit = createEditorKitForContentType(contentType);
kit.read(r, doc, 0);
setDocument(doc);
} catch (BadLocationException | IOException ex) {
Logger.getLogger(UndoFixedEditorPane.class.getName()).log(Level.SEVERE, null, ex);
}
sw.stop();
if (!plain && sw.getElapsedMilliseconds() > 5000) {
Logger.getLogger(UndoFixedEditorPane.class.getName()).log(Level.WARNING, "Syntax highlightig took long time. You can try to decrease the syntax highlight limit in advanced settings.");
}
clearUndos();
}
}
}
@Override
protected void processKeyEvent(KeyEvent ke) {
if (!isEditable()) {
// disable Ctrl-E: delete line
// and Ctrl-H: Search and replace
if ((ke.getKeyCode() == KeyEvent.VK_E && ke.isControlDown())
|| (ke.getKeyCode() == KeyEvent.VK_H && ke.isControlDown())) {
return;
}
}
super.processKeyEvent(ke);
}
public void clearUndos() {
Document doc = getDocument();
if (doc instanceof SyntaxDocument) {
SyntaxDocument sdoc = (SyntaxDocument) doc;
sdoc.clearUndos();
}
}
public void addTextChangedListener(TextChangedListener l) {
textChangedListeners.add(l);
}
public void removeTextChangedListener(TextChangedListener l) {
textChangedListeners.remove(l);
}
}

View File

@@ -1,352 +1,352 @@
# Copyright (C) 2010-2015 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/>.
advancedSettings.dialog.title = Advanced Settings
advancedSettings.restartConfirmation = You must restart the program for some modifications to take effect. Do you want to restart it now?
advancedSettings.columns.name = Name
advancedSettings.columns.value = Value
advancedSettings.columns.description = Description
default = default
config.group.name.export = Export
config.group.description.export = Configuration of exports
config.group.name.script = Scripts
config.group.description.script = ActionScript decompilation related
config.group.name.update = Updates
config.group.description.update = Checking for updates
config.group.name.format = Formatting
config.group.description.format = ActionScript code formatting
config.group.name.limit = Limits
config.group.description.limit = Decompilation limits for obfuscated code, etc.
config.group.name.ui = Interface
config.group.description.ui = User intercace configuration
config.group.name.debug = Debug
config.group.description.debug = Debugging settings
config.group.name.display = Display
config.group.description.display = Flash objects display, etc.
config.group.name.decompilation = Decompilation
config.group.description.decompilation = Global decompilation related functions
config.group.name.other = Other
config.group.description.other = Other uncategorized configs
config.name.openMultipleFiles = Open multiple files
config.description.openMultipleFiles = Allows opening multiple files at once in one window
config.name.decompile = Show ActionScript source
config.description.decompile = You can disable AS decompilation, then only P-code is shown
config.name.dumpView = Dump View
config.description.dumpView = View raw data dump
config.name.useHexColorFormat = Hex color format
config.description.useHexColorFormat = Show the colors in hex format
config.name.parallelSpeedUp = Parallel SpeedUp
config.description.parallelSpeedUp = Parallelism can speed up decompilation
config.name.parallelThreadCount = Number of threads
config.description.parallelThreadCount = Number of threads for parallel speedup
config.name.autoDeobfuscate = Automatic deobfuscation
config.description.autoDeobfuscate = Run deobfuscation on every file before ActionScript decompilation
config.name.cacheOnDisk = Use caching on disk
config.description.cacheOnDisk = Cache already decompiled parts on hard drive instead of memory
config.name.internalFlashViewer = Use own Flash viewer
config.description.internalFlashViewer = Use JPEXS Flash Viewer instead of standard Flash Player for flash parts display
config.name.gotoMainClassOnStartup = Go to main class on startup (AS3)
config.description.gotoMainClassOnStartup = Navigates to document class of AS3 file on SWF opening
config.name.autoRenameIdentifiers = Automatic rename identifiers
config.description.autoRenameIdentifiers = Automatically rename invalid indentifiers on SWF load
config.name.offeredAssociation = (Internal) Association with SWF files displayed
config.description.offeredAssociation = Dialog about file association was already displayed
config.name.decimalAddress = Use decimal addresses
config.description.decimalAddress = Use decimal addresses instead of hexadecimal
config.name.showAllAddresses = Show all addresses
config.description.showAllAddresses = Display all ActionScript instruction addresses
config.name.useFrameCache = Use frame cache
config.description.useFrameCache = Cache frames before rendering again
config.name.useRibbonInterface = Ribbon interface
config.description.useRibbonInterface = Uncheck to use classic interface without ribbon menu
config.name.openFolderAfterFlaExport = Open folder after FLA export
config.description.openFolderAfterFlaExport = Display output directory after exporting FLA file
config.name.useDetailedLogging = Detailed Logging
config.description.useDetailedLogging = Log detailed error messages and info for debugging purposes
config.name.debugMode = Debug mode
config.description.debugMode = Mode for debugging. Turns on debug menu.
config.name.resolveConstants = Resolve constants in AS1/2 p-code
config.description.resolveConstants = Turn this off to show 'constantxx' instead of real values in P-code window
config.name.sublimiter = Limit of code subs
config.description.sublimiter = Limit of code subs for obfuscated code.
config.name.exportTimeout = Total export timeout (seconds)
config.description.exportTimeout = Decompiler will stop exporting after reaching this time
config.name.decompilationTimeoutFile = Single file decompilation timeout (seconds)
config.description.decompilationTimeoutFile = Decompiler will stop ActionScript decompilation after reaching this time in one file
config.name.paramNamesEnable = Enable parameter names in AS3
config.description.paramNamesEnable = Using parameter names in decompiling may cause problems because official programs like Flash CS 5.5 inserts wrong parameter names indices
config.name.displayFileName = Show SWF name in title
config.description.displayFileName = Display SWF file/url name in the window title (You can make screenshots then)
config.name.debugCopy = Debug recompile
config.description.debugCopy = Tries to compile SWF file again just after opening to ensure it produces same binary code. Use for DEBUGGING only!
config.name.dumpTags = Dump tags to console
config.description.dumpTags = Dump tags to console on reading SWF file
config.name.decompilationTimeoutSingleMethod = AS3: Single method decompilation timeout (seconds)
config.description.decompilationTimeoutSingleMethod = Decompiler will stop ActionScript decompilation after reaching this time in one method
config.name.lastRenameType = (Internal) Last rename type
config.description.lastRenameType = Last used rename identifiers type
config.name.lastSaveDir = (Internal) Last save directory
config.description.lastSaveDir = Last used save directory
config.name.lastOpenDir = (Internal) Last open directory
config.description.lastOpenDir = Last used open directory
config.name.lastExportDir = (Internal) Last export directory
config.description.lastExportDir = Last used export directory
config.name.locale = Language
config.description.locale = Locales identifier
config.name.registerNameFormat = Register variable format
config.description.registerNameFormat = Format of local register variable names. Use %d for register number.
config.name.maxRecentFileCount = Max recent count
config.description.maxRecentFileCount = Maximum number of recent files
config.name.recentFiles = (Internal) Recent files
config.description.recentFiles = Recent opened files
config.name.fontPairing = (Internal) Font pairs for import
config.description.fontPairing = Font pairs for importing new characters
config.name.lastUpdatesCheckDate = (Internal) Last update check date
config.description.lastUpdatesCheckDate = Date of last checking for updates on server
config.name.gui.window.width = (Internal) Last window width
config.description.gui.window.width = Last saved window width
config.name.gui.window.height = (Internal) Last window height
config.description.gui.window.height = Last saved window height
config.name.gui.window.maximized.horizontal = (Internal) Window maximized horizontally
config.description.gui.window.maximized.horizontal = Last window state - maximized horizontally
config.name.gui.window.maximized.vertical = (Internal) Window maximized vertically
config.description.gui.window.maximized.vertical = Last window state - maximized vertically
config.name.gui.avm2.splitPane.dividerLocationPercent = (Internal) AS3 Splitter location
config.description.gui.avm2.splitPane.dividerLocationPercent =
config.name.gui.actionSplitPane.dividerLocationPercent = (Internal) AS1/2 splitter location
config.description.gui.actionSplitPane.dividerLocationPercent =
config.name.gui.previewSplitPane.dividerLocationPercent = (Internal) Preview splitter location
config.description.gui.previewSplitPane.dividerLocationPercent =
config.name.gui.splitPane1.dividerLocationPercent = (Internal) Splitter location 1
config.description.gui.splitPane1.dividerLocationPercent =
config.name.gui.splitPane2.dividerLocationPercent = (Internal) Splitter location 2
config.description.gui.splitPane2.dividerLocationPercent =
config.name.saveAsExeScaleMode = Save as EXE scale mode
config.description.saveAsExeScaleMode = Scaling mode for EXE export
config.name.syntaxHighlightLimit = Syntax hilight max chars
config.description.syntaxHighlightLimit = Maximum number of characters to run syntax hilight on
config.name.guiFontPreviewSampleText = (Internal) Last font preview sample text
config.description.guiFontPreviewSampleText = Last font preview sample text list index
config.name.gui.fontPreviewWindow.width = (Internal) Last font preview window width
config.description.gui.fontPreviewWindow.width =
config.name.gui.fontPreviewWindow.height = (Internal) Last font preview window height
config.description.gui.fontPreviewWindow.height =
config.name.gui.fontPreviewWindow.posX = (Internal) Last font preview window X
config.description.gui.fontPreviewWindow.posX =
config.name.gui.fontPreviewWindow.posY = (Internal) Last font preview window Y
config.description.gui.fontPreviewWindow.posY =
config.name.formatting.indent.size = Characters per indent
config.description.formatting.indent.size = Number or spaces(or tabs) for one indentation
config.name.formatting.indent.useTabs = Tabs for indent
config.description.formatting.indent.useTabs = Use tabs instead of spaces for indentation
config.name.beginBlockOnNewLine = Curly brace on new line
config.description.beginBlockOnNewLine = Begin block with curly brace on new line
config.name.check.updates.delay = Updates check delay
config.description.check.updates.delay = Minimum time between automatic checks for updates on application start
config.name.check.updates.stable = Check for stable versions
config.description.check.updates.stable = Checking for stable version updates
config.name.check.updates.nightly = Check for nightly versions
config.description.check.updates.nightly = Checking for nightly version updates
config.name.check.updates.enabled = Updates check enabled
config.description.check.updates.enabled = Automatic checking for updates on application start
config.name.export.formats = (Internal) Export formats
config.description.export.formats = Last used export formats
config.name.textExportSingleFile = Export texts to single file
config.description.textExportSingleFile = Exporting texts to one file instead of multiple
config.name.textExportSingleFileSeparator = Separator of texts in one file text export
config.description.textExportSingleFileSeparator = Text to insert between texts in single file text export
config.name.textExportSingleFileRecordSeparator = Separator of records in one file text export
config.description.textExportSingleFileRecordSeparator = Text to insert between text records in single file text export
config.name.warning.experimental.as12edit = Warn on AS1/2 direct edit
config.description.warning.experimental.as12edit = Show warning on AS1/2 experimental direct editation
config.name.warning.experimental.as3edit = Warn on AS3 direct edit
config.description.warning.experimental.as3edit = Show warning on AS3 experimental direct editation
config.name.packJavaScripts = Pack JavaScripts
config.description.packJavaScripts = Run JavaScript packer on scripts created on Canvas Export.
config.name.textExportExportFontFace = Use font-face in SVG export
config.description.textExportExportFontFace = Embed font files in SVG using font-face instead of shapes
config.name.lzmaFastBytes = LZMA fast bytes (valid values: 5-255)
config.description.lzmaFastBytes = Fast bytes parameter of the LZMA encoder
#temporary setting, do not translate it
config.name.pluginPath = Plugin Path
config.description.pluginPath = -
config.name.deobfuscationMode = Deobfuscation mode
config.description.deobfuscationMode = Run deobfuscation on every file before ActionScript decompilation
config.name.showMethodBodyId = Show method body id
config.description.showMethodBodyId = Shows the id of the methodbody for commandline import
config.name.export.zoom = (Internal) Export zoom
config.description.export.zoom = Last used export zoom
config.name.debuggerPort = Debugger port
config.description.debuggerPort = Port used for socket debugging
config.name.displayDebuggerInfo = (Internal) Display debugger info
config.description.displayDebuggerInfo = Display info about debugger before switching it
config.name.randomDebuggerPackage = Use random package name for Debugger
config.description.randomDebuggerPackage = This renames Debugger package to random string which makes debugger presence harder to detect by ActionScript
config.name.lastDebuggerReplaceFunction = (Internal) Last selected trace replacement
config.description.lastDebuggerReplaceFunction = Function name which was last selected in replace trace function with debugger
config.name.getLocalNamesFromDebugInfo = AS3: Get local register names from debug info
config.description.getLocalNamesFromDebugInfo = If debug info present, renames local registers from _loc_x_ to real names. This can be turned off because some obfuscators use invalid register names there.
config.name.tagTreeShowEmptyFolders = Show empty folders
config.description.tagTreeShowEmptyFolders = Show empty folders in tag tree.
config.name.autoLoadEmbeddedSwfs = Auto load embedded SWFs
config.description.autoLoadEmbeddedSwfs = Automaticaly load the embedded SWFs from DefineBinaryData tags.
config.name.overrideTextExportFileName = Override text export filename
config.description.overrideTextExportFileName = You can customize the filename of the exported text. Use {filename} placeholder to use the filename of current SWF.
config.name.showOldTextDuringTextEditing = Show old text during text editing
config.description.showOldTextDuringTextEditing = Shows the original text of the text tag with gray color in the preview area.
config.group.name.import = Import
config.group.description.import = Configuration of imports
config.name.textImportResizeTextBoundsMode = Text bounds resize mode
config.description.textImportResizeTextBoundsMode = Text bounds resize mode after text editing.
config.name.showCloseConfirmation = Show again SWF close confirmation
config.description.showCloseConfirmation = Show again SWF close confirmation for modified files.
config.name.showCodeSavedMessage = Show again code saved message
config.description.showCodeSavedMessage = Show again code saved message
config.name.showTraitSavedMessage = Show again trait saved message
config.description.showTraitSavedMessage = Show again trait saved message
config.name.updateProxyAddress = Http Proxy address for checking updates
config.description.updateProxyAddress = Http Proxy address for checking updates. Format: example.com:8080
config.name.editorMode = Editor Mode
config.description.editorMode = Make text areas edittable automatically when you select a Text or Script node
config.name.autoSaveTagModifications = Auto save tag modificatios
config.description.autoSaveTagModifications = Save the changes when you select a new tag in the tree
config.name.saveSessionOnExit = Save session on exit
config.description.saveSessionOnExit = Save the current session and reopens it after FFDec restart (works only with real files)
config.name.showDebugMenu = Show debug menu
config.description.showDebugMenu = Shows debug menu in the ribbon
config.name.allowOnlyOneInstance = Allow only one FFDec instance (Only Windows OS)
config.description.allowOnlyOneInstance = FFDec can be then run only once, all files opened will be added to one window. It works only with Windows operating system.
config.name.scriptExportSingleFile = Export scripts to single file
config.description.scriptExportSingleFile = Exporting texts to one file instead of multiple
config.name.setFFDecVersionInExportedFont = Set FFDec version number in exported font
config.description.setFFDecVersionInExportedFont = When this setting is disabled, FFDec won't add the current FFDec version number to the exported font.
config.name.gui.skin = User Interface Skin
config.description.gui.skin = Look and feel skin
config.name.lastSessionData = Last session data
config.description.lastSessionData = Contains the opened files from the last session
config.name.loopMedia = Loop sounds and sprites
config.description.loopMedia = Automatically restarts the playing of the sounds and sprites
config.name.gui.timeLineSplitPane.dividerLocationPercent = (Internal) Timeline Splitter location
config.description.gui.timeLineSplitPane.dividerLocationPercent =
# Copyright (C) 2010-2015 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/>.
advancedSettings.dialog.title = Advanced Settings
advancedSettings.restartConfirmation = You must restart the program for some modifications to take effect. Do you want to restart it now?
advancedSettings.columns.name = Name
advancedSettings.columns.value = Value
advancedSettings.columns.description = Description
default = default
config.group.name.export = Export
config.group.description.export = Configuration of exports
config.group.name.script = Scripts
config.group.description.script = ActionScript decompilation related
config.group.name.update = Updates
config.group.description.update = Checking for updates
config.group.name.format = Formatting
config.group.description.format = ActionScript code formatting
config.group.name.limit = Limits
config.group.description.limit = Decompilation limits for obfuscated code, etc.
config.group.name.ui = Interface
config.group.description.ui = User intercace configuration
config.group.name.debug = Debug
config.group.description.debug = Debugging settings
config.group.name.display = Display
config.group.description.display = Flash objects display, etc.
config.group.name.decompilation = Decompilation
config.group.description.decompilation = Global decompilation related functions
config.group.name.other = Other
config.group.description.other = Other uncategorized configs
config.name.openMultipleFiles = Open multiple files
config.description.openMultipleFiles = Allows opening multiple files at once in one window
config.name.decompile = Show ActionScript source
config.description.decompile = You can disable AS decompilation, then only P-code is shown
config.name.dumpView = Dump View
config.description.dumpView = View raw data dump
config.name.useHexColorFormat = Hex color format
config.description.useHexColorFormat = Show the colors in hex format
config.name.parallelSpeedUp = Parallel SpeedUp
config.description.parallelSpeedUp = Parallelism can speed up decompilation
config.name.parallelThreadCount = Number of threads
config.description.parallelThreadCount = Number of threads for parallel speedup
config.name.autoDeobfuscate = Automatic deobfuscation
config.description.autoDeobfuscate = Run deobfuscation on every file before ActionScript decompilation
config.name.cacheOnDisk = Use caching on disk
config.description.cacheOnDisk = Cache already decompiled parts on hard drive instead of memory
config.name.internalFlashViewer = Use own Flash viewer
config.description.internalFlashViewer = Use JPEXS Flash Viewer instead of standard Flash Player for flash parts display
config.name.gotoMainClassOnStartup = Go to main class on startup (AS3)
config.description.gotoMainClassOnStartup = Navigates to document class of AS3 file on SWF opening
config.name.autoRenameIdentifiers = Automatic rename identifiers
config.description.autoRenameIdentifiers = Automatically rename invalid indentifiers on SWF load
config.name.offeredAssociation = (Internal) Association with SWF files displayed
config.description.offeredAssociation = Dialog about file association was already displayed
config.name.decimalAddress = Use decimal addresses
config.description.decimalAddress = Use decimal addresses instead of hexadecimal
config.name.showAllAddresses = Show all addresses
config.description.showAllAddresses = Display all ActionScript instruction addresses
config.name.useFrameCache = Use frame cache
config.description.useFrameCache = Cache frames before rendering again
config.name.useRibbonInterface = Ribbon interface
config.description.useRibbonInterface = Uncheck to use classic interface without ribbon menu
config.name.openFolderAfterFlaExport = Open folder after FLA export
config.description.openFolderAfterFlaExport = Display output directory after exporting FLA file
config.name.useDetailedLogging = Detailed Logging
config.description.useDetailedLogging = Log detailed error messages and info for debugging purposes
config.name.debugMode = Debug mode
config.description.debugMode = Mode for debugging. Turns on debug menu.
config.name.resolveConstants = Resolve constants in AS1/2 p-code
config.description.resolveConstants = Turn this off to show 'constantxx' instead of real values in P-code window
config.name.sublimiter = Limit of code subs
config.description.sublimiter = Limit of code subs for obfuscated code.
config.name.exportTimeout = Total export timeout (seconds)
config.description.exportTimeout = Decompiler will stop exporting after reaching this time
config.name.decompilationTimeoutFile = Single file decompilation timeout (seconds)
config.description.decompilationTimeoutFile = Decompiler will stop ActionScript decompilation after reaching this time in one file
config.name.paramNamesEnable = Enable parameter names in AS3
config.description.paramNamesEnable = Using parameter names in decompiling may cause problems because official programs like Flash CS 5.5 inserts wrong parameter names indices
config.name.displayFileName = Show SWF name in title
config.description.displayFileName = Display SWF file/url name in the window title (You can make screenshots then)
config.name.debugCopy = Debug recompile
config.description.debugCopy = Tries to compile SWF file again just after opening to ensure it produces same binary code. Use for DEBUGGING only!
config.name.dumpTags = Dump tags to console
config.description.dumpTags = Dump tags to console on reading SWF file
config.name.decompilationTimeoutSingleMethod = AS3: Single method decompilation timeout (seconds)
config.description.decompilationTimeoutSingleMethod = Decompiler will stop ActionScript decompilation after reaching this time in one method
config.name.lastRenameType = (Internal) Last rename type
config.description.lastRenameType = Last used rename identifiers type
config.name.lastSaveDir = (Internal) Last save directory
config.description.lastSaveDir = Last used save directory
config.name.lastOpenDir = (Internal) Last open directory
config.description.lastOpenDir = Last used open directory
config.name.lastExportDir = (Internal) Last export directory
config.description.lastExportDir = Last used export directory
config.name.locale = Language
config.description.locale = Locales identifier
config.name.registerNameFormat = Register variable format
config.description.registerNameFormat = Format of local register variable names. Use %d for register number.
config.name.maxRecentFileCount = Max recent count
config.description.maxRecentFileCount = Maximum number of recent files
config.name.recentFiles = (Internal) Recent files
config.description.recentFiles = Recent opened files
config.name.fontPairing = (Internal) Font pairs for import
config.description.fontPairing = Font pairs for importing new characters
config.name.lastUpdatesCheckDate = (Internal) Last update check date
config.description.lastUpdatesCheckDate = Date of last checking for updates on server
config.name.gui.window.width = (Internal) Last window width
config.description.gui.window.width = Last saved window width
config.name.gui.window.height = (Internal) Last window height
config.description.gui.window.height = Last saved window height
config.name.gui.window.maximized.horizontal = (Internal) Window maximized horizontally
config.description.gui.window.maximized.horizontal = Last window state - maximized horizontally
config.name.gui.window.maximized.vertical = (Internal) Window maximized vertically
config.description.gui.window.maximized.vertical = Last window state - maximized vertically
config.name.gui.avm2.splitPane.dividerLocationPercent = (Internal) AS3 Splitter location
config.description.gui.avm2.splitPane.dividerLocationPercent =
config.name.gui.actionSplitPane.dividerLocationPercent = (Internal) AS1/2 splitter location
config.description.gui.actionSplitPane.dividerLocationPercent =
config.name.gui.previewSplitPane.dividerLocationPercent = (Internal) Preview splitter location
config.description.gui.previewSplitPane.dividerLocationPercent =
config.name.gui.splitPane1.dividerLocationPercent = (Internal) Splitter location 1
config.description.gui.splitPane1.dividerLocationPercent =
config.name.gui.splitPane2.dividerLocationPercent = (Internal) Splitter location 2
config.description.gui.splitPane2.dividerLocationPercent =
config.name.saveAsExeScaleMode = Save as EXE scale mode
config.description.saveAsExeScaleMode = Scaling mode for EXE export
config.name.syntaxHighlightLimit = Syntax hilight max chars
config.description.syntaxHighlightLimit = Maximum number of characters to run syntax hilight on
config.name.guiFontPreviewSampleText = (Internal) Last font preview sample text
config.description.guiFontPreviewSampleText = Last font preview sample text list index
config.name.gui.fontPreviewWindow.width = (Internal) Last font preview window width
config.description.gui.fontPreviewWindow.width =
config.name.gui.fontPreviewWindow.height = (Internal) Last font preview window height
config.description.gui.fontPreviewWindow.height =
config.name.gui.fontPreviewWindow.posX = (Internal) Last font preview window X
config.description.gui.fontPreviewWindow.posX =
config.name.gui.fontPreviewWindow.posY = (Internal) Last font preview window Y
config.description.gui.fontPreviewWindow.posY =
config.name.formatting.indent.size = Characters per indent
config.description.formatting.indent.size = Number or spaces(or tabs) for one indentation
config.name.formatting.indent.useTabs = Tabs for indent
config.description.formatting.indent.useTabs = Use tabs instead of spaces for indentation
config.name.beginBlockOnNewLine = Curly brace on new line
config.description.beginBlockOnNewLine = Begin block with curly brace on new line
config.name.check.updates.delay = Updates check delay
config.description.check.updates.delay = Minimum time between automatic checks for updates on application start
config.name.check.updates.stable = Check for stable versions
config.description.check.updates.stable = Checking for stable version updates
config.name.check.updates.nightly = Check for nightly versions
config.description.check.updates.nightly = Checking for nightly version updates
config.name.check.updates.enabled = Updates check enabled
config.description.check.updates.enabled = Automatic checking for updates on application start
config.name.export.formats = (Internal) Export formats
config.description.export.formats = Last used export formats
config.name.textExportSingleFile = Export texts to single file
config.description.textExportSingleFile = Exporting texts to one file instead of multiple
config.name.textExportSingleFileSeparator = Separator of texts in one file text export
config.description.textExportSingleFileSeparator = Text to insert between texts in single file text export
config.name.textExportSingleFileRecordSeparator = Separator of records in one file text export
config.description.textExportSingleFileRecordSeparator = Text to insert between text records in single file text export
config.name.warning.experimental.as12edit = Warn on AS1/2 direct edit
config.description.warning.experimental.as12edit = Show warning on AS1/2 experimental direct editation
config.name.warning.experimental.as3edit = Warn on AS3 direct edit
config.description.warning.experimental.as3edit = Show warning on AS3 experimental direct editation
config.name.packJavaScripts = Pack JavaScripts
config.description.packJavaScripts = Run JavaScript packer on scripts created on Canvas Export.
config.name.textExportExportFontFace = Use font-face in SVG export
config.description.textExportExportFontFace = Embed font files in SVG using font-face instead of shapes
config.name.lzmaFastBytes = LZMA fast bytes (valid values: 5-255)
config.description.lzmaFastBytes = Fast bytes parameter of the LZMA encoder
#temporary setting, do not translate it
config.name.pluginPath = Plugin Path
config.description.pluginPath = -
config.name.deobfuscationMode = Deobfuscation mode
config.description.deobfuscationMode = Run deobfuscation on every file before ActionScript decompilation
config.name.showMethodBodyId = Show method body id
config.description.showMethodBodyId = Shows the id of the methodbody for commandline import
config.name.export.zoom = (Internal) Export zoom
config.description.export.zoom = Last used export zoom
config.name.debuggerPort = Debugger port
config.description.debuggerPort = Port used for socket debugging
config.name.displayDebuggerInfo = (Internal) Display debugger info
config.description.displayDebuggerInfo = Display info about debugger before switching it
config.name.randomDebuggerPackage = Use random package name for Debugger
config.description.randomDebuggerPackage = This renames Debugger package to random string which makes debugger presence harder to detect by ActionScript
config.name.lastDebuggerReplaceFunction = (Internal) Last selected trace replacement
config.description.lastDebuggerReplaceFunction = Function name which was last selected in replace trace function with debugger
config.name.getLocalNamesFromDebugInfo = AS3: Get local register names from debug info
config.description.getLocalNamesFromDebugInfo = If debug info present, renames local registers from _loc_x_ to real names. This can be turned off because some obfuscators use invalid register names there.
config.name.tagTreeShowEmptyFolders = Show empty folders
config.description.tagTreeShowEmptyFolders = Show empty folders in tag tree.
config.name.autoLoadEmbeddedSwfs = Auto load embedded SWFs
config.description.autoLoadEmbeddedSwfs = Automaticaly load the embedded SWFs from DefineBinaryData tags.
config.name.overrideTextExportFileName = Override text export filename
config.description.overrideTextExportFileName = You can customize the filename of the exported text. Use {filename} placeholder to use the filename of current SWF.
config.name.showOldTextDuringTextEditing = Show old text during text editing
config.description.showOldTextDuringTextEditing = Shows the original text of the text tag with gray color in the preview area.
config.group.name.import = Import
config.group.description.import = Configuration of imports
config.name.textImportResizeTextBoundsMode = Text bounds resize mode
config.description.textImportResizeTextBoundsMode = Text bounds resize mode after text editing.
config.name.showCloseConfirmation = Show again SWF close confirmation
config.description.showCloseConfirmation = Show again SWF close confirmation for modified files.
config.name.showCodeSavedMessage = Show again code saved message
config.description.showCodeSavedMessage = Show again code saved message
config.name.showTraitSavedMessage = Show again trait saved message
config.description.showTraitSavedMessage = Show again trait saved message
config.name.updateProxyAddress = Http Proxy address for checking updates
config.description.updateProxyAddress = Http Proxy address for checking updates. Format: example.com:8080
config.name.editorMode = Editor Mode
config.description.editorMode = Make text areas edittable automatically when you select a Text or Script node
config.name.autoSaveTagModifications = Auto save tag modificatios
config.description.autoSaveTagModifications = Save the changes when you select a new tag in the tree
config.name.saveSessionOnExit = Save session on exit
config.description.saveSessionOnExit = Save the current session and reopens it after FFDec restart (works only with real files)
config.name.showDebugMenu = Show debug menu
config.description.showDebugMenu = Shows debug menu in the ribbon
config.name.allowOnlyOneInstance = Allow only one FFDec instance (Only Windows OS)
config.description.allowOnlyOneInstance = FFDec can be then run only once, all files opened will be added to one window. It works only with Windows operating system.
config.name.scriptExportSingleFile = Export scripts to single file
config.description.scriptExportSingleFile = Exporting texts to one file instead of multiple
config.name.setFFDecVersionInExportedFont = Set FFDec version number in exported font
config.description.setFFDecVersionInExportedFont = When this setting is disabled, FFDec won't add the current FFDec version number to the exported font.
config.name.gui.skin = User Interface Skin
config.description.gui.skin = Look and feel skin
config.name.lastSessionData = Last session data
config.description.lastSessionData = Contains the opened files from the last session
config.name.loopMedia = Loop sounds and sprites
config.description.loopMedia = Automatically restarts the playing of the sounds and sprites
config.name.gui.timeLineSplitPane.dividerLocationPercent = (Internal) Timeline Splitter location
config.description.gui.timeLineSplitPane.dividerLocationPercent =