Examples of DefineShape4Tag


Examples of org.apache.flex.swf.tags.DefineShape4Tag

       
        ShapeWithStyle sws = new ShapeWithStyle(styles);
        sws.addShapeRecords(shapeRecords);
       
        DefineShape4Tag DefineShapeTag4 = new DefineShape4Tag();
        DefineShapeTag4.setShapes(sws);
        DefineShapeTag4.setShapeBounds(shapeBounds);
        DefineShapeTag4.setEdgeBounds(edgeBounds);
        if ((fill != null) &&( windings.length > 0))
        {
          Winding windingValue = windings[0];
            DefineShapeTag4.setUsesFillWindingRule(windingValue == Winding.NON_ZERO);
        }
       
        return DefineShapeTag4;
    }
View Full Code Here

Examples of org.apache.flex.swf.tags.DefineShape4Tag

            else
                ShapeHelper.setStyles(shapeRecords, lineStyleIndex, fillStyle0Index, fillStyle1Index, styles);
           
            sws.addShapeRecords(shapeRecords);
           
            DefineShape4Tag imageShape = new DefineShape4Tag();
            imageShape.setShapes(sws);
            imageShape.setShapeBounds(edgeBounds);
            imageShape.setEdgeBounds(edgeBounds);
            if ((fill != null) &&( windings.length > 0))
            {
                Winding windingValue = windings[0];
                imageShape.setUsesFillWindingRule(windingValue == Winding.NON_ZERO);
            }
            PlaceObject3Tag po3 = PlaceObject3Tag(imageShape, context);       
            
            if (stroke != null)
            {
                //make a copy of ShapeRecord for strokes
                ArrayList<ShapeRecord> shapeRecords2 = new ArrayList<ShapeRecord>(shapeRecords);
                Collections.copy(shapeRecords2, shapeRecords);

                Styles strokeStyles = new Styles(new FillStyleArray(), new LineStyleArray());

                //generate the define sprite for the stroke object with no clipping
                ShapeWithStyle swsStroke = new ShapeWithStyle(strokeStyles);

                // Consider linestyle stroke widths with bounds calculation              
                AbstractStrokeNode strokeNode = (AbstractStrokeNode) stroke;
                LineStyle ls = createGenericLineStyle(strokeNode);
                Rect shapeBounds =  node.getBounds(shapeRecords2, ls);    
               
                LineStyle lineStyle = createLineStyle(stroke, shapeBounds);
                swsStroke.getLineStyles().add(lineStyle);
               
                lineStyleIndex = 1;
                fillStyle0Index = 0;
                fillStyle1Index = 0;
                ShapeHelper.replaceStyles(shapeRecords2, lineStyleIndex, fillStyle0Index, fillStyle1Index, strokeStyles);
        
                swsStroke.addShapeRecords(shapeRecords2);

                DefineShape4Tag strokeShape = new DefineShape4Tag();
                strokeShape.setShapes(swsStroke);
                strokeShape.setShapeBounds(shapeBounds);
                strokeShape.setEdgeBounds(edgeBounds);
                po3 = PlaceObject3Tag(strokeShape, context);   
            }            
            spriteStack.pop();
           
            po3 = PlaceObject3Tag(imageSprite, new GraphicContext());
View Full Code Here

Examples of org.apache.flex.swf.tags.DefineShape4Tag

     * @throws MalformedTagException
     * @see SWFWriter#writeDefineShape4
     */
    private DefineShape4Tag readDefineShape4() throws IOException, MalformedTagException
    {
        final DefineShape4Tag tag = new DefineShape4Tag();
        tag.setCharacterID(bitStream.readUI16());
        tag.setShapeBounds(readRect());
        tag.setEdgeBounds(readRect());
        bitStream.readUB(5); // skip reserved UB[5]
        tag.setUsesFillWindingRule(bitStream.readBit());
        tag.setUsesNonScalingStrokes(bitStream.readBit());
        tag.setUsesScalingStrokes(bitStream.readBit());
        // 8 bits. No need to align.
        final ShapeWithStyle shapeWithStyle = readShapeWithStyle(TagType.DefineShape4);
        tag.setShapes(shapeWithStyle);
        return tag;
    }
View Full Code Here

Examples of org.apache.flex.swf.tags.DefineShape4Tag

        ShapeHelper.setStyles(shapeRecords, 0, 1, 0, styles);
        sws.addShapeRecords(shapeRecords);
       

        // Wrap up into a SWF DefineShape Tag
        DefineShape4Tag defineShape = new DefineShape4Tag();
        defineShape.setShapeBounds(TypeHelper.rect(width, height));
        defineShape.setEdgeBounds(defineShape.getShapeBounds());
        defineShape.setShapes(sws);

        return defineShape;
    }
View Full Code Here

Examples of org.apache.flex.swf.tags.DefineShape4Tag

        shapeRecords.add(new StraightEdgeRecord(dxc, 0));

        ShapeWithStyle sws = new ShapeWithStyle(styles);
        sws.addShapeRecords(shapeRecords);
       
        DefineShape4Tag shape = new DefineShape4Tag();
        shape.setShapeBounds(TypeHelper.rect(width, height));
        shape.setEdgeBounds(shape.getShapeBounds());
        shape.setShapes(sws);
        return shape;
    }
View Full Code Here

Examples of org.apache.flex.swf.tags.DefineShape4Tag

        return sprite;  
    }

    private DefineShapeTag buildSlicedShape(DefineBitsTag image, Rect r, int width, int height)
    {
        DefineShape4Tag shape = new DefineShape4Tag();

        Rect bounds = new Rect(0, width, 0, height);
        shape.setShapeBounds(bounds);
        shape.setEdgeBounds(bounds);

        FillStyleArray fillStyles = new FillStyleArray();
        LineStyleArray lineStyles = new LineStyleArray();
        Styles styles = new Styles(fillStyles, lineStyles);
        ShapeWithStyle shapeWithStyle = new ShapeWithStyle(styles);
        shape.setShapes(shapeWithStyle);

        // translate into source bitmap
        Matrix tsm = new Matrix();
        // unity in twips
        tsm.setScale(ISWFConstants.TWIPS_PER_PIXEL, ISWFConstants.TWIPS_PER_PIXEL);
View Full Code Here

Examples of org.apache.flex.swf.tags.DefineShape4Tag

        open(tag);
        out.print(" id=\"" + id(tag) + "\"");
        out.print(" bounds=\"" + tag.getShapeBounds() + "\"");
        if (tag.getTagType() == TagType.DefineShape4)
        {
            DefineShape4Tag shape4Tag = (DefineShape4Tag)tag;
            out.print(" edgebounds=\"" + shape4Tag.getEdgeBounds() + "\"");
            out.print(" usesNonScalingStrokes=\"" + shape4Tag.isUsesNonScalingStrokes() + "\"");
            out.print(" usesScalingStrokes=\"" + shape4Tag.isUsesScalingStrokes() + "\"");
        }

        end();

        printShapeWithStyles(tag.getShapes());
View Full Code Here

Examples of tv.porst.swfretools.parser.tags.DefineShape4Tag

      addNode("ShapeID", ctag.getShapeId());
      addNode("ShapeBounds", ctag.getShapeBounds());
      addNode("Shapes", ctag.getShapes());
    }
    else if (tag instanceof DefineShape4Tag) {
      final DefineShape4Tag ctag = (DefineShape4Tag) tag;

      addNode("ShapeID", ctag.getShapeId());
      addNode("ShapeBounds", ctag.getShapeBounds());
      addNode("EdgeBounds", ctag.getEdgeBounds());
      addNode("Reserved", ctag.getReserved());
      addNode("UsesFillWindingRule", ctag.getUsesFillWindingRule());
      addNode("UsesNonScalingStrokes", ctag.getUsesNonScalingStrokes());
      addNode("UsesScalingStrokes", ctag.getUsesScalingStrokes());
      addNode("Shapes", ctag.getShapes());
    }
    else if (tag instanceof DefineShapeTag) {
      final DefineShapeTag ctag = (DefineShapeTag) tag;

      addNode("ShapeID", ctag.getShapeId());
      addNode("ShapeBounds", ctag.getShapeBounds());
      addNode("Shapes", ctag.getShapes());
    }
    else if (tag instanceof DefineSoundTag) {
      final DefineSoundTag ctag = (DefineSoundTag) tag;

      addNode("SpriteID", ctag.getSoundId());
      addNode("SoundFormat", ctag.getSoundFormat());
      addNode("SoundRate", ctag.getSoundRate());
      addNode("SoundSize", ctag.getSoundSize());
      addNode("SoundType", ctag.getSoundType());
      addNode("SoundSampleCount", ctag.getSoundSampleCount());
      addNode("SoundData", ctag.getSoundData());
    }
    else if (tag instanceof DefineSpriteTag) {
      final DefineSpriteTag ctag = (DefineSpriteTag) tag;

      addNode("SpriteID", ctag.getSpriteId());
      addNode("FrameCount", ctag.getFrameCount());
      addNode("ControlTags", ctag.getControlTags());
    }
    else if (tag instanceof DefineText2Tag) {
      final DefineText2Tag ctag = (DefineText2Tag) tag;

      addNode("FontID", ctag.getCharacterId());
      addNode("TextBounds", ctag.getTextBounds());
      addNode("TextMatrix", ctag.getTextMatrix());
      addNode("GlyphBits", ctag.getGlyphBits());
      addNode("AdvanceBits", ctag.getAdvanceBits());
      addNode("TextRecords", ctag.getTextRecords());
      addNode("End", ctag.getEnd());
    }
    else if (tag instanceof DefineTextTag) {
      final DefineTextTag ctag = (DefineTextTag) tag;

      addNode("FontID", ctag.getCharacterId());
      addNode("TextBounds", ctag.getTextBounds());
      addNode("TextMatrix", ctag.getTextMatrix());
      addNode("GlyphBits", ctag.getGlyphBits());
      addNode("AdvanceBits", ctag.getAdvanceBits());
      addNode("TextRecords", ctag.getTextRecords());
      addNode("End", ctag.getEnd());
    }
    else if (tag instanceof DefineVideoStreamTag) {
      final DefineVideoStreamTag ctag = (DefineVideoStreamTag) tag;

      addNode("CharacterID", ctag.getCharacterId());
      addNode("NumFrames", ctag.getNumFrames());
      addNode("Width", ctag.getWidth());
      addNode("Height", ctag.getHeight());
      addNode("VideoFlagsReserved", ctag.getVideoFlagsReserved());
      addNode("VideoFlagsDeblocking", ctag.getVideoFlagsDeblocking());
      addNode("VideoFlagsSmoothing", ctag.getVideoFlagsSmoothing());
      addNode("CodecID", ctag.getCodecId());
    }
    else if (tag instanceof DoActionTag) {
      final DoActionTag ctag = (DoActionTag) tag;

      addNode("Actions", ctag.getActions());
    }
    else if (tag instanceof DoInitActionTag) {
      final DoInitActionTag ctag = (DoInitActionTag) tag;

      addNode("SpriteID", ctag.getSpriteId());
      addNode("Actions", ctag.getActions());
    }
    else if (tag instanceof EnableDebugger2Tag) {
      final EnableDebugger2Tag ctag = (EnableDebugger2Tag) tag;

      addNode("Password", ctag.getPassword());
      addNode("Reserved", ctag.getReserved());
    }
    else if (tag instanceof EnableDebuggerTag) {
      final EnableDebuggerTag ctag = (EnableDebuggerTag) tag;

      addNode("Password", ctag.getPassword());
    }
    else if (tag instanceof EndTag) {
      // Nothing to do here
    }
    else if (tag instanceof ExportAssetsTag) {
      final ExportAssetsTag ctag = (ExportAssetsTag) tag;

      addNode("Count", ctag.getCount());
      addNode("Assets", ctag.getAssets());
    }
    else if (tag instanceof FileAttributesTag) {
      final FileAttributesTag ctag = (FileAttributesTag) tag;

      addNode("Reserved", ctag.getReserved());
      addNode("UseDirectBit", ctag.getUseDirectBit());
      addNode("UseGPU", ctag.getUseGPU());
      addNode("HasMetadata", ctag.getHasMetadata());
      addNode("ActionScript3", ctag.getActionScript3());
      addNode("Reserved2", ctag.getReserved2());
      addNode("Network", ctag.getUseNetwork());
      addNode("Reserved3", ctag.getReserved3());
    }
    else if (tag instanceof FrameLabelTag) {
      final FrameLabelTag ctag = (FrameLabelTag) tag;

      addNode("Name", ctag.getName());
      addNode("NamedAnchorFlag", ctag.getNamedAnchorFlag());
    }
    else if (tag instanceof ImportAssets2Tag) {
      final ImportAssets2Tag ctag = (ImportAssets2Tag) tag;

      addNode("URLs", ctag.getUrl());
      addNode("Count", ctag.getCount());
      addNode("Symbols", ctag.getSymbols());
      addNode("Count", ctag.getReserved());
      addNode("Count", ctag.getReserved2());
    }
    else if (tag instanceof ImportAssetsTag) {
      final ImportAssetsTag ctag = (ImportAssetsTag) tag;

      addNode("URLs", ctag.getUrl());
      addNode("Count", ctag.getCount());
      addNode("Symbols", ctag.getSymbols());
    }
    else if (tag instanceof JPEGTablesTag) {
      final JPEGTablesTag ctag = (JPEGTablesTag) tag;

      addNode("JPEGData", ctag.getJpegData());
    }
    else if (tag instanceof MetadataTag) {
      final MetadataTag ctag = (MetadataTag) tag;

      addNode("Metadata", ctag.getMetadata());
    }
    else if (tag instanceof PlaceObject2Tag) {
      final PlaceObject2Tag ctag = (PlaceObject2Tag) tag;

      addNode("PlaceFlagHasClipActions", ctag.getPlaceFlagHasClipActions());
      addNode("PlaceFlagHasClipDepth", ctag.getPlaceFlagHasClipDepth());
      addNode("PlaceFlagHasName", ctag.getPlaceFlagHasName());
      addNode("PlaceFlagHasRatio", ctag.getPlaceFlagHasRatio());
      addNode("PlaceFlagHasColorTransform", ctag.getPlaceFlagHasColorTransform());
      addNode("PlaceFlagHasMatrix", ctag.getPlaceFlagHasMatrix());
      addNode("PlaceFlagHasCharacter", ctag.getPlaceFlagHasCharacter());
      addNode("PlaceFlagHasMove", ctag.getPlaceFlagHasMove());
      addNode("Depth", ctag.getDepth());
      addNode("CharacterID", ctag.getCharacterId());
      addNode("Matrix", ctag.getMatrix());
      addNode("ColorTransform", ctag.getColorTransform());
      addNode("Ratio", ctag.getRatio());
      addNode("Name", ctag.getName());
      addNode("ClipDepth", ctag.getClipDepth());
      addNode("ClipActions", ctag.getClipActions());
    }
    else if (tag instanceof PlaceObject3Tag) {
      final PlaceObject3Tag ctag = (PlaceObject3Tag) tag;

      addNode("PlaceFlagHasClipActions", ctag.getPlaceFlagHasClipActions());
      addNode("PlaceFlagHasClipDepth", ctag.getPlaceFlagHasClipDepth());
      addNode("PlaceFlagHasName", ctag.getPlaceFlagHasName());
      addNode("PlaceFlagHasRatio", ctag.getPlaceFlagHasRatio());
      addNode("PlaceFlagHasColorTransform", ctag.getPlaceFlagHasColorTransform());
      addNode("PlaceFlagHasMatrix", ctag.getPlaceFlagHasMatrix());
      addNode("PlaceFlagHasCharacter", ctag.getPlaceFlagHasCharacter());
      addNode("PlaceFlagHasMove", ctag.getPlaceFlagHasMove());
      addNode("Reserved", ctag.getReserved());
      addNode("PlaceFlagHasImage", ctag.getPlaceFlagHasImage());
      addNode("PlaceFlagHasClassName", ctag.getPlaceFlagHasClassName());
      addNode("PlaceFlagHasCacheAsBitmap", ctag.getPlaceFlagHasCacheAsBitmap());
      addNode("PlaceFlagHasBlendMode", ctag.getPlaceFlagHasBlendMode());
      addNode("PlaceFlagHasFilterList", ctag.getPlaceFlagHasFilterList());
      addNode("Depth", ctag.getDepth());
      addNode("ClassName", ctag.getClassName());
      addNode("CharacterID", ctag.getCharacterId());
      addNode("Matrix", ctag.getMatrix());
      addNode("ColorTransform", ctag.getColorTransform());
      addNode("Ratio", ctag.getRatio());
      addNode("Name", ctag.getName());
      addNode("ClipDepth", ctag.getClipDepth());
      addNode("SurfaceFilterList", ctag.getSurfaceFilterList());
      addNode("BlendMode", ctag.getBlendMode());
      addNode("BitmapCache", ctag.getBitmapCache());
      addNode("ClipActions", ctag.getClipActions());
    }
    else if (tag instanceof PlaceObjectTag) {
      final PlaceObjectTag ctag = (PlaceObjectTag) tag;

      addNode("CharacterID", ctag.getCharacterId());
      addNode("Depth", ctag.getDepth());
      addNode("Matrix", ctag.getMatrix());
      addNode("ColorTransform", ctag.getColorTransform());
    }
    else if (tag instanceof RemoveObject2Tag) {
      final RemoveObject2Tag ctag = (RemoveObject2Tag) tag;

      addNode("Depth", ctag.getDepth());
    }
    else if (tag instanceof RemoveObjectTag) {
      final RemoveObjectTag ctag = (RemoveObjectTag) tag;

      addNode("CharacterID", ctag.getCharacterId());
      addNode("Depth", ctag.getDepth());
    }
    else if (tag instanceof ScriptLimitsTag) {
      final ScriptLimitsTag ctag = (ScriptLimitsTag) tag;

      addNode("MaxRecursionDepth", ctag.getMaxRecursionDepth());
      addNode("ScriptTimeoutSeconds", ctag.getScriptTimeoutSeconds());
    }
    else if (tag instanceof SetBackgroundColorTag) {
      final SetBackgroundColorTag ctag = (SetBackgroundColorTag) tag;

      addNode("BackgroundColor", ctag.getBackgroundColor());
    }
    else if (tag instanceof SetTabIndexTag) {
      final SetTabIndexTag ctag = (SetTabIndexTag) tag;

      addNode("Depth", ctag.getDepth());
      addNode("TabIndex", ctag.getTabIndex());
    }
    else if (tag instanceof ShowFrameTag) {
      // Nothing to do here
    }
    else if (tag instanceof SoundStreamBlockTag) {
      final SoundStreamBlockTag ctag = (SoundStreamBlockTag) tag;

      addNode("StreamSoundData", ctag.getStreamSoundData());
    }
    else if (tag instanceof SoundStreamHead2Tag) {
      final SoundStreamHead2Tag ctag = (SoundStreamHead2Tag) tag;

      addNode("Reserved", ctag.getReserved());
      addNode("PlaybackSoundRate", ctag.getPlaybackSoundRate());
      addNode("PlaybackSoundSize", ctag.getPlaybackSoundSize());
      addNode("PlaybackSoundType", ctag.getPlaybackSoundType());
      addNode("StreamSoundCompression", ctag.getStreamSoundCompression());
      addNode("StreamSoundRate", ctag.getStreamSoundRate());
      addNode("StreamSoundSize", ctag.getStreamSoundSize());
      addNode("StreamSoundType", ctag.getStreamSoundType());
      addNode("StreamSoundSampleCount", ctag.getStreamSoundSampleCount());
      addNode("LatencySeek", ctag.getLatencySeek());
    }
    else if (tag instanceof SoundStreamHeadTag) {
      final SoundStreamHeadTag ctag = (SoundStreamHeadTag) tag;

      addNode("Reserved", ctag.getReserved());
      addNode("PlaybackSoundRate", ctag.getPlaybackSoundRate());
      addNode("PlaybackSoundSize", ctag.getPlaybackSoundSize());
      addNode("PlaybackSoundType", ctag.getPlaybackSoundType());
      addNode("StreamSoundCompression", ctag.getStreamSoundCompression());
      addNode("StreamSoundRate", ctag.getStreamSoundRate());
      addNode("StreamSoundSize", ctag.getStreamSoundSize());
      addNode("StreamSoundType", ctag.getStreamSoundType());
      addNode("StreamSoundSampleCount", ctag.getStreamSoundSampleCount());
      addNode("LatencySeek", ctag.getLatencySeek());
    }
    else if (tag instanceof StartSound2Tag) {
      final StartSound2Tag ctag = (StartSound2Tag) tag;

      addNode("SoundClassName", ctag.getSoundClassName());
      addNode("SoundInfo", ctag.getSoundInfo());
    }
    else if (tag instanceof StartSoundTag) {
      final StartSoundTag ctag = (StartSoundTag) tag;

      addNode("SoundID", ctag.getSoundId());
      addNode("SoundInfo", ctag.getSoundInfo());
    }
    else if (tag instanceof SymbolClassTag) {
      final SymbolClassTag ctag = (SymbolClassTag) tag;

      addNode("NumSymbols", ctag.getNumSymbols());
      addNode("Symbols", ctag.getSymbols());
    }
    else if (tag instanceof VideoFrameTag) {
      final VideoFrameTag ctag = (VideoFrameTag) tag;

      addNode("StreamID", ctag.getStreamId());
      addNode("FrameNum", ctag.getFrameNum());
      addNode("VideoData", ctag.getVideoData());
    }
    else if (tag instanceof RawABCTag) {
      final RawABCTag ctag = (RawABCTag) tag;

      addNode("ABCData", ctag.getAbcData());
    }
    else if (tag instanceof DoABCTag) {
      final DoABCTag ctag = (DoABCTag) tag;

      addNode("Name", ctag.getName());
      addNode("Flags", ctag.getFlags());
      addNode("ABCData", ctag.getAbcData());
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.