Ejemplo n.º 1
0
        /**
         * Accessor for the height of this drawing
         *
         * @param h the number of rows spanned by this image
         */
        public virtual void setHeight(double h)
        {
            if (origin == Origin.READ)
                {
                if (!initialized)
                    {
                    initialize();
                    }
                origin = Origin.READ_WRITE;
                }

            height = h;
        }
Ejemplo n.º 2
0
 /**
  * Copy constructor used to copy drawings from read to write
  *
  * @param dgo the drawing group object
  * @param dg the drawing group
  * @param ws the workbook settings
  */
 public ComboBox(DrawingGroupObject dgo,
     DrawingGroup dg,
     WorkbookSettings ws)
 {
     ComboBox d = (ComboBox)dgo;
     Assert.verify(d.origin == Origin.READ);
     msoDrawingRecord = d.msoDrawingRecord;
     objRecord = d.objRecord;
     initialized = false;
     origin = Origin.READ;
     drawingData = d.drawingData;
     drawingGroup = dg;
     drawingNumber = d.drawingNumber;
     drawingGroup.addDrawing(this);
     workbookSettings = ws;
 }
Ejemplo n.º 3
0
 /**
  * Constructor invoked when writing images
  */
 public ComboBox()
 {
     initialized = true;
     origin = Origin.WRITE;
     referenceCount = 1;
     type = ShapeType.HOST_CONTROL;
 }
Ejemplo n.º 4
0
        /**
         * Called when the comment text is changed during the sheet copy process
         *
         * @param t the new text
         */
        public virtual void setCommentText(string t)
        {
            commentText = t;

            if (origin == Origin.READ)
                origin = Origin.READ_WRITE;
        }
Ejemplo n.º 5
0
        /**
         * Constructor used when reading images
         *
         * @param mso the drawing record
         * @param obj the object record
         * @param dd the drawing data for all drawings on this sheet
         * @param dg the drawing group
         * @param ws the workbook settings
         */
        public ComboBox(MsoDrawingRecord mso,ObjRecord obj,DrawingData dd,
            DrawingGroup dg,WorkbookSettings ws)
        {
            drawingGroup = dg;
            msoDrawingRecord = mso;
            drawingData = dd;
            objRecord = obj;
            initialized = false;
            workbookSettings = ws;
            origin = Origin.READ;
            drawingData.addData(msoDrawingRecord.getData());
            drawingNumber = drawingData.getNumDrawings() - 1;
            drawingGroup.addDrawing(this);

            Assert.verify(mso != null && obj != null);

            initialize();
        }
Ejemplo n.º 6
0
        /**
         * Sets the column position of this drawing.  Used when inserting/removing
         * columns from the spreadsheet
         *
         * @param x the column
         */
        public virtual void setX(double x)
        {
            if (origin == Origin.READ)
                {
                if (!initialized)
                    initialize();
                origin = Origin.READ_WRITE;
                }

            column = (int)x;
        }
Ejemplo n.º 7
0
 /**
  * Constructor invoked when writing the images
  *
  * @param x the column
  * @param y the row
  * @param w the width in cells
  * @param h the height in cells
  * @param image the image data
  */
 public Drawing(double x,
     double y,
     double w,
     double h,
     byte[] image)
 {
     imageData = image;
     initialized = true;
     origin = Origin.WRITE;
     this.x = x;
     this.y = y;
     this.width = w;
     this.height = h;
     referenceCount = 1;
     imageAnchorProperties = MOVE_WITH_CELLS;
     type = ShapeType.PICTURE_FRAME;
 }
Ejemplo n.º 8
0
        /**
         * Sets the column position of this drawing
         *
         * @param x the column
         */
        public void setX(double x)
        {
            if (origin == Origin.READ)
                {
                if (!initialized)
                    {
                    initialize();
                    }
                origin = Origin.READ_WRITE;
                }

            this.x = x;
        }
Ejemplo n.º 9
0
        /**
         * Accessor for the row of the drawing
         *
         * @param y the row
         */
        public void setY(double y)
        {
            if (origin == Origin.READ)
                {
                if (!initialized)
                    {
                    initialize();
                    }
                origin = Origin.READ_WRITE;
                }

            this.y = y;
        }
Ejemplo n.º 10
0
 /**
  * Constructor invoked when writing the images
  *
  * @param x the column
  * @param y the row
  * @param w the width in cells
  * @param h the height in cells
  * @param image the image data
  */
 public Drawing2(double x,
     double y,
     double w,
     double h,
     byte[] image)
 {
     imageData = image;
     initialized = true;
     origin = Origin.WRITE;
     this.x = x;
     this.y = y;
     this.width = w;
     this.height = h;
     referenceCount = 1;
     type = ShapeType.PICTURE_FRAME;
 }
Ejemplo n.º 11
0
 /**
  * Copy constructor used to copy drawings from read to write
  *
  * @param dgo the drawing group object
  * @param dg the drawing group
  */
 protected Drawing2(DrawingGroupObject dgo,DrawingGroup dg)
 {
     Drawing2 d = (Drawing2)dgo;
     Assert.verify(d.origin == Origin.READ);
     msoDrawingRecord = d.msoDrawingRecord;
     initialized = false;
     origin = Origin.READ;
     drawingData = d.drawingData;
     drawingGroup = dg;
     drawingNumber = d.drawingNumber;
     drawingGroup.addDrawing(this);
 }
Ejemplo n.º 12
0
        /**
         * Constructor used when reading images
         *
         * @param mso the drawing record
         * @param dd the drawing data for all drawings on this sheet
         * @param dg the drawing group
         */
        public Drawing2(MsoDrawingRecord mso,
            DrawingData dd,
            DrawingGroup dg)
        {
            drawingGroup = dg;
            msoDrawingRecord = mso;
            drawingData = dd;
            initialized = false;
            origin = Origin.READ;
            // there is no drawing number associated with this drawing
            drawingData.addRawData(msoDrawingRecord.getData());
            drawingGroup.addDrawing(this);

            Assert.verify(mso != null);

            initialize();
        }
Ejemplo n.º 13
0
 /**
  * Copy constructor used to copy drawings from read to write
  *
  * @param dgo the drawing group object
  * @param dg the drawing group
  * @param ws the workbook settings
  */
 public Button(DrawingGroupObject dgo,
     DrawingGroup dg,
     WorkbookSettings ws)
 {
     Button d = (Button)dgo;
     Assert.verify(d.origin == Origin.READ);
     msoDrawingRecord = d.msoDrawingRecord;
     objRecord = d.objRecord;
     initialized = false;
     origin = Origin.READ;
     drawingData = d.drawingData;
     drawingGroup = dg;
     drawingNumber = d.drawingNumber;
     drawingGroup.addDrawing(this);
     mso = d.mso;
     txo = d.txo;
     text = d.text;
     formatting = d.formatting;
     workbookSettings = ws;
 }
Ejemplo n.º 14
0
        /**
         * Accessor for the anchor properties
         */
        public virtual void setImageAnchor(ImageAnchorProperties iap)
        {
            imageAnchorProperties = iap;

            if (origin == Origin.READ)
                origin = Origin.READ_WRITE;
        }
Ejemplo n.º 15
0
        /**
         * Sets the object id.  Invoked by the drawing group when the object is
         * added to id
         *
         * @param objid the object id
         * @param bip the blip id
         * @param sid the shape id
         */
        public void setObjectId(uint objid,int bip,int sid)
        {
            objectId = objid;
            blipId = bip;
            shapeId = sid;

            if (origin == Origin.READ)
                origin = Origin.READ_WRITE;
        }
Ejemplo n.º 16
0
 /**
  * Copy constructor used to copy drawings from read to write
  *
  * @param dgo the drawing group object
  * @param dg the drawing group
  * @param ws the workbook settings
  */
 /*protected*/
 public Comment(DrawingGroupObject dgo,
     DrawingGroup dg,
     WorkbookSettings ws)
 {
     Comment d = (Comment)dgo;
     Assert.verify(d.origin == Origin.READ);
     msoDrawingRecord = d.msoDrawingRecord;
     objRecord = d.objRecord;
     initialized = false;
     origin = Origin.READ;
     drawingData = d.drawingData;
     drawingGroup = dg;
     drawingNumber = d.drawingNumber;
     drawingGroup.addDrawing(this);
     mso = d.mso;
     txo = d.txo;
     text = d.text;
     formatting = d.formatting;
     note = d.note;
     width = d.width;
     height = d.height;
     workbookSettings = ws;
 }
Ejemplo n.º 17
0
        /**
         * Accessor for the width
         *
         * @param w the number of columns to span
         */
        public virtual void setWidth(double w)
        {
            if (origin == Origin.READ)
                {
                if (!initialized)
                    {
                    initialize();
                    }
                origin = Origin.READ_WRITE;
                }

            width = w;
        }
Ejemplo n.º 18
0
 /**
  * Constructor invoked when writing the images
  *
  * @param txt the comment text
  * @param c the column
  * @param r the row
  */
 public Comment(string txt,int c,int r)
 {
     initialized = true;
     origin = Origin.WRITE;
     column = c;
     row = r;
     referenceCount = 1;
     type = ShapeType.TEXT_BOX;
     commentText = txt;
     width = 3;
     height = 4;
 }
Ejemplo n.º 19
0
        /**
         * Accessor for the row of the drawing
         *
         * @param y the row
         */
        public virtual void setY(double y)
        {
            if (origin == Origin.READ)
                {
                if (!initialized)
                    initialize();
                origin = Origin.READ_WRITE;
                }

            row = (int)y;
        }
Ejemplo n.º 20
0
        /**
         * Constructor used when reading images
         *
         * @param mso the drawing record
         * @param obj the object record
         * @param dd the drawing data for all drawings on this sheet
         * @param dg the drawing group
         */
        public Drawing(MsoDrawingRecord mso,
            ObjRecord obj,
            DrawingData dd,
            DrawingGroup dg,
            Sheet s)
        {
            drawingGroup = dg;
            msoDrawingRecord = mso;
            drawingData = dd;
            objRecord = obj;
            sheet = s;
            initialized = false;
            origin = Origin.READ;
            drawingData.addData(msoDrawingRecord.getData());
            drawingNumber = drawingData.getNumDrawings() - 1;
            drawingGroup.addDrawing(this);

            Assert.verify(mso != null && obj != null);

            initialize();
        }