/**
  * Adds a child to this container
  *
  * @param child the item to add
  */
 public void add(EscherRecord child)
 {
     children.Add(child);
 }
Example #2
0
        /**
         * Displays an escher record
         *
         * @param er the record to display
         * @param level the amount of indentation
         * @exception IOException
         */
        private void displayRecord(EscherRecord er, int level)
        {
            indent(level);

            EscherRecordType type = er.getType();

            // Display the code
            writer.Write(System.String.Format("{0:X}", type.getValue()));
            writer.Write(" - ");

            // Display the name
            if (type == EscherRecordType.DGG_CONTAINER)
            {
                writer.WriteLine("Dgg Container");
            }
            else if (type == EscherRecordType.BSTORE_CONTAINER)
            {
                writer.WriteLine("BStore Container");
            }
            else if (type == EscherRecordType.DG_CONTAINER)
            {
                writer.WriteLine("Dg Container");
            }
            else if (type == EscherRecordType.SPGR_CONTAINER)
            {
                writer.WriteLine("Spgr Container");
            }
            else if (type == EscherRecordType.SP_CONTAINER)
            {
                writer.WriteLine("Sp Container");
            }
            else if (type == EscherRecordType.DGG)
            {
                writer.WriteLine("Dgg");
            }
            else if (type == EscherRecordType.BSE)
            {
                writer.WriteLine("Bse");
            }
            else if (type == EscherRecordType.DG)
            {
                Dg dg = new Dg(er.getEscherData());
                writer.WriteLine("Dg:  drawing id " + dg.getDrawingId() + " shape count " + dg.getShapeCount());
            }
            else if (type == EscherRecordType.SPGR)
            {
                writer.WriteLine("Spgr");
            }
            else if (type == EscherRecordType.SP)
            {
                Sp sp = new Sp(er.getEscherData());
                writer.WriteLine("Sp:  shape id " + sp.getShapeId() + " shape type " + sp.getShapeType());
            }
            else if (type == EscherRecordType.OPT)
            {
                Opt          opt  = new Opt(er.getEscherData());
                Opt.Property p260 = opt.getProperty(260);
                Opt.Property p261 = opt.getProperty(261);
                writer.Write("Opt (value, StringValue): ");
                if (p260 != null)
                {
                    writer.Write("260: " +
                                 p260.value + ", " +
                                 p260.StringValue +
                                 ";");
                }
                if (p261 != null)
                {
                    writer.Write("261: " +
                                 p261.value + ", " +
                                 p261.StringValue +
                                 ";");
                }
                writer.WriteLine(string.Empty);
            }
            else if (type == EscherRecordType.CLIENT_ANCHOR)
            {
                writer.WriteLine("Client Anchor");
            }
            else if (type == EscherRecordType.CLIENT_DATA)
            {
                writer.WriteLine("Client Data");
            }
            else if (type == EscherRecordType.CLIENT_TEXT_BOX)
            {
                writer.WriteLine("Client Text Box");
            }
            else if (type == EscherRecordType.SPLIT_MENU_COLORS)
            {
                writer.WriteLine("Split Menu Colors");
            }
            else
            {
                writer.WriteLine("???");
            }
        }
 /**
  * Removes a child from this container
  *
  * @param child the item to remove
  */
 public void remove(EscherRecord child)
 {
     children.Remove(child);
 }
        /**
         * Accessor for the children of this container
         *
         * @return the children
         */
        public EscherRecord[] getChildren()
        {
            if (!initialized)
                initialize();

            EscherRecord[] ca = new EscherRecord[children.Count];
            int pos = 0;
            foreach (EscherRecord record in children)
                ca[pos++] = record;
            return ca;
        }
Example #5
0
        /**
         * Initialization
         */
        private void initialize()
        {
            int curpos = getPos() + HEADER_LENGTH;
            int endpos = System.Math.Min(getPos() + getLength(), getStreamLength());

            EscherRecord newRecord = null;

            while (curpos < endpos)
            {
                EscherRecordData erd = new EscherRecordData(getEscherStream(), curpos);

                EscherRecordType type = erd.getType();
                if (type == EscherRecordType.DGG)
                {
                    newRecord = new Dgg(erd);
                }
                else if (type == EscherRecordType.DG)
                {
                    newRecord = new Dg(erd);
                }
                else if (type == EscherRecordType.BSTORE_CONTAINER)
                {
                    newRecord = new BStoreContainer(erd);
                }
                else if (type == EscherRecordType.SPGR_CONTAINER)
                {
                    newRecord = new SpgrContainer(erd);
                }
                else if (type == EscherRecordType.SP_CONTAINER)
                {
                    newRecord = new SpContainer(erd);
                }
                else if (type == EscherRecordType.SPGR)
                {
                    newRecord = new Spgr(erd);
                }
                else if (type == EscherRecordType.SP)
                {
                    newRecord = new Sp(erd);
                }
                else if (type == EscherRecordType.CLIENT_ANCHOR)
                {
                    newRecord = new ClientAnchor(erd);
                }
                else if (type == EscherRecordType.CLIENT_DATA)
                {
                    newRecord = new ClientData(erd);
                }
                else if (type == EscherRecordType.BSE)
                {
                    newRecord = new BlipStoreEntry(erd);
                }
                else if (type == EscherRecordType.OPT)
                {
                    newRecord = new Opt(erd);
                }
                else if (type == EscherRecordType.SPLIT_MENU_COLORS)
                {
                    newRecord = new SplitMenuColors(erd);
                }
                else if (type == EscherRecordType.CLIENT_TEXT_BOX)
                {
                    newRecord = new ClientTextBox(erd);
                }
                else
                {
                    newRecord = new EscherAtom(erd);
                }

                children.Add(newRecord);
                curpos += newRecord.getLength();
            }

            initialized = true;
        }
Example #6
0
 /**
  * Removes a child from this container
  *
  * @param child the item to remove
  */
 public void remove(EscherRecord child)
 {
     children.Remove(child);
 }
Example #7
0
 /**
  * Adds a child to this container
  *
  * @param child the item to add
  */
 public void add(EscherRecord child)
 {
     children.Add(child);
 }