setCharacterId methods moved after getCharacterId

This commit is contained in:
2015-05-14 16:55:57 +02:00
parent dcee51c656
commit 90957416c2
37 changed files with 188 additions and 234 deletions
@@ -1,18 +1,19 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library 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
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
* License along with this library.
*/
package com.jpexs.decompiler.flash.importers;
import com.jpexs.decompiler.flash.SWF;
@@ -22,7 +23,6 @@ import com.jpexs.decompiler.flash.tags.DefineBitsTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.ImageTag;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -35,7 +35,7 @@ public class ImageImporter extends TagImporter {
public Tag importImage(ImageTag it, byte[] newData) throws IOException {
if (newData[0] == 'B' && newData[1] == 'M') {
BufferedImage b = ImageHelper.read(new ByteArrayInputStream(newData));
BufferedImage b = ImageHelper.read(newData);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageHelper.write(b, "PNG", baos);
newData = baos.toByteArray();
@@ -19,15 +19,10 @@ package com.jpexs.decompiler.flash.importers;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.helpers.ImageHelper;
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag;
import com.jpexs.decompiler.flash.tags.DefineShape2Tag;
import com.jpexs.decompiler.flash.tags.DefineShape3Tag;
import com.jpexs.decompiler.flash.tags.DefineShape4Tag;
import com.jpexs.decompiler.flash.tags.DefineShapeTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -41,7 +36,7 @@ public class ShapeImporter {
SWF swf = st.getSwf();
if (newData[0] == 'B' && newData[1] == 'M') {
BufferedImage b = ImageHelper.read(new ByteArrayInputStream(newData));
BufferedImage b = ImageHelper.read(newData);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageHelper.write(b, "PNG", baos);
newData = baos.toByteArray();
@@ -54,20 +49,7 @@ public class ShapeImporter {
st.setModified(true);
SHAPEWITHSTYLE shapes = jpeg2Tag.getShape(st.getRect(), true);
if (st instanceof DefineShapeTag) {
DefineShapeTag dst = (DefineShapeTag) st;
dst.shapes = shapes;
} else if (st instanceof DefineShape2Tag) {
DefineShape2Tag dst = (DefineShape2Tag) st;
dst.shapes = shapes;
} else if (st instanceof DefineShape3Tag) {
DefineShape3Tag dst = (DefineShape3Tag) st;
dst.shapes = shapes;
} else if (st instanceof DefineShape4Tag) {
DefineShape4Tag dst = (DefineShape4Tag) st;
dst.shapes = shapes;
}
st.shapes = shapes;
return (Tag) st;
}
}
@@ -113,6 +113,11 @@ public class DefineBinaryDataTag extends CharacterTag {
return tag;
}
@Override
public void setCharacterId(int characterId) {
this.tag = characterId;
}
public boolean isSwfData() {
try {
if (binaryData.getLength() > 8) {
@@ -143,9 +148,4 @@ public class DefineBinaryDataTag extends CharacterTag {
}
return false;
}
@Override
public void setCharacterId(int characterId) {
this.tag = characterId;
}
}
@@ -54,6 +54,11 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag {
return characterID;
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
@Override
public String getImageFormat() {
return ImageTag.getImageFormat(imageData);
@@ -134,9 +139,4 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag {
}
return baos.toByteArray();
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
}
@@ -58,6 +58,11 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag {
return characterID;
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
@Override
public void setImage(byte[] data) throws IOException {
if (ImageTag.getImageFormat(data).equals("jpg")) {
@@ -167,9 +172,4 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag {
}
return baos.toByteArray();
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
}
@@ -61,6 +61,11 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag {
return characterID;
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
@Override
public String getImageFormat() {
String fmt = ImageTag.getImageFormat(imageData);
@@ -178,9 +183,4 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag {
imageData = sis.readByteRangeEx(alphaDataOffset, "imageData");
bitmapAlphaData = sis.readByteRangeEx(sis.available(), "bitmapAlphaData");
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
}
@@ -86,6 +86,11 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag {
return characterID;
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
private byte[] createEmptyImage() {
try {
ALPHABITMAPDATA bitmapData = new ALPHABITMAPDATA();
@@ -275,9 +280,4 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag {
cachedImage = bi;
return bi;
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
}
@@ -191,6 +191,11 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
return characterID;
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
public COLORMAPDATA getColorMapData() {
if (!decompressed) {
uncompressData();
@@ -279,9 +284,4 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
public String getImageFormat() {
return "png";
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
}
@@ -141,6 +141,11 @@ public class DefineBitsTag extends ImageTag implements TagChangedListener {
return characterID;
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
@Override
public String getImageFormat() {
return "jpg";
@@ -150,9 +155,4 @@ public class DefineBitsTag extends ImageTag implements TagChangedListener {
public void handleEvent(Tag tag) {
clearCache();
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
}
@@ -93,6 +93,11 @@ public class DefineButton2Tag extends ButtonTag implements ASMSourceContainer {
return buttonId;
}
@Override
public void setCharacterId(int characterId) {
this.buttonId = characterId;
}
@Override
public List<BUTTONRECORD> getRecords() {
return characters;
@@ -350,9 +355,4 @@ public class DefineButton2Tag extends ButtonTag implements ASMSourceContainer {
timeline.addFrame(frameHit);
}
@Override
public void setCharacterId(int characterId) {
this.buttonId = characterId;
}
}
@@ -64,6 +64,11 @@ public class DefineButtonSoundTag extends Tag implements CharacterIdTag {
return buttonId;
}
@Override
public void setCharacterId(int characterId) {
this.buttonId = characterId;
}
/**
* Gets data bytes
*
@@ -139,9 +144,4 @@ public class DefineButtonSoundTag extends Tag implements CharacterIdTag {
buttonSoundInfo3 = sis.readSOUNDINFO("buttonSoundInfo3");
}
}
@Override
public void setCharacterId(int characterId) {
this.buttonId = characterId;
}
}
@@ -86,6 +86,11 @@ public class DefineButtonTag extends ButtonTag implements ASMSource {
return buttonId;
}
@Override
public void setCharacterId(int characterId) {
this.buttonId = characterId;
}
private Timeline timeline;
private boolean isSingleFrameInitialized;
@@ -441,9 +446,4 @@ public class DefineButtonTag extends ButtonTag implements ASMSource {
public Tag getSourceTag() {
return this;
}
@Override
public void setCharacterId(int characterId) {
this.buttonId = characterId;
}
}
@@ -736,6 +736,11 @@ public class DefineEditTextTag extends TextTag {
return characterID;
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
/**
* Gets data bytes
*
@@ -1126,9 +1131,4 @@ public class DefineEditTextTag extends TextTag {
public boolean isSingleFrame() {
return true;
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
}
@@ -315,6 +315,11 @@ public class DefineFont2Tag extends FontTag {
return fontId;
}
@Override
public void setCharacterId(int characterId) {
this.fontId = characterId;
}
@Override
public char glyphToChar(int glyphIndex) {
return (char) (int) codeTable.get(glyphIndex);
@@ -499,9 +504,4 @@ public class DefineFont2Tag extends FontTag {
}
return kerningAdjustment;
}
@Override
public void setCharacterId(int characterId) {
this.fontId = characterId;
}
}
@@ -324,6 +324,11 @@ public class DefineFont3Tag extends FontTag {
return fontId;
}
@Override
public void setCharacterId(int characterId) {
this.fontId = characterId;
}
@Override
public String getFontNameIntag() {
String ret = fontName;
@@ -519,9 +524,4 @@ public class DefineFont3Tag extends FontTag {
}
return kerningAdjustment;
}
@Override
public void setCharacterId(int characterId) {
this.fontId = characterId;
}
}
@@ -58,6 +58,11 @@ public class DefineFont4Tag extends CharacterTag {
return fontID;
}
@Override
public void setCharacterId(int characterId) {
this.fontID = characterId;
}
/**
* Constructor
*
@@ -109,9 +114,4 @@ public class DefineFont4Tag extends CharacterTag {
}
return baos.toByteArray();
}
@Override
public void setCharacterId(int characterId) {
this.fontID = characterId;
}
}
@@ -199,6 +199,11 @@ public class DefineFontTag extends FontTag {
return fontId;
}
@Override
public void setCharacterId(int characterId) {
this.fontId = characterId;
}
@Override
public String getFontNameIntag() {
ensureFontInfo();
@@ -360,9 +365,4 @@ public class DefineFontTag extends FontTag {
public int getCharKerningAdjustment(char c1, char c2) {
return 0;
}
@Override
public void setCharacterId(int characterId) {
this.fontId = characterId;
}
}
@@ -21,10 +21,8 @@ import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.BoundedTag;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.helpers.ByteArrayRange;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -39,13 +37,6 @@ import java.util.logging.Logger;
*/
public class DefineShape2Tag extends ShapeTag {
@SWFType(BasicType.UI16)
public int shapeId;
public RECT shapeBounds;
public SHAPEWITHSTYLE shapes;
public static final int ID = 22;
private ByteArrayRange shapeData;
@@ -94,11 +85,6 @@ public class DefineShape2Tag extends ShapeTag {
return modified;
}
@Override
public int getCharacterId() {
return shapeId;
}
@Override
public RECT getRect(Set<BoundedTag> added) {
return shapeBounds;
@@ -162,6 +148,11 @@ public class DefineShape2Tag extends ShapeTag {
return true;
}
@Override
public int getCharacterId() {
return shapeId;
}
@Override
public void setCharacterId(int characterId) {
this.shapeId = characterId;
@@ -21,10 +21,8 @@ import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.BoundedTag;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.helpers.ByteArrayRange;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -39,13 +37,6 @@ import java.util.logging.Logger;
*/
public class DefineShape3Tag extends ShapeTag {
@SWFType(BasicType.UI16)
public int shapeId;
public RECT shapeBounds;
public SHAPEWITHSTYLE shapes;
public static final int ID = 32;
private ByteArrayRange shapeData;
@@ -99,11 +90,6 @@ public class DefineShape3Tag extends ShapeTag {
return shapeBounds;
}
@Override
public int getCharacterId() {
return shapeId;
}
/**
* Constructor
*
@@ -162,6 +148,11 @@ public class DefineShape3Tag extends ShapeTag {
return true;
}
@Override
public int getCharacterId() {
return shapeId;
}
@Override
public void setCharacterId(int characterId) {
this.shapeId = characterId;
@@ -40,11 +40,6 @@ import java.util.logging.Logger;
*/
public class DefineShape4Tag extends ShapeTag {
@SWFType(BasicType.UI16)
public int shapeId;
public RECT shapeBounds;
public RECT edgeBounds;
@Reserved
@@ -57,8 +52,6 @@ public class DefineShape4Tag extends ShapeTag {
public boolean usesScalingStrokes;
public SHAPEWITHSTYLE shapes;
public static final int ID = 83;
private ByteArrayRange shapeData;
@@ -107,11 +100,6 @@ public class DefineShape4Tag extends ShapeTag {
return modified;
}
@Override
public int getCharacterId() {
return shapeId;
}
@Override
public RECT getRect(Set<BoundedTag> added) {
return shapeBounds;
@@ -186,6 +174,11 @@ public class DefineShape4Tag extends ShapeTag {
return true;
}
@Override
public int getCharacterId() {
return shapeId;
}
@Override
public void setCharacterId(int characterId) {
this.shapeId = characterId;
@@ -21,10 +21,8 @@ import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.BoundedTag;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.helpers.ByteArrayRange;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -38,13 +36,6 @@ import java.util.logging.Logger;
*/
public class DefineShapeTag extends ShapeTag {
@SWFType(BasicType.UI16)
public int shapeId;
public RECT shapeBounds;
public SHAPEWITHSTYLE shapes;
public static final int ID = 2;
private ByteArrayRange shapeData;
@@ -145,11 +136,6 @@ public class DefineShapeTag extends ShapeTag {
return baos.toByteArray();
}
@Override
public int getCharacterId() {
return shapeId;
}
@Override
public int getNumFrames() {
return 1;
@@ -160,6 +146,11 @@ public class DefineShapeTag extends ShapeTag {
return true;
}
@Override
public int getCharacterId() {
return shapeId;
}
@Override
public void setCharacterId(int characterId) {
this.shapeId = characterId;
@@ -72,6 +72,11 @@ public class DefineSoundTag extends CharacterTag implements SoundTag {
return soundId;
}
@Override
public void setCharacterId(int characterId) {
this.soundId = characterId;
}
/**
* Gets data bytes
*
@@ -354,9 +359,4 @@ public class DefineSoundTag extends CharacterTag implements SoundTag {
final int[] rateMap = {5512, 11025, 22050, 44100};
return new SoundFormat(getSoundFormatId(), rateMap[getSoundRate()], getSoundType());
}
@Override
public void setCharacterId(int characterId) {
this.soundId = characterId;
}
}
@@ -107,6 +107,11 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli
return spriteId;
}
@Override
public void setCharacterId(int characterId) {
this.spriteId = characterId;
}
private RECT getCharacterBounds(Set<Integer> characters, Set<BoundedTag> added) {
RECT ret = new RECT(Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE);
boolean foundSomething = false;
@@ -328,6 +333,11 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli
return PARAMETER_FRAME | PARAMETER_TIME | PARAMETER_RATIO; // inner tags can contain morphshapes, too
}
@Override
public Shape getOutline(int frame, int time, int ratio, RenderContext renderContext, Matrix transformation) {
return getTimeline().getOutline(frame, time, ratio, renderContext, transformation);
}
@Override
public void toImage(int frame, int time, int ratio, RenderContext renderContext, SerializableImage image, Matrix transformation, ColorTransform colorTransform) {
SWF.frameToImage(getTimeline(), frame, time, renderContext, image, transformation, colorTransform);
@@ -338,6 +348,11 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli
SWF.frameToSvg(getTimeline(), 0, 0, null, 0, exporter, colorTransform, level + 1, zoom);
}
@Override
public String toHtmlCanvas(double unitDivisor) {
return getTimeline().toHtmlCanvas(unitDivisor, null);
}
@Override
public int getNumFrames() {
// flashplayer ignores the count stored in frameCount
@@ -364,11 +379,6 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli
}
}
@Override
public Shape getOutline(int frame, int time, int ratio, RenderContext renderContext, Matrix transformation) {
return getTimeline().getOutline(frame, time, ratio, renderContext, transformation);
}
@Override
public boolean isModified() {
if (super.isModified()) {
@@ -381,14 +391,4 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli
}
return false;
}
@Override
public String toHtmlCanvas(double unitDivisor) {
return getTimeline().toHtmlCanvas(unitDivisor, null);
}
@Override
public void setCharacterId(int characterId) {
this.spriteId = characterId;
}
}
@@ -76,6 +76,11 @@ public class DefineVideoStreamTag extends CharacterTag implements BoundedTag {
return characterID;
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
/**
* Gets data bytes
*
@@ -144,9 +149,4 @@ public class DefineVideoStreamTag extends CharacterTag implements BoundedTag {
public RECT getRect(Set<BoundedTag> added) {
return new RECT(0, (int) (SWF.unitDivisor * width), 0, (int) (SWF.unitDivisor * height));
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
}
@@ -184,6 +184,11 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource {
return spriteId;
}
@Override
public void setCharacterId(int characterId) {
this.spriteId = characterId;
}
List<DisassemblyListener> listeners = new ArrayList<>();
@Override
@@ -250,9 +255,4 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource {
public Tag getSourceTag() {
return this;
}
@Override
public void setCharacterId(int characterId) {
this.spriteId = characterId;
}
}
@@ -323,6 +323,12 @@ public class PlaceObject2Tag extends PlaceObjectTypeTag implements ASMSourceCont
}
}
@Override
public void setCharacterId(int characterId) {
placeFlagHasCharacter = true;
this.characterId = characterId;
}
@Override
public int getDepth() {
return depth;
@@ -431,9 +437,4 @@ public class PlaceObject2Tag extends PlaceObjectTypeTag implements ASMSourceCont
setModified(mod);
matrix = old;
}
@Override
public void setCharacterId(int characterId) {
this.characterId = characterId;
}
}
@@ -458,6 +458,12 @@ public class PlaceObject3Tag extends PlaceObjectTypeTag implements ASMSourceCont
}
}
@Override
public void setCharacterId(int characterId) {
placeFlagHasCharacter = true;
this.characterId = characterId;
}
@Override
public int getDepth() {
return depth;
@@ -576,9 +582,4 @@ public class PlaceObject3Tag extends PlaceObjectTypeTag implements ASMSourceCont
setModified(mod);
matrix = old;
}
@Override
public void setCharacterId(int characterId) {
this.characterId = characterId;
}
}
@@ -461,6 +461,12 @@ public class PlaceObject4Tag extends PlaceObjectTypeTag implements ASMSourceCont
}
}
@Override
public void setCharacterId(int characterId) {
placeFlagHasCharacter = true;
this.characterId = characterId;
}
@Override
public int getDepth() {
return depth;
@@ -579,9 +585,4 @@ public class PlaceObject4Tag extends PlaceObjectTypeTag implements ASMSourceCont
setModified(mod);
matrix = old;
}
@Override
public void setCharacterId(int characterId) {
this.characterId = characterId;
}
}
@@ -162,6 +162,11 @@ public class PlaceObjectTag extends PlaceObjectTypeTag {
return characterId;
}
@Override
public void setCharacterId(int characterId) {
this.characterId = characterId;
}
@Override
public int getDepth() {
return depth;
@@ -242,9 +247,4 @@ public class PlaceObjectTag extends PlaceObjectTypeTag {
setModified(mod);
matrix = old;
}
@Override
public void setCharacterId(int characterId) {
this.characterId = characterId;
}
}
@@ -79,6 +79,11 @@ public class SoundStreamHead2Tag extends Tag implements SoundStreamHeadTypeTag {
return virtualCharacterId;
}
@Override
public void setCharacterId(int characterId) {
virtualCharacterId = characterId;
}
@Override
public String getExportFormat() {
if (streamSoundCompression == SoundFormat.FORMAT_MP3) {
@@ -243,9 +248,4 @@ public class SoundStreamHead2Tag extends Tag implements SoundStreamHeadTypeTag {
String exportName = swf.getExportName(getCharacterId());
return getCharacterId() + (exportName != null ? "_" + exportName : "");
}
@Override
public void setCharacterId(int characterId) {
this.virtualCharacterId = characterId;
}
}
@@ -100,7 +100,7 @@ public class SoundStreamHeadTag extends Tag implements SoundStreamHeadTypeTag {
@Override
public void setCharacterId(int characterId) {
this.virtualCharacterId = characterId;
virtualCharacterId = characterId;
}
@Override
@@ -117,6 +117,11 @@ public abstract class MorphShapeTag extends CharacterTag implements DrawableTag
return characterId;
}
@Override
public void setCharacterId(int characterId) {
this.characterId = characterId;
}
@Override
public RECT getRect(Set<BoundedTag> added) {
RECT rect = new RECT();
@@ -320,9 +325,4 @@ public abstract class MorphShapeTag extends CharacterTag implements DrawableTag
cmse.export();
return cmse.getShapeData();
}
@Override
public void setCharacterId(int characterId) {
this.characterId = characterId;
}
}
@@ -25,9 +25,11 @@ import com.jpexs.decompiler.flash.exporters.shape.CanvasShapeExporter;
import com.jpexs.decompiler.flash.exporters.shape.PathExporter;
import com.jpexs.decompiler.flash.exporters.shape.SVGShapeExporter;
import com.jpexs.decompiler.flash.helpers.LazyObject;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.SerializableImage;
import java.awt.Color;
@@ -46,6 +48,13 @@ import java.util.Set;
*/
public abstract class ShapeTag extends CharacterTag implements DrawableTag, LazyObject {
@SWFType(BasicType.UI16)
public int shapeId;
public RECT shapeBounds;
public SHAPEWITHSTYLE shapes;
private final int markerSize = 10;
public ShapeTag(SWF swf, int id, String name, ByteArrayRange data) {
@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library 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
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
@@ -32,7 +32,5 @@ public interface SoundStreamHeadTypeTag extends CharacterIdTag, SoundTag {
public void setVirtualCharacterId(int ch);
public int getCharacterId();
public List<SoundStreamBlockTag> getBlocks();
}
@@ -171,13 +171,13 @@ public abstract class StaticTextTag extends TextTag {
}
@Override
public void setCharacterId(int characterId) {
this.characterID = characterId;
public int getCharacterId() {
return characterID;
}
@Override
public int getCharacterId() {
return characterID;
public void setCharacterId(int characterId) {
this.characterID = characterId;
}
@Override
@@ -93,9 +93,6 @@ public abstract class TextTag extends CharacterTag implements DrawableTag {
public abstract boolean translateText(int diff);
@Override
public abstract int getCharacterId();
public abstract RECT getBounds();
public abstract void setBounds(RECT r);
@@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.helpers.FontHelper;
import com.jpexs.decompiler.flash.tags.DefineFont2Tag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.DrawableTag;
import com.jpexs.decompiler.flash.tags.base.FontTag;
import com.jpexs.decompiler.flash.types.KERNINGRECORD;
import com.jpexs.decompiler.flash.types.LANGCODE;
@@ -148,6 +147,11 @@ public final class DefineCompactedFont extends FontTag {
return fontId;
}
@Override
public void setCharacterId(int characterId) {
this.fontId = characterId;
}
@Override
public int getFontId() {
return fontId;
@@ -423,9 +427,4 @@ public final class DefineCompactedFont extends FontTag {
public boolean hasLayout() {
return true;
}
@Override
public void setCharacterId(int characterId) {
this.fontId = characterId;
}
}