public PlaceObject(Matrix m, DefineTag ref_Renamed, int depth, String name) : base(Flash.Swf.TagValues.stagPlaceObject2)
 {
     this.depth = depth;
     Matrix     = m;
     Ref        = ref_Renamed;
     Name       = name;
 }
		public DefineScalingGrid(DefineTag tag):this()
		{
			System.Diagnostics.Debug.Assert(tag is DefineSprite || tag is DefineButton);
			
			if (tag is DefineSprite)
			{
				((DefineSprite) tag).scalingGrid = this;
			}
		}
        public DefineScalingGrid(DefineTag tag) : this()
        {
            System.Diagnostics.Debug.Assert(tag is DefineSprite || tag is DefineButton);

            if (tag is DefineSprite)
            {
                ((DefineSprite)tag).scalingGrid = this;
            }
        }
Example #4
0
        public override bool Equals(System.Object object_Renamed)
        {
            bool isEqual = false;

            if (base.Equals(object_Renamed) && (object_Renamed is DefineTag))
            {
                DefineTag defineTag = (DefineTag)object_Renamed;

                if (equals(defineTag.name, this.name))
                {
                    isEqual = true;
                }
            }

            return(isEqual);
        }
Example #5
0
		public virtual int getId(DefineTag tag)
		{
			if (tag == null || tag == INVALID_TAG)
			{
				return - 1; //throw new NullPointerException("no ids for null tags");
			}
			else
			{
				// when we're encoding, we should definitely find the tag here.
				System.Object idobj = tags[tag];
				
				if (idobj == null)
				{
					// When we're decoding, we don't fill in the tags map, and so we'll have
					// to search for the tag to see what it had when we read it in.
					
                    foreach (System.Collections.DictionaryEntry entry in ids)
					{
						// [ets 1/14/04] we use an exact comparison here instead of equals() because this point
						// should only be reached during *decoding*, by tools that want to report the id
						// that is only stored in the ids map.  Since each DefineTag from a single swf will
						// be a unique object, this should be safe.  During encoding, we will find ID's stored
						// in the tags map, and the ids map should be empty.  if we use equals(), it is possible
						// for tools to report the wrong ID, because the defineTags may not be fully decoded yet,
						// for example the ExportAssets may not have been reached, so the tag might not have its
						// name yet, and therefore compare equal to another unique but yet-unnamed tag.
						
						if (entry.Value == tag)
						{
							idobj = entry.Key;
							break;
						}
					}
				}
				
				if (idobj == null)
				{
					System.Diagnostics.Debug.Assert(false, "encoding error, " + tag.name + " not in dictionary");
				}
				
				return ((System.Int32) idobj);
			}
		}
 public PlaceObject(DefineTag ref_Renamed, int depth) : base(Flash.Swf.TagValues.stagPlaceObject2)
 {
     this.depth = depth;
     Ref        = ref_Renamed;
 }
Example #7
0
		public virtual bool contains(DefineTag tag)
		{
			return tags.Contains(tag);
		}
Example #8
0
		public virtual void  addName(DefineTag s, String name)
		{
			names[name] = s;
		}
Example #9
0
		/// <summary> This is method used during decoding.
		/// 
		/// </summary>
		/// <param name="id">
		/// </param>
		/// <param name="s">
		/// </param>
		/// <throws>  IllegalArgumentException if the dictionary already has that id </throws>
		public virtual void  add(int id, DefineTag s)
		{
			System.Int32 key = (System.Int32) id;
			Tag t = (Tag) ids[key];
			if (t == null)
			{
				ids[key] = s;
				// This DefineTag is potentially very generic, for example
				// it's name is most likely null, so don't bother adding
				// it to the tags Map.
			}
			else
			{
				if (t.Equals(s))
					throw new System.ArgumentException("symbol " + id + " redefined by identical tag");
				else
					throw new System.ArgumentException("symbol " + id + " redefined by different tag");
			}
		}
Example #10
0
		/// <summary> This is the method used during encoding.</summary>
		public virtual int add(DefineTag tag)
		{
			System.Diagnostics.Debug.Assert(tag != null);
            if (tags.Contains(tag))
            {
                //throw new IllegalArgumentException("symbol " +tag+ " redefined");
                return (int) tags[tag];
            }

			int key = nextId++;
			tags[tag] = key;
			ids[key] = tag;
			return key;
		}
Example #11
0
		public PlaceObject(DefineTag ref_Renamed, int depth):base(Flash.Swf.TagValues.stagPlaceObject2)
		{
			this.depth = depth;
			Ref = ref_Renamed;
		}
Example #12
0
		public PlaceObject(Matrix m, DefineTag ref_Renamed, int depth, String name):base(Flash.Swf.TagValues.stagPlaceObject2)
		{
			this.depth = depth;
			Matrix = m;
			Ref = ref_Renamed;
			Name = name;
		}
		public static String idRef(DefineTag tag, Dictionary d)
		{
			if (tag == null)
			{
				// if tag is null then it isn't in the dict -- the SWF is invalid.
				// lets be lax and print something; Matador generates invalid SWF sometimes.
				return "-1";
			}
			else if (tag.name == null)
			{
				// just print the character id since no name was exported
				return System.Convert.ToString(d.getId(tag));
			}
			else
			{
				return tag.name;
			}
		}
		internal String idRef(DefineTag tag)
		{
			return idRef(tag, dict);
		}