mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 02:30:44 +00:00
import swf from XML
This commit is contained in:
@@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.gui.generictageditors.ChangeListener;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.ColorEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.GenericTagEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.NumberEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.ReflectionTools;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.StringEditor;
|
||||
import com.jpexs.decompiler.flash.gui.helpers.SpringUtilities;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
@@ -38,6 +37,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.parser.AnnotationParseException;
|
||||
import com.jpexs.decompiler.flash.types.annotations.parser.ConditionEvaluator;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import com.jpexs.helpers.ReflectionTools;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Component;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.gui.generictageditors.BooleanEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.ColorEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.GenericTagEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.NumberEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.ReflectionTools;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.StringEditor;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.decompiler.flash.types.ARGB;
|
||||
@@ -36,6 +35,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.parser.AnnotationParseException;
|
||||
import com.jpexs.decompiler.flash.types.annotations.parser.ConditionEvaluator;
|
||||
import com.jpexs.helpers.ReflectionTools;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
|
||||
@@ -96,6 +96,7 @@ public class MainFrameRibbonMenu extends MainFrameMenu implements ActionListener
|
||||
public static final String ACTION_EXPORT_SEL = "EXPORTSEL";
|
||||
public static final String ACTION_EXPORT_JAVA_SOURCE = "EXPORTJAVASOURCE";
|
||||
public static final String ACTION_EXPORT_SWF_XML = "EXPORTSWFXML";
|
||||
public static final String ACTION_IMPORT_SWF_XML = "IMPORTSWFXML";
|
||||
private static final String ACTION_EXPORT = "EXPORT";
|
||||
private static final String ACTION_IMPORT_TEXT = "IMPORTTEXT";
|
||||
private static final String ACTION_CHECK_UPDATES = "CHECKUPDATES";
|
||||
|
||||
@@ -74,6 +74,7 @@ import com.jpexs.decompiler.flash.helpers.Freed;
|
||||
import com.jpexs.decompiler.flash.importers.BinaryDataImporter;
|
||||
import com.jpexs.decompiler.flash.importers.ImageImporter;
|
||||
import com.jpexs.decompiler.flash.importers.ShapeImporter;
|
||||
import com.jpexs.decompiler.flash.importers.SwfXmlImporter;
|
||||
import com.jpexs.decompiler.flash.importers.TextImporter;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag;
|
||||
@@ -1671,6 +1672,27 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
}
|
||||
}
|
||||
|
||||
public void importSwfXml() {
|
||||
List<TreeItem> sel = tagTree.getSelected(tagTree);
|
||||
for (TreeItem item : sel) {
|
||||
if (item instanceof SWF) {
|
||||
SWF swf = (SWF) item;
|
||||
File selectedFile = showImportFileChooser("filter.xml|*.xml");
|
||||
if (selectedFile != null) {
|
||||
File selfile = Helper.fixDialogFile(selectedFile);
|
||||
String xml = Helper.readTextFile(selfile.getPath());
|
||||
try {
|
||||
new SwfXmlImporter().importSwf(swf, xml);
|
||||
swf.clearAllCache();
|
||||
refreshTree();
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void restoreControlFlow(final boolean all) {
|
||||
Main.startWork(translate("work.restoringControlFlow"));
|
||||
if ((!all) || confirmExperimental()) {
|
||||
@@ -1936,7 +1958,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
if (item instanceof DefineSoundTag) {
|
||||
File selectedFile = showImportFileChooser("filter.sounds|*.mp3;*.wav|filter.sounds.mp3|*.mp3|filter.sounds.wav|*.wav");
|
||||
if (selectedFile != null) {
|
||||
Configuration.lastOpenDir.set(Helper.fixDialogFile(selectedFile).getParentFile().getAbsolutePath());
|
||||
File selfile = Helper.fixDialogFile(selectedFile);
|
||||
DefineSoundTag ds = (DefineSoundTag) item;
|
||||
int soundFormat = SoundFormat.FORMAT_UNCOMPRESSED_LITTLE_ENDIAN;
|
||||
@@ -1961,7 +1982,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
if (it.importSupported()) {
|
||||
File selectedFile = showImportFileChooser("filter.images|*.jpg;*.jpeg;*.gif;*.png;*.bmp");
|
||||
if (selectedFile != null) {
|
||||
Configuration.lastOpenDir.set(Helper.fixDialogFile(selectedFile).getParentFile().getAbsolutePath());
|
||||
File selfile = Helper.fixDialogFile(selectedFile);
|
||||
byte[] data = Helper.readFile(selfile.getAbsolutePath());
|
||||
try {
|
||||
@@ -1983,7 +2003,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
ShapeTag st = (ShapeTag) item;
|
||||
File selectedFile = showImportFileChooser("filter.images|*.jpg;*.jpeg;*.gif;*.png;*.bmp");
|
||||
if (selectedFile != null) {
|
||||
Configuration.lastOpenDir.set(Helper.fixDialogFile(selectedFile).getParentFile().getAbsolutePath());
|
||||
File selfile = Helper.fixDialogFile(selectedFile);
|
||||
byte[] data = Helper.readFile(selfile.getAbsolutePath());
|
||||
try {
|
||||
@@ -2004,7 +2023,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
DefineBinaryDataTag bt = (DefineBinaryDataTag) item;
|
||||
File selectedFile = showImportFileChooser("");
|
||||
if (selectedFile != null) {
|
||||
Configuration.lastOpenDir.set(Helper.fixDialogFile(selectedFile).getParentFile().getAbsolutePath());
|
||||
File selfile = Helper.fixDialogFile(selectedFile);
|
||||
byte[] data = Helper.readFile(selfile.getAbsolutePath());
|
||||
new BinaryDataImporter().importData(bt, data);
|
||||
@@ -2026,6 +2044,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
case MainFrameRibbonMenu.ACTION_EXPORT_SWF_XML:
|
||||
exportSwfXml();
|
||||
break;
|
||||
case MainFrameRibbonMenu.ACTION_IMPORT_SWF_XML:
|
||||
importSwfXml();
|
||||
break;
|
||||
case MainFrameRibbonMenu.ACTION_EXPORT_SEL:
|
||||
export(true);
|
||||
break;
|
||||
@@ -2078,7 +2099,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
JFrame f = new JFrame();
|
||||
View.setWindowIcon(f);
|
||||
if (fc.showOpenDialog(f) == JFileChooser.APPROVE_OPTION) {
|
||||
return fc.getSelectedFile();
|
||||
File result = fc.getSelectedFile();
|
||||
Configuration.lastOpenDir.set(Helper.fixDialogFile(result).getParentFile().getAbsolutePath());
|
||||
return result;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.generictageditors;
|
||||
|
||||
import com.jpexs.helpers.ReflectionTools;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.gui.AppStrings;
|
||||
import com.jpexs.decompiler.flash.types.ARGB;
|
||||
import com.jpexs.decompiler.flash.types.RGB;
|
||||
import com.jpexs.decompiler.flash.types.RGBA;
|
||||
import com.jpexs.helpers.ReflectionTools;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Cursor;
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.gui.generictageditors;
|
||||
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
import com.jpexs.helpers.ReflectionTools;
|
||||
import java.awt.Component;
|
||||
import java.awt.event.FocusAdapter;
|
||||
import java.awt.event.FocusEvent;
|
||||
|
||||
@@ -1,303 +0,0 @@
|
||||
/*
|
||||
* 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.generictageditors;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class ReflectionTools {
|
||||
|
||||
public static Object getValue(Object obj, Field field, int index) throws IllegalArgumentException, IllegalAccessException {
|
||||
if (getFieldSubSize(obj, field) <= index) {
|
||||
return null;
|
||||
}
|
||||
Object value = field.get(obj);
|
||||
if (List.class.isAssignableFrom(field.getType())) {
|
||||
return ((List) value).get(index);
|
||||
}
|
||||
|
||||
if (field.getType().isArray()) {
|
||||
return Array.get(value, index);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static boolean needsIndex(Field field) {
|
||||
if (List.class.isAssignableFrom(field.getType())) {
|
||||
return true;
|
||||
} else if (field.getType().isArray()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static int getFieldSubSize(Object obj, Field field) {
|
||||
Object val;
|
||||
try {
|
||||
val = field.get(obj);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
return 0;
|
||||
}
|
||||
if (List.class.isAssignableFrom(field.getType())) {
|
||||
return ((List) val).size();
|
||||
} else if (field.getType().isArray()) {
|
||||
return Array.getLength(val);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void setValue(Object obj, Field field, int index, Object newValue) throws IllegalArgumentException, IllegalAccessException {
|
||||
Object value = field.get(obj);
|
||||
if (needsIndex(field) && index >= getFieldSubSize(obj, field)) { //outofbounds, ignore
|
||||
return;
|
||||
}
|
||||
if (List.class.isAssignableFrom(field.getType())) {
|
||||
((List) value).set(index, newValue);
|
||||
} else if (field.getType().isArray()) {
|
||||
Array.set(value, index, newValue);
|
||||
} else {
|
||||
field.set(obj, newValue);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean canInstantiate(Class cls) {
|
||||
if (cls.isInterface()) {
|
||||
return false;
|
||||
}
|
||||
if (Modifier.isAbstract(cls.getModifiers())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean canAddToField(Object object, Field field) {
|
||||
if (List.class.isAssignableFrom(field.getType())) {
|
||||
|
||||
ParameterizedType listType = (ParameterizedType) field.getGenericType();
|
||||
Class<?> parameterClass = (Class<?>) listType.getActualTypeArguments()[0];
|
||||
return canInstantiate(parameterClass);
|
||||
}
|
||||
|
||||
if (field.getType().isArray()) {
|
||||
Object arrValue;
|
||||
try {
|
||||
arrValue = field.get(object);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
Logger.getLogger(ReflectionTools.class.getName()).log(Level.SEVERE, null, ex);
|
||||
return false;
|
||||
}
|
||||
Class componentClass = arrValue.getClass().getComponentType();
|
||||
if (componentClass.isPrimitive()) {
|
||||
return true;
|
||||
}
|
||||
return canInstantiate(componentClass);
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public static Object newInstanceOf(Class cls) throws InstantiationException, IllegalAccessException {
|
||||
if (cls == Integer.class || cls == int.class) {
|
||||
return 0;
|
||||
} else if (cls == Float.class || cls == float.class) {
|
||||
return 0.0f;
|
||||
} else if (cls == Double.class || cls == double.class) {
|
||||
return (double) 0;
|
||||
} else if (cls == Long.class || cls == long.class) {
|
||||
return 0L;
|
||||
}
|
||||
if (cls.isInterface()) {
|
||||
return null;
|
||||
}
|
||||
if (Modifier.isAbstract(cls.getModifiers())) {
|
||||
return null;
|
||||
}
|
||||
return cls.newInstance();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static boolean addToList(Object object, Field field, int index) {
|
||||
if (!List.class.isAssignableFrom(field.getType())) {
|
||||
return false;
|
||||
}
|
||||
List list;
|
||||
try {
|
||||
list = (List) field.get(object);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
Logger.getLogger(ReflectionTools.class.getName()).log(Level.SEVERE, null, ex);
|
||||
return false;
|
||||
}
|
||||
ParameterizedType listType = (ParameterizedType) field.getGenericType();
|
||||
Class<?> parameterClass = (Class<?>) listType.getActualTypeArguments()[0];
|
||||
try {
|
||||
Object val = newInstanceOf(parameterClass);
|
||||
if (val == null) {
|
||||
return false;
|
||||
}
|
||||
list.add(index, val);
|
||||
} catch (InstantiationException | IllegalAccessException ex) {
|
||||
Logger.getLogger(ReflectionTools.class.getName()).log(Level.SEVERE, null, ex);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Class<?> getFieldSubType(Object object, Field field) {
|
||||
if (field.getType().isArray()) {
|
||||
Object arrValue;
|
||||
try {
|
||||
arrValue = field.get(object);
|
||||
return arrValue.getClass().getComponentType();
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (List.class.isAssignableFrom(field.getType())) {
|
||||
ParameterizedType listType = (ParameterizedType) field.getGenericType();
|
||||
return (Class<?>) listType.getActualTypeArguments()[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean addToArray(Object object, Field field, int index, boolean notnull) {
|
||||
if (!field.getType().isArray()) {
|
||||
return false;
|
||||
}
|
||||
Object arrValue;
|
||||
try {
|
||||
arrValue = field.get(object);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
Logger.getLogger(ReflectionTools.class.getName()).log(Level.SEVERE, null, ex);
|
||||
return false;
|
||||
}
|
||||
Class componentClass = arrValue.getClass().getComponentType();
|
||||
Object val = null;
|
||||
if (!componentClass.isPrimitive()) {
|
||||
try {
|
||||
val = newInstanceOf(componentClass);
|
||||
} catch (InstantiationException | IllegalAccessException ex) {
|
||||
Logger.getLogger(ReflectionTools.class.getName()).log(Level.SEVERE, null, ex);
|
||||
return false;
|
||||
}
|
||||
if (val == null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int originalSize = Array.getLength(arrValue);
|
||||
Object copy = Array.newInstance(componentClass, originalSize + 1);
|
||||
|
||||
//Copy items before
|
||||
for (int i = 0; i < index; i++) {
|
||||
Array.set(copy, i, Array.get(arrValue, i));
|
||||
}
|
||||
if (val != null) {
|
||||
Array.set(copy, index, val);
|
||||
}
|
||||
//Copy items after
|
||||
for (int i = index; i < originalSize; i++) {
|
||||
Array.set(copy, i + 1, Array.get(arrValue, i));
|
||||
}
|
||||
try {
|
||||
field.set(object, copy);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
Logger.getLogger(ReflectionTools.class.getName()).log(Level.SEVERE, null, ex);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean addToField(Object object, Field field, int index, boolean notnull) {
|
||||
if (List.class.isAssignableFrom(field.getType())) {
|
||||
return addToList(object, field, index);
|
||||
}
|
||||
|
||||
if (field.getType().isArray()) {
|
||||
return addToArray(object, field, index, notnull);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean removeFromField(Object object, Field field, int index) {
|
||||
if (List.class.isAssignableFrom(field.getType())) {
|
||||
return removeFromList(object, field, index);
|
||||
}
|
||||
|
||||
if (field.getType().isArray()) {
|
||||
return removeFromArray(object, field, index);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean removeFromList(Object object, Field field, int index) {
|
||||
List list;
|
||||
try {
|
||||
list = (List) field.get(object);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
Logger.getLogger(ReflectionTools.class.getName()).log(Level.SEVERE, null, ex);
|
||||
return false;
|
||||
}
|
||||
if (index < 0 || index >= list.size()) {
|
||||
return false;
|
||||
}
|
||||
list.remove(index);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean removeFromArray(Object object, Field field, int index) {
|
||||
Object arrValue;
|
||||
try {
|
||||
arrValue = field.get(object);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
Logger.getLogger(ReflectionTools.class.getName()).log(Level.SEVERE, null, ex);
|
||||
return false;
|
||||
}
|
||||
Class componentClass = arrValue.getClass().getComponentType();
|
||||
int originalSize = Array.getLength(arrValue);
|
||||
Object copy = Array.newInstance(componentClass, originalSize - 1);
|
||||
int pos = 0;
|
||||
//copy all before index
|
||||
for (int i = 0; i < index; i++) {
|
||||
Array.set(copy, pos, Array.get(arrValue, i));
|
||||
pos++;
|
||||
}
|
||||
//copy all after index
|
||||
for (int i = index + 1; i < originalSize; i++) {
|
||||
Array.set(copy, pos, Array.get(arrValue, i));
|
||||
pos++;
|
||||
}
|
||||
try {
|
||||
field.set(object, copy);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
Logger.getLogger(ReflectionTools.class.getName()).log(Level.SEVERE, null, ex);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.jpexs.decompiler.flash.gui.generictageditors;
|
||||
|
||||
import com.jpexs.helpers.Helper;
|
||||
import com.jpexs.helpers.ReflectionTools;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.FocusAdapter;
|
||||
|
||||
@@ -551,3 +551,6 @@ message.confirm.closeAll = There are unsaved changes. Do you really want to clos
|
||||
|
||||
contextmenu.exportJavaSource = Export Java Source
|
||||
contextmenu.exportSwfXml = Export SWF as XML
|
||||
contextmenu.importSwfXml = Import SWF XML
|
||||
|
||||
filter.xml = XML
|
||||
|
||||
@@ -551,3 +551,6 @@ message.confirm.closeAll = Mentetlen v\u00e1ltoz\u00e1sok vannak. Szeretn\u00e9
|
||||
|
||||
contextmenu.exportJavaSource = Java k\u00f3d export\u00e1l\u00e1s
|
||||
contextmenu.exportSwfXml = SWF export\u00e1l\u00e1sa XML-k\u00e9nt
|
||||
contextmenu.importSwfXml = SWF XML import\u00e1l\u00e1s
|
||||
|
||||
filter.xml = XML
|
||||
|
||||
@@ -78,6 +78,7 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener {
|
||||
private JMenuItem jumpToCharacterMenuItem;
|
||||
private JMenuItem exportJavaSourceMenuItem;
|
||||
private JMenuItem exportSwfXmlMenuItem;
|
||||
private JMenuItem importSwfXmlMenuItem;
|
||||
private JMenuItem closeMenuItem;
|
||||
private JMenu addTagMenu;
|
||||
private JMenu moveTagMenu;
|
||||
@@ -134,6 +135,11 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener {
|
||||
exportSwfXmlMenuItem.addActionListener(mainPanel);
|
||||
add(exportSwfXmlMenuItem);
|
||||
|
||||
importSwfXmlMenuItem = new JMenuItem(mainPanel.translate("contextmenu.importSwfXml"));
|
||||
importSwfXmlMenuItem.setActionCommand(MainFrameRibbonMenu.ACTION_IMPORT_SWF_XML);
|
||||
importSwfXmlMenuItem.addActionListener(mainPanel);
|
||||
add(importSwfXmlMenuItem);
|
||||
|
||||
closeMenuItem = new JMenuItem(mainPanel.translate("contextmenu.closeSwf"));
|
||||
closeMenuItem.setActionCommand(ACTION_CLOSE_SWF);
|
||||
closeMenuItem.addActionListener(this);
|
||||
@@ -227,6 +233,8 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener {
|
||||
replaceMenuItem.setVisible(false);
|
||||
rawEditMenuItem.setVisible(false);
|
||||
jumpToCharacterMenuItem.setVisible(false);
|
||||
exportJavaSourceMenuItem.setVisible(allSelectedIsSwf);
|
||||
exportSwfXmlMenuItem.setVisible(allSelectedIsSwf);
|
||||
closeMenuItem.setVisible(allSelectedIsSwf);
|
||||
addTagMenu.setVisible(false);
|
||||
moveTagMenu.setVisible(false);
|
||||
|
||||
Reference in New Issue
Block a user