Generic tag editor improved

This commit is contained in:
Jindra Petk
2014-02-18 19:14:49 +01:00
parent a1dcd67dc6
commit d675f65dfd
57 changed files with 227 additions and 80 deletions

View File

@@ -16,6 +16,7 @@
*/
package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.gui.generictageditors.BooleanEditor;
import com.jpexs.decompiler.flash.gui.generictageditors.ChangeListener;
import com.jpexs.decompiler.flash.gui.generictageditors.ColorEditor;
@@ -31,10 +32,12 @@ import com.jpexs.decompiler.flash.types.RGBA;
import com.jpexs.decompiler.flash.types.annotations.Calculated;
import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.Internal;
import com.jpexs.decompiler.flash.types.annotations.Multiline;
import com.jpexs.decompiler.flash.types.annotations.Optional;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.decompiler.flash.types.annotations.parser.ConditionEvaluator;
import com.jpexs.decompiler.flash.types.annotations.parser.ParseException;
import com.jpexs.helpers.Helper;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
@@ -76,6 +79,8 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
private final JScrollPane genericTagPropertiesEditorPaneScrollPanel;
private final JScrollPane genericTagPropertiesEditPanelScrollPanel;
private Tag tag;
private Tag editedTag;
private List<String> keys = new ArrayList<>();
private Map<String, GenericTagEditor> editors = new HashMap<>();
private Map<String, Component> labels = new HashMap<>();
@@ -104,11 +109,12 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
genericTagPropertiesEditPanel = new JPanel();
genericTagPropertiesEditPanel.setLayout(new SpringLayout());
genericTagPropertiesEditPanelScrollPanel = new JScrollPane(genericTagPropertiesEditPanel);
JPanel edPanel=new JPanel(new BorderLayout());
edPanel.add(genericTagPropertiesEditPanel,BorderLayout.NORTH);
genericTagPropertiesEditPanelScrollPanel = new JScrollPane(edPanel);
}
public void clear() {
tag = null;
editors.clear();
fieldPaths.clear();
fieldIndices.clear();
@@ -122,8 +128,16 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
genericTagPropertiesEditPanel.setSize(0, 0);
}
public void setEditMode(boolean edit) {
if (edit) {
public void setEditMode(boolean edit, Tag tag) {
if(tag==null){
tag = this.tag;
}
this.tag = tag;
this.editedTag = (Tag)Helper.deepCopy(tag);
generateEditControls(editedTag, !edit);
if (edit){
remove(genericTagPropertiesEditorPaneScrollPanel);
add(genericTagPropertiesEditPanelScrollPanel, BorderLayout.CENTER);
} else {
@@ -131,11 +145,13 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
genericTagPropertiesEditPanel.setSize(0, 0);
remove(genericTagPropertiesEditPanelScrollPanel);
add(genericTagPropertiesEditorPaneScrollPanel, BorderLayout.CENTER);
setTagText(this.tag);
}
revalidate();
repaint();
}
public void setTagText(Tag tag) {
private void setTagText(Tag tag) {
clear();
generateEditControls(tag, true);
String val = "";
@@ -153,9 +169,8 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
hdr.setText(tag.toString());
}
public void generateEditControls(Tag tag, boolean readonly) {
private void generateEditControls(Tag tag, boolean readonly) {
clear();
this.tag = tag;
generateEditControlsRecursive(tag, "", new ArrayList<Field>(), new ArrayList<Integer>(), readonly);
change(null);
}
@@ -166,6 +181,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
propCount, 3, //rows, cols
6, 6, //initX, initY
6, 6); //xPad, yPad
revalidate();
repaint();
}
@@ -223,7 +239,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
} else {
propCount += addEditor(name, obj, field, 0, field.getType(), value, parentFields, parentIndices, readonly);
}
if (ReflectionTools.needsIndex(field) && !readonly) {
if (ReflectionTools.needsIndex(field) && !readonly && !field.getName().equals("clipActionRecords")) { //No clip actions, sorry
JButton addButton = new JButton(View.getIcon("add16"));
addButton.addActionListener(new ActionListener() {
@Override
@@ -280,7 +296,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
}
generateEditControls(tag, false);
generateEditControls(editedTag, false);
//Restore scroll top after some time. TODO: Handle this better. I don't know how :-(.
new Thread() {
@@ -300,7 +316,9 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
});
}
}.start();
}.start();
revalidate();
repaint();
}
private void addItem(Object obj, Field field) {
@@ -329,7 +347,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
} else {
ReflectionTools.enlargeField(obj, field, true);
}
generateEditControls(tag, false);
generateEditControls(editedTag, false);
//Restore scroll top after some time. TODO: Handle this better. I don't know how :-(.
new Thread() {
@@ -350,6 +368,8 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
}
}.start();
revalidate();
repaint();
}
private int addEditor(String name, Object obj, Field field, int index, Class<?> type, Object value, List<Field> parentList, List<Integer> parentIndices, boolean readonly) throws IllegalArgumentException, IllegalAccessException {
@@ -367,6 +387,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
return 0;
}
SWFType swfType = field.getAnnotation(SWFType.class);
Multiline multiline = field.getAnnotation(Multiline.class);
Component editor;
if (type.equals(int.class) || type.equals(Integer.class)
|| type.equals(short.class) || type.equals(Short.class)
@@ -377,7 +398,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
} else if (type.equals(boolean.class) || type.equals(Boolean.class)) {
editor = new BooleanEditor(name, obj, field, index, type);
} else if (type.equals(String.class)) {
editor = new StringEditor(name, obj, field, index, type);
editor = new StringEditor(name, obj, field, index, type,multiline!=null);
} else if (type.equals(RGB.class) || type.equals(RGBA.class) || type.equals(ARGB.class)) {
editor = new ColorEditor(name, obj, field, index, type);
} else {
@@ -445,6 +466,28 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
}
return result;
}
private void assignTag(Tag t,Tag assigned){
if(t.getClass()!=assigned.getClass()){
return;
}
for(Field f:t.getClass().getDeclaredFields()){
if((f.getModifiers()&Modifier.FINAL) == Modifier.FINAL){
continue;
}
if((f.getModifiers()&Modifier.STATIC) == Modifier.STATIC){
continue;
}
if(f.getName().equals("ID")){
continue;
}
try {
f.set(t, f.get(assigned));
} catch (IllegalArgumentException | IllegalAccessException ex) {
Logger.getLogger(GenericTagPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
public void save() {
for (Object component : genericTagPropertiesEditPanel.getComponents()) {
@@ -452,7 +495,10 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
((GenericTagEditor) component).save();
}
}
SWF swf=tag.getSwf();
assignTag(tag, editedTag);
tag.setModified(true);
tag.setSwf(swf);
setTagText(tag);
}
@@ -528,9 +574,9 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
if (addKeys.contains(key)) {
dependentEditor = addButtons.get(key);
} else if (removeButtons.containsKey(key)) { //It's array/list, add remove button
JPanel editRemPanel = new JPanel(new FlowLayout());
editRemPanel.add((Component) editors.get(key));
editRemPanel.add(removeButtons.get(key));
JPanel editRemPanel = new JPanel(new BorderLayout());
editRemPanel.add((Component) editors.get(key),BorderLayout.CENTER);
editRemPanel.add(removeButtons.get(key),BorderLayout.EAST);
dependentEditor = editRemPanel;
} else {
dependentEditor = (Component) editors.get(key);
@@ -544,9 +590,9 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
propCount++;
}
}
/*genericTagPropertiesEditPanel.add(new JPanel());
genericTagPropertiesEditPanel.add(new JPanel());
genericTagPropertiesEditPanel.add(new JPanel());
genericTagPropertiesEditPanel.add(new JPanel());
relayout(propCount + 1);
genericTagPropertiesEditPanel.add(new JPanel());*/
relayout(propCount /*+ 1*/);
}
}

View File

@@ -2158,8 +2158,8 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
genericEditButton.setVisible(false);
genericSaveButton.setVisible(true);
genericCancelButton.setVisible(true);
genericTagPanel.generateEditControls((Tag) item, false);
genericTagPanel.setEditMode(true);
//genericTagPanel.generateEditControls((Tag) item, false);
genericTagPanel.setEditMode(true,(Tag) item);
}
}
@@ -2173,14 +2173,14 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
genericEditButton.setVisible(true);
genericSaveButton.setVisible(false);
genericCancelButton.setVisible(false);
genericTagPanel.setEditMode(false);
genericTagPanel.setEditMode(false,null);
}
break;
case ACTION_CANCEL_GENERIC_TAG: {
genericEditButton.setVisible(true);
genericSaveButton.setVisible(false);
genericCancelButton.setVisible(false);
genericTagPanel.setEditMode(false);
genericTagPanel.setEditMode(false,null);
}
break;
case ACTION_REMOVE_ITEM:
@@ -2479,11 +2479,11 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
} else if (tagObj instanceof Tag) {
showCard(CARDGENEICTAGPANEL);
genericTagPanel.setTagText((Tag) tagObj);
//genericTagPanel.setTagText((Tag) tagObj);
genericEditButton.setVisible(true);
genericSaveButton.setVisible(false);
genericCancelButton.setVisible(false);
genericTagPanel.setEditMode(false);
genericTagPanel.setEditMode(false,(Tag)tagObj);
} else {
showCard(CARDEMPTYPANEL);
}

View File

@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.gui.generictageditors;
import com.jpexs.helpers.Helper;
import java.awt.Dimension;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.lang.reflect.Field;
@@ -34,14 +35,26 @@ public class StringEditor extends JTextArea implements GenericTagEditor {
private final int index;
private final Class<?> type;
private String fieldName;
private boolean multiline;
public StringEditor(String fieldName,Object obj, Field field, int index, Class<?> type) {
setLineWrap(true);
@Override
public boolean getScrollableTracksViewportWidth() {
return true;
}
public StringEditor(String fieldName,Object obj, Field field, int index, Class<?> type, boolean multiline) {
setLineWrap(true);
this.obj = obj;
this.field = field;
this.index = index;
this.type = type;
this.fieldName = fieldName;
this.multiline = multiline;
if(multiline){
Dimension d = new Dimension(500,200);
setPreferredSize(d);
setSize(d);
}
try {
setText((String) ReflectionTools.getValue(obj, field, index));
} catch (IllegalArgumentException | IllegalAccessException ex) {

View File

@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.annotations.Multiline;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -26,6 +27,7 @@ import java.io.OutputStream;
public class MetadataTag extends Tag {
@Multiline
public String xmlMetadata;
public static final int ID = 77;

View File

@@ -31,6 +31,7 @@ import com.jpexs.decompiler.flash.tags.gfx.DefineGradientMap;
import com.jpexs.decompiler.flash.tags.gfx.DefineSubImage;
import com.jpexs.decompiler.flash.tags.gfx.ExporterInfoTag;
import com.jpexs.decompiler.flash.tags.gfx.FontTextureInfo;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
@@ -40,7 +41,7 @@ import java.util.Set;
/**
* Represents Tag inside SWF file
*/
public class Tag implements NeedsCharacters, Exportable, ContainerItem {
public class Tag implements NeedsCharacters, Exportable, ContainerItem, Serializable {
/**
* Identifier of tag type
@@ -57,8 +58,8 @@ public class Tag implements NeedsCharacters, Exportable, ContainerItem {
public boolean forceWriteAsLong = false;
private final long pos;
protected String name;
public Tag previousTag;
protected SWF swf;
public Tag previousTag;
protected transient SWF swf;
private boolean modified;
public String getName() {

View File

@@ -16,12 +16,14 @@
*/
package com.jpexs.decompiler.flash.types;
import java.io.Serializable;
/**
* Represents 32-bit alpha, red, green and blue value
*
* @author JPEXS
*/
public class ALPHABITMAPDATA {
public class ALPHABITMAPDATA implements Serializable {
public ARGB[] bitmapPixelData = new ARGB[0];
}

View File

@@ -16,12 +16,14 @@
*/
package com.jpexs.decompiler.flash.types;
import java.io.Serializable;
/**
* Represents 32-bit alpha, red, green and blue value
*
* @author JPEXS
*/
public class ALPHACOLORMAPDATA {
public class ALPHACOLORMAPDATA implements Serializable {
public RGBA[] colorTableRGB;
public byte[] colorMapPixelData;

View File

@@ -18,13 +18,14 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.awt.Color;
import java.io.Serializable;
/**
* Represents 32-bit alpha, red, green and blue value
*
* @author JPEXS
*/
public class ARGB {
public class ARGB implements Serializable {
/**
* Alpha value defining opacity

View File

@@ -16,12 +16,14 @@
*/
package com.jpexs.decompiler.flash.types;
import java.io.Serializable;
/**
* Represents 32-bit alpha, red, green and blue value
*
* @author JPEXS
*/
public class BITMAPDATA {
public class BITMAPDATA implements Serializable {
public PIX15[] bitmapPixelDataPix15 = new PIX15[0];
public PIX24[] bitmapPixelDataPix24 = new PIX24[0];

View File

@@ -33,6 +33,7 @@ import com.jpexs.helpers.Helper;
import com.jpexs.helpers.MemoryInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@@ -43,7 +44,7 @@ import java.util.logging.Logger;
*
* @author JPEXS
*/
public class BUTTONCONDACTION implements ASMSource, Exportable, ContainerItem {
public class BUTTONCONDACTION implements ASMSource, Exportable, ContainerItem, Serializable {
private final SWF swf;
private final long pos;

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.decompiler.flash.types.filters.FILTER;
import java.io.Serializable;
import java.util.List;
/**
@@ -28,7 +29,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class BUTTONRECORD {
public class BUTTONRECORD implements Serializable {
@Reserved
@SWFType(value = BasicType.UB, count = 2)

View File

@@ -32,6 +32,7 @@ import com.jpexs.helpers.Helper;
import com.jpexs.helpers.MemoryInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@@ -42,7 +43,7 @@ import java.util.logging.Logger;
*
* @author JPEXS
*/
public class CLIPACTIONRECORD implements ASMSource, Exportable, ContainerItem {
public class CLIPACTIONRECORD implements ASMSource, Exportable, ContainerItem, Serializable {
public static String keyToString(int key) {
if ((key < CLIPACTIONRECORD.KEYNAMES.length) && (key > 0) && (CLIPACTIONRECORD.KEYNAMES[key] != null)) {

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -26,7 +27,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class CLIPACTIONS {
public class CLIPACTIONS implements Serializable {
@Reserved
@SWFType(BasicType.UI16)

View File

@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.helpers.Helper;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -28,7 +29,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class CLIPEVENTFLAGS {
public class CLIPEVENTFLAGS implements Serializable {
/**
* Key up event

View File

@@ -16,10 +16,12 @@
*/
package com.jpexs.decompiler.flash.types;
import java.io.Serializable;
/**
* @author JPEXS
*/
public class COLORMAPDATA {
public class COLORMAPDATA implements Serializable {
public RGB[] colorTableRGB;
public byte[] colorMapPixelData;

View File

@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.types.annotations.Calculated;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.decompiler.flash.types.filters.Filtering;
import com.jpexs.helpers.SerializableImage;
import java.io.Serializable;
/**
* Defines a transform that can be applied to the color space of a graphic
@@ -27,7 +28,7 @@ import com.jpexs.helpers.SerializableImage;
*
* @author JPEXS
*/
public class CXFORM {
public class CXFORM implements Serializable {
/**
* Has color addition values

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.decompiler.flash.types.filters.Filtering;
import com.jpexs.helpers.SerializableImage;
import java.io.Serializable;
/**
* Defines a transform that can be applied to the color space of a graphic
@@ -28,7 +29,7 @@ import com.jpexs.helpers.SerializableImage;
*
* @author JPEXS
*/
public class CXFORMWITHALPHA {
public class CXFORMWITHALPHA implements Serializable {
/**
* Has color addition values

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.ConditionalType;
import com.jpexs.decompiler.flash.types.annotations.Internal;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@@ -29,7 +30,7 @@ import java.util.Set;
*
* @author JPEXS
*/
public class FILLSTYLE implements NeedsCharacters {
public class FILLSTYLE implements NeedsCharacters, Serializable {
@SWFType(BasicType.UI8)
public int fillStyleType;

View File

@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.tags.base.NeedsCharacters;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@@ -24,7 +25,7 @@ import java.util.Set;
*
* @author JPEXS
*/
public class FILLSTYLEARRAY implements NeedsCharacters {
public class FILLSTYLEARRAY implements NeedsCharacters, Serializable {
public FILLSTYLE[] fillStyles;

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class FOCALGRADIENT extends GRADIENT {
public class FOCALGRADIENT extends GRADIENT implements Serializable {
@SWFType(BasicType.FIXED8)
public float focalPoint;

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class GLYPHENTRY {
public class GLYPHENTRY implements Serializable {
@SWFType(value = BasicType.UB, countField = "+glyphBits")
public int glyphIndex;

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class GRADIENT {
public class GRADIENT implements Serializable {
/**
* Spread mode

View File

@@ -18,12 +18,13 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.Internal;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class GRADRECORD {
public class GRADRECORD implements Serializable {
@SWFType(BasicType.UI8)
public int ratio;

View File

@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.awt.Font;
import java.awt.font.GlyphVector;
import java.awt.font.TextAttribute;
import java.io.Serializable;
import java.text.AttributedCharacterIterator;
import java.util.HashMap;
import java.util.Map;
@@ -30,7 +31,7 @@ import javax.swing.JPanel;
*
* @author JPEXS
*/
public class KERNINGRECORD {
public class KERNINGRECORD implements Serializable {
@SWFType(value = BasicType.UI8, alternateValue = BasicType.UI16, alternateCondition = "fontFlagsWideCodes")
public int fontKerningCode1;

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class LANGCODE {
public class LANGCODE implements Serializable {
@SWFType(BasicType.UI8)
public int languageCode;

View File

@@ -20,12 +20,13 @@ import com.jpexs.decompiler.flash.tags.DefineShape3Tag;
import com.jpexs.decompiler.flash.tags.DefineShape4Tag;
import com.jpexs.decompiler.flash.types.annotations.ConditionalType;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class LINESTYLE {
public class LINESTYLE implements Serializable {
@SWFType(BasicType.UI16)
public int width;

View File

@@ -19,12 +19,13 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class LINESTYLE2 extends LINESTYLE {
public class LINESTYLE2 extends LINESTYLE implements Serializable {
@SWFType(value = BasicType.UB, count = 2)
public int startCapStyle;

View File

@@ -16,11 +16,13 @@
*/
package com.jpexs.decompiler.flash.types;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class LINESTYLEARRAY {
public class LINESTYLEARRAY implements Serializable {
public LINESTYLE[] lineStyles = new LINESTYLE[0];
}

View File

@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.tags.base.NeedsCharacters;
import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@@ -26,7 +27,7 @@ import java.util.Set;
*
* @author JPEXS
*/
public class MORPHFILLSTYLE implements NeedsCharacters {
public class MORPHFILLSTYLE implements NeedsCharacters,Serializable {
@SWFType(BasicType.UI8)
public int fillStyleType;

View File

@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.tags.base.NeedsCharacters;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@@ -24,7 +25,7 @@ import java.util.Set;
*
* @author JPEXS
*/
public class MORPHFILLSTYLEARRAY implements NeedsCharacters {
public class MORPHFILLSTYLEARRAY implements NeedsCharacters,Serializable {
public MORPHFILLSTYLE[] fillStyles;

View File

@@ -18,12 +18,13 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.Internal;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class MORPHGRADIENT {
public class MORPHGRADIENT implements Serializable {
/**
* Spread mode. See GRADIENT.SPREAD_* constants

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class MORPHGRADRECORD {
public class MORPHGRADRECORD implements Serializable {
@SWFType(BasicType.UI8)
public int startRatio;

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class MORPHLINESTYLE {
public class MORPHLINESTYLE implements Serializable {
@SWFType(BasicType.UI16)
public int startWidth;

View File

@@ -19,12 +19,13 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class MORPHLINESTYLE2 {
public class MORPHLINESTYLE2 implements Serializable {
@SWFType(BasicType.UI16)
public int startWidth;

View File

@@ -16,11 +16,13 @@
*/
package com.jpexs.decompiler.flash.types;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class MORPHLINESTYLEARRAY {
public class MORPHLINESTYLEARRAY implements Serializable {
public MORPHLINESTYLE[] lineStyles;
public MORPHLINESTYLE2[] lineStyles2;

View File

@@ -17,13 +17,14 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
* Represents 15-bit red, green and blue value
*
* @author JPEXS
*/
public class PIX15 {
public class PIX15 implements Serializable {
/**
* Red color value

View File

@@ -18,13 +18,14 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
* Represents 15-bit red, green and blue value
*
* @author JPEXS
*/
public class PIX24 {
public class PIX24 implements Serializable {
@SWFType(BasicType.UI8)
@Reserved

View File

@@ -18,13 +18,14 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.awt.Color;
import java.io.Serializable;
/**
* Represents 24-bit red, green, blue value
*
* @author JPEXS
*/
public class RGB {
public class RGB implements Serializable {
/**
* Red color value

View File

@@ -18,13 +18,14 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.awt.Color;
import java.io.Serializable;
/**
* Represents 32-bit red, green, blue and alpha value
*
* @author JPEXS
*/
public class RGBA extends RGB {
public class RGBA extends RGB implements Serializable{
/**
* Alpha value defining opacity

View File

@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.tags.base.NeedsCharacters;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -27,7 +28,7 @@ import java.util.Set;
*
* @author JPEXS
*/
public class SHAPE implements NeedsCharacters {
public class SHAPE implements NeedsCharacters,Serializable {
@SWFType(value = BasicType.UB, count = 4)
public int numFillBits;

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.tags.base.NeedsCharacters;
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@@ -25,7 +26,7 @@ import java.util.Set;
*
* @author JPEXS
*/
public class SHAPEWITHSTYLE extends SHAPE implements NeedsCharacters {
public class SHAPEWITHSTYLE extends SHAPE implements NeedsCharacters, Serializable {
public FILLSTYLEARRAY fillStyles;
public LINESTYLEARRAY lineStyles;

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class SOUNDENVELOPE {
public class SOUNDENVELOPE implements Serializable {
@SWFType(BasicType.UI32)
public long pos44;

View File

@@ -19,12 +19,13 @@ package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class SOUNDINFO {
public class SOUNDINFO implements Serializable {
@Reserved
@SWFType(value = BasicType.UB, count = 2)

View File

@@ -22,13 +22,14 @@ import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.FontTag;
import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
import java.util.List;
/**
*
* @author JPEXS
*/
public class TEXTRECORD {
public class TEXTRECORD implements Serializable {
public boolean styleFlagsHasFont;
public boolean styleFlagsHasColor;

View File

@@ -17,13 +17,14 @@
package com.jpexs.decompiler.flash.types;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.Serializable;
/**
* Represents 32-bit alpha, red, green and blue value
*
* @author JPEXS
*/
public class ZONEDATA {
public class ZONEDATA implements Serializable{
@SWFType(BasicType.FLOAT16)
public int alignmentCoordinate;

View File

@@ -16,12 +16,14 @@
*/
package com.jpexs.decompiler.flash.types;
import java.io.Serializable;
/**
* Represents 32-bit alpha, red, green and blue value
*
* @author JPEXS
*/
public class ZONERECORD {
public class ZONERECORD implements Serializable{
public ZONEDATA[] zonedata = new ZONEDATA[0];
public boolean zoneMaskX;

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) 2014 JPEXS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jpexs.decompiler.flash.types.annotations;
/**
* The String field can have large multiline text
*
* @author JPEXS
*/
public @interface Multiline {
}

View File

@@ -19,13 +19,14 @@ package com.jpexs.decompiler.flash.types.filters;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.helpers.SerializableImage;
import java.io.Serializable;
/**
* Bitmap filter
*
* @author JPEXS
*/
public class FILTER {
public class FILTER implements Serializable {
/**
* Identificator of type of the filter

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -28,7 +29,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class ContourType {
public class ContourType implements Serializable {
public int moveToX;
public int moveToY;

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.Serializable;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -28,7 +29,7 @@ import java.util.logging.Logger;
*
* @author JPEXS
*/
public class EdgeType {
public class EdgeType implements Serializable {
private static final int sizes[] = new int[]{1, 2, 1, 2, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 9};
private static final int Edge_H12 = 0; // 2 bytes

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types.gfx;
import java.io.IOException;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class FONTINFO {
public class FONTINFO implements Serializable {
public int fontId;
public GLYPHIDX glyphIndices[];

View File

@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.types.gfx;
import com.jpexs.decompiler.flash.types.SHAPE;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -26,7 +27,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class FontType {
public class FontType implements Serializable {
public static final int FF_Italic = 0x0001;
public static final int FF_Bold = 0x0002;

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types.gfx;
import java.io.IOException;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class GLYPHIDX {
public class GLYPHIDX implements Serializable {
public int indexInFont;
public int indexInTexture;

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types.gfx;
import java.io.IOException;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class GlyphInfoType {
public class GlyphInfoType implements Serializable {
public int glyphCode;
public int advanceX;

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.EndShapeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -29,7 +30,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class GlyphType {
public class GlyphType implements Serializable {
public int[] boundingBox;
public ContourType[] contours;

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types.gfx;
import java.io.IOException;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class KerningPairType {
public class KerningPairType implements Serializable {
public int char1;
public int char2;

View File

@@ -17,12 +17,13 @@
package com.jpexs.decompiler.flash.types.gfx;
import java.io.IOException;
import java.io.Serializable;
/**
*
* @author JPEXS
*/
public class TEXGLYPH {
public class TEXGLYPH implements Serializable {
public float uvBoundsLeft;
public float uvBoundsTop;