aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2016-07-03 21:54:17 +0000
committerAndreas Beeker <kiwiwings@apache.org>2016-07-03 21:54:17 +0000
commit3e888b1a0cfb9c3562264816eb2f76c8d30fc23b (patch)
tree28b5d539c7e0034007907a0f7c868263409efa6a /src/java/org
parentec2bb82dbbe444e0995a3ea6bf31121f90116bd4 (diff)
downloadpoi-3e888b1a0cfb9c3562264816eb2f76c8d30fc23b.tar.gz
poi-3e888b1a0cfb9c3562264816eb2f76c8d30fc23b.zip
#59170 - Remove deprecated classes (POI 3.15) - o.a.p.hssf.model.*Shape classes removed
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1751174 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/poi/hssf/model/AbstractShape.java176
-rw-r--r--src/java/org/apache/poi/hssf/model/ComboboxShape.java117
-rw-r--r--src/java/org/apache/poi/hssf/model/CommentShape.java147
-rw-r--r--src/java/org/apache/poi/hssf/model/LineShape.java121
-rw-r--r--src/java/org/apache/poi/hssf/model/PictureShape.java127
-rw-r--r--src/java/org/apache/poi/hssf/model/PolygonShape.java159
-rw-r--r--src/java/org/apache/poi/hssf/model/SimpleFilledShape.java128
-rw-r--r--src/java/org/apache/poi/hssf/model/TextboxShape.java168
-rw-r--r--src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java4
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFShape.java7
10 files changed, 8 insertions, 1146 deletions
diff --git a/src/java/org/apache/poi/hssf/model/AbstractShape.java b/src/java/org/apache/poi/hssf/model/AbstractShape.java
deleted file mode 100644
index 1bfbc26d93..0000000000
--- a/src/java/org/apache/poi/hssf/model/AbstractShape.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.hssf.model;
-
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.record.ObjRecord;
-import org.apache.poi.hssf.usermodel.*;
-
-/**
- * An abstract shape is the lowlevel model for a shape.
- */
-@Deprecated
-public abstract class AbstractShape
-{
- /**
- * Create a new shape object used to create the escher records.
- *
- * @param hssfShape The simple shape this is based on.
- */
- public static AbstractShape createShape( HSSFShape hssfShape, int shapeId )
- {
- AbstractShape shape;
- if (hssfShape instanceof HSSFComment)
- {
- shape = new CommentShape( (HSSFComment)hssfShape, shapeId );
- }
- else if (hssfShape instanceof HSSFTextbox)
- {
- shape = new TextboxShape( (HSSFTextbox)hssfShape, shapeId );
- }
- else if (hssfShape instanceof HSSFPolygon)
- {
- shape = new PolygonShape( (HSSFPolygon) hssfShape, shapeId );
- }
- else if (hssfShape instanceof HSSFSimpleShape)
- {
- HSSFSimpleShape simpleShape = (HSSFSimpleShape) hssfShape;
- switch ( simpleShape.getShapeType() )
- {
- case HSSFSimpleShape.OBJECT_TYPE_PICTURE:
- shape = new PictureShape( simpleShape, shapeId );
- break;
- case HSSFSimpleShape.OBJECT_TYPE_LINE:
- shape = new LineShape( simpleShape, shapeId );
- break;
- case HSSFSimpleShape.OBJECT_TYPE_OVAL:
- case HSSFSimpleShape.OBJECT_TYPE_RECTANGLE:
- shape = new SimpleFilledShape( simpleShape, shapeId );
- break;
- case HSSFSimpleShape.OBJECT_TYPE_COMBO_BOX:
- shape = new ComboboxShape( simpleShape, shapeId );
- break;
- default:
- throw new IllegalArgumentException("Do not know how to handle this type of shape");
- }
- }
- else
- {
- throw new IllegalArgumentException("Unknown shape type");
- }
- EscherSpRecord sp = shape.getSpContainer().getChildById(EscherSpRecord.RECORD_ID);
- if (hssfShape.getParent() != null)
- sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_CHILD);
- return shape;
- }
-
- protected AbstractShape()
- {
- }
-
- /**
- * @return The shape container and it's children that can represent this
- * shape.
- */
- public abstract EscherContainerRecord getSpContainer();
-
- /**
- * @return The object record that is associated with this shape.
- */
- public abstract ObjRecord getObjRecord();
-
- /**
- * Creates an escher anchor record from a HSSFAnchor.
- *
- * @param userAnchor The high level anchor to convert.
- * @return An escher anchor record.
- */
- protected EscherRecord createAnchor( HSSFAnchor userAnchor )
- {
- return ConvertAnchor.createAnchor(userAnchor);
- }
-
- /**
- * Add standard properties to the opt record. These properties effect
- * all records.
- *
- * @param shape The user model shape.
- * @param opt The opt record to add the properties to.
- * @return The number of options added.
- */
- protected int addStandardOptions( HSSFShape shape, EscherOptRecord opt )
- {
- opt.addEscherProperty( new EscherBoolProperty( EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x080000 ) );
-// opt.addEscherProperty( new EscherBoolProperty( EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x080008 ) );
- if ( shape.isNoFill() )
- {
- // Wonderful... none of the spec's give any clue as to what these constants mean.
- opt.addEscherProperty( new EscherBoolProperty( EscherProperties.FILL__NOFILLHITTEST, 0x00110000 ) );
- }
- else
- {
- opt.addEscherProperty( new EscherBoolProperty( EscherProperties.FILL__NOFILLHITTEST, 0x00010000 ) );
- }
- opt.addEscherProperty( new EscherRGBProperty( EscherProperties.FILL__FILLCOLOR, shape.getFillColor() ) );
- opt.addEscherProperty( new EscherBoolProperty( EscherProperties.GROUPSHAPE__PRINT, 0x080000 ) );
- opt.addEscherProperty( new EscherRGBProperty( EscherProperties.LINESTYLE__COLOR, shape.getLineStyleColor() ) );
- int options = 5;
- if (shape.getLineWidth() != HSSFShape.LINEWIDTH_DEFAULT)
- {
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.LINESTYLE__LINEWIDTH, shape.getLineWidth()));
- options++;
- }
- if (shape.getLineStyle() != HSSFShape.LINESTYLE_SOLID)
- {
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.LINESTYLE__LINEDASHING, shape.getLineStyle()));
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.LINESTYLE__LINEENDCAPSTYLE, 0));
- if (shape.getLineStyle() == HSSFShape.LINESTYLE_NONE)
- opt.addEscherProperty( new EscherBoolProperty( EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080000));
- else
- opt.addEscherProperty( new EscherBoolProperty( EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
- options += 3;
- }
- opt.sortProperties();
- return options; // # options added
- }
-
- /**
- * Generate id for the CommonObjectDataSubRecord that stands behind this shape
- *
- * <p>
- * Typically objectId starts with 1, is unique among all Obj record within the worksheet stream
- * and increments by 1 for every new shape.
- * For most shapes there is a straight relationship between shapeId (generated by DDF) and objectId:
- * </p>
- * <p>
- * shapeId is unique and starts with 1024, hence objectId can be derived as <code>shapeId-1024</code>.
- * </p>
- * <p>
- * An exception from this rule is the CellComment shape whose objectId start with 1024.
- * See {@link CommentShape#getCmoObjectId(int)}
- * </p>
- *
- *
- *
- * @param shapeId shape id as generated by drawing manager
- * @return objectId object id that will be assigned to the Obj record
- */
- int getCmoObjectId(int shapeId){
- return shapeId - 1024;
- }
-}
diff --git a/src/java/org/apache/poi/hssf/model/ComboboxShape.java b/src/java/org/apache/poi/hssf/model/ComboboxShape.java
deleted file mode 100644
index 2bfd9ef914..0000000000
--- a/src/java/org/apache/poi/hssf/model/ComboboxShape.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-
-package org.apache.poi.hssf.model;
-
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.record.*;
-import org.apache.poi.hssf.usermodel.*;
-import org.apache.poi.ss.usermodel.ClientAnchor.AnchorType;
-
-/**
- * Represents a combobox shape.
- */
-@Deprecated
-public class ComboboxShape
- extends AbstractShape {
- private EscherContainerRecord spContainer;
- private ObjRecord objRecord;
-
- /**
- * Creates the low evel records for a combobox.
- *
- * @param hssfShape The highlevel shape.
- * @param shapeId The shape id to use for this shape.
- */
- ComboboxShape(HSSFSimpleShape hssfShape, int shapeId) {
- spContainer = createSpContainer(hssfShape, shapeId);
- objRecord = createObjRecord(hssfShape, shapeId);
- }
-
- /**
- * Creates the low level OBJ record for this shape.
- */
- private ObjRecord createObjRecord(HSSFSimpleShape shape, int shapeId) {
- ObjRecord obj = new ObjRecord();
- CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
- c.setObjectType(HSSFSimpleShape.OBJECT_TYPE_COMBO_BOX);
- c.setObjectId( getCmoObjectId(shapeId) );
- c.setLocked(true);
- c.setPrintable(false);
- c.setAutofill(true);
- c.setAutoline(false);
-
- FtCblsSubRecord f = new FtCblsSubRecord();
-
- LbsDataSubRecord l = LbsDataSubRecord.newAutoFilterInstance();
-
- EndSubRecord e = new EndSubRecord();
-
- obj.addSubRecord(c);
- obj.addSubRecord(f);
- obj.addSubRecord(l);
- obj.addSubRecord(e);
-
- return obj;
- }
-
- /**
- * Generates the escher shape records for this shape.
- */
- private EscherContainerRecord createSpContainer(HSSFSimpleShape shape, int shapeId) {
- EscherContainerRecord spContainer = new EscherContainerRecord();
- EscherSpRecord sp = new EscherSpRecord();
- EscherOptRecord opt = new EscherOptRecord();
- EscherClientDataRecord clientData = new EscherClientDataRecord();
-
- spContainer.setRecordId(EscherContainerRecord.SP_CONTAINER);
- spContainer.setOptions((short) 0x000F);
- sp.setRecordId(EscherSpRecord.RECORD_ID);
- sp.setOptions((short) ((EscherAggregate.ST_HOSTCONTROL << 4) | 0x2));
-
- sp.setShapeId(shapeId);
- sp.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE);
- opt.setRecordId(EscherOptRecord.RECORD_ID);
- opt.addEscherProperty(new EscherBoolProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 17039620));
- opt.addEscherProperty(new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x00080008));
- opt.addEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080000));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, 0x00020000));
-
- HSSFClientAnchor userAnchor = (HSSFClientAnchor) shape.getAnchor();
- userAnchor.setAnchorType(AnchorType.DONT_MOVE_DO_RESIZE);
- EscherRecord anchor = createAnchor(userAnchor);
- clientData.setRecordId(EscherClientDataRecord.RECORD_ID);
- clientData.setOptions((short) 0x0000);
-
- spContainer.addChildRecord(sp);
- spContainer.addChildRecord(opt);
- spContainer.addChildRecord(anchor);
- spContainer.addChildRecord(clientData);
-
- return spContainer;
- }
-
- public EscherContainerRecord getSpContainer() {
- return spContainer;
- }
-
- public ObjRecord getObjRecord() {
- return objRecord;
- }
-
-}
diff --git a/src/java/org/apache/poi/hssf/model/CommentShape.java b/src/java/org/apache/poi/hssf/model/CommentShape.java
deleted file mode 100644
index ba1fad9770..0000000000
--- a/src/java/org/apache/poi/hssf/model/CommentShape.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.hssf.model;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.poi.ddf.EscherOptRecord;
-import org.apache.poi.ddf.EscherProperties;
-import org.apache.poi.ddf.EscherProperty;
-import org.apache.poi.ddf.EscherSimpleProperty;
-import org.apache.poi.hssf.record.CommonObjectDataSubRecord;
-import org.apache.poi.hssf.record.NoteRecord;
-import org.apache.poi.hssf.record.NoteStructureSubRecord;
-import org.apache.poi.hssf.record.ObjRecord;
-import org.apache.poi.hssf.record.SubRecord;
-import org.apache.poi.hssf.usermodel.HSSFComment;
-import org.apache.poi.hssf.usermodel.HSSFShape;
-
-/**
- * Represents a cell comment.
- * This class converts highlevel model data from <code>HSSFComment</code>
- * to low-level records.
- */
-@Deprecated
-public final class CommentShape extends TextboxShape {
-
- private NoteRecord _note;
-
- /**
- * Creates the low-level records for a comment.
- *
- * @param hssfShape The highlevel shape.
- * @param shapeId The shape id to use for this shape.
- */
- public CommentShape( HSSFComment hssfShape, int shapeId )
- {
- super(hssfShape, shapeId);
-
- _note = createNoteRecord(hssfShape, shapeId);
-
- ObjRecord obj = getObjRecord();
- List<SubRecord> records = obj.getSubRecords();
- int cmoIdx = 0;
- for (int i = 0; i < records.size(); i++) {
- Object r = records.get(i);
-
- if (r instanceof CommonObjectDataSubRecord){
- //modify autofill attribute inherited from <code>TextObjectRecord</code>
- CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord)r;
- cmo.setAutofill(false);
- cmoIdx = i;
- }
- }
- //add NoteStructure sub record
- //we don't know it's format, for now the record data is empty
- NoteStructureSubRecord u = new NoteStructureSubRecord();
- obj.addSubRecord(cmoIdx+1, u);
- }
-
- /**
- * Creates the low level <code>NoteRecord</code>
- * which holds the comment attributes.
- */
- private NoteRecord createNoteRecord( HSSFComment shape, int shapeId )
- {
- NoteRecord note = new NoteRecord();
- note.setColumn(shape.getColumn());
- note.setRow(shape.getRow());
- note.setFlags(shape.isVisible() ? NoteRecord.NOTE_VISIBLE : NoteRecord.NOTE_HIDDEN);
- note.setShapeId(shapeId);
- note.setAuthor(shape.getAuthor() == null ? "" : shape.getAuthor());
- return note;
- }
-
- /**
- * Sets standard escher options for a comment.
- * This method is responsible for setting default background,
- * shading and other comment properties.
- *
- * @param shape The highlevel shape.
- * @param opt The escher records holding the proerties
- * @return number of escher options added
- */
- @Override
- protected int addStandardOptions( HSSFShape shape, EscherOptRecord opt )
- {
- super.addStandardOptions(shape, opt);
-
- //remove unnecessary properties inherited from TextboxShape
- List<EscherProperty> props = opt.getEscherProperties();
- for (Iterator<EscherProperty> iterator = props.iterator(); iterator.hasNext(); ) {
- EscherProperty prop = iterator.next();
- switch (prop.getId()){
- case EscherProperties.TEXT__TEXTLEFT:
- case EscherProperties.TEXT__TEXTRIGHT:
- case EscherProperties.TEXT__TEXTTOP:
- case EscherProperties.TEXT__TEXTBOTTOM:
- case EscherProperties.GROUPSHAPE__PRINT:
- case EscherProperties.FILL__FILLBACKCOLOR:
- case EscherProperties.LINESTYLE__COLOR:
- iterator.remove();
- break;
- default:
- break;
- }
- }
-
- HSSFComment comment = (HSSFComment)shape;
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.GROUPSHAPE__PRINT, comment.isVisible() ? 0x000A0000 : 0x000A0002) );
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.SHADOWSTYLE__SHADOWOBSURED, 0x00030003 ) );
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.SHADOWSTYLE__COLOR, 0x00000000 ) );
- opt.sortProperties();
- return opt.getEscherProperties().size(); // # options added
- }
-
- /**
- * Return the <code>NoteRecord</code> holding the comment attributes
- *
- * @return <code>NoteRecord</code> holding the comment attributes
- */
- public NoteRecord getNoteRecord()
- {
- return _note;
- }
-
- @Override
- int getCmoObjectId(int shapeId){
- return shapeId;
- }
-
-}
diff --git a/src/java/org/apache/poi/hssf/model/LineShape.java b/src/java/org/apache/poi/hssf/model/LineShape.java
deleted file mode 100644
index d9f6e6371d..0000000000
--- a/src/java/org/apache/poi/hssf/model/LineShape.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-
-package org.apache.poi.hssf.model;
-
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.record.*;
-import org.apache.poi.hssf.usermodel.*;
-
-/**
- * Represents a line shape and creates all the line specific low level records.
- */
-@Deprecated
-public class LineShape
- extends AbstractShape
-{
- private EscherContainerRecord spContainer;
- private ObjRecord objRecord;
-
- /**
- * Creates the line shape from the highlevel user shape. All low level
- * records are created at this point.
- *
- * @param hssfShape The user model shape.
- * @param shapeId The identifier to use for this shape.
- */
- LineShape( HSSFSimpleShape hssfShape, int shapeId )
- {
- spContainer = createSpContainer(hssfShape, shapeId);
- objRecord = createObjRecord(hssfShape, shapeId);
- }
-
- /**
- * Creates the lowerlevel escher records for this shape.
- */
- private EscherContainerRecord createSpContainer(HSSFSimpleShape hssfShape, int shapeId)
- {
- HSSFShape shape = hssfShape;
-
- EscherContainerRecord spContainer = new EscherContainerRecord();
- EscherSpRecord sp = new EscherSpRecord();
- EscherOptRecord opt = new EscherOptRecord();
- EscherClientDataRecord clientData = new EscherClientDataRecord();
-
- spContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
- spContainer.setOptions( (short) 0x000F );
- sp.setRecordId( EscherSpRecord.RECORD_ID );
- sp.setOptions( (short) ( (EscherAggregate.ST_LINE << 4) | 0x2 ) );
-
- sp.setShapeId( shapeId );
- sp.setFlags( EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE );
- opt.setRecordId( EscherOptRecord.RECORD_ID );
- opt.addEscherProperty( new EscherShapePathProperty( EscherProperties.GEOMETRY__SHAPEPATH, EscherShapePathProperty.COMPLEX ) );
- opt.addEscherProperty( new EscherBoolProperty( EscherProperties.LINESTYLE__NOLINEDRAWDASH, 1048592 ) );
- addStandardOptions(shape, opt);
- HSSFAnchor userAnchor = shape.getAnchor();
- if (userAnchor.isHorizontallyFlipped())
- sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPHORIZ);
- if (userAnchor.isVerticallyFlipped())
- sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPVERT);
- EscherRecord anchor = createAnchor(userAnchor);
- clientData.setRecordId( EscherClientDataRecord.RECORD_ID );
- clientData.setOptions( (short) 0x0000 );
-
- spContainer.addChildRecord(sp);
- spContainer.addChildRecord(opt);
- spContainer.addChildRecord(anchor);
- spContainer.addChildRecord(clientData);
-
- return spContainer;
- }
-
- /**
- * Creates the low level OBJ record for this shape.
- */
- private ObjRecord createObjRecord(HSSFShape hssfShape, int shapeId)
- {
- HSSFShape shape = hssfShape;
-
- ObjRecord obj = new ObjRecord();
- CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
- c.setObjectType((short) ((HSSFSimpleShape)shape).getShapeType());
- c.setObjectId( getCmoObjectId(shapeId) );
- c.setLocked(true);
- c.setPrintable(true);
- c.setAutofill(true);
- c.setAutoline(true);
- EndSubRecord e = new EndSubRecord();
-
- obj.addSubRecord(c);
- obj.addSubRecord(e);
-
- return obj;
- }
-
- public EscherContainerRecord getSpContainer()
- {
- return spContainer;
- }
-
- public ObjRecord getObjRecord()
- {
- return objRecord;
- }
-
-}
diff --git a/src/java/org/apache/poi/hssf/model/PictureShape.java b/src/java/org/apache/poi/hssf/model/PictureShape.java
deleted file mode 100644
index af8e769318..0000000000
--- a/src/java/org/apache/poi/hssf/model/PictureShape.java
+++ /dev/null
@@ -1,127 +0,0 @@
-
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.hssf.model;
-
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.record.*;
-import org.apache.poi.hssf.usermodel.*;
-
-/**
- * Represents a picture shape and creates all specific low level records.
- * @deprecated 3.15 beta 2. Use {@link HSSFPicture} instead.
- * This should have been deprecated in r1364547 (POI 3.9) with the other AbstractShape deprecations.
- */
-@Deprecated
-public class PictureShape
- extends AbstractShape
-{
- private EscherContainerRecord spContainer;
- private ObjRecord objRecord;
-
- /**
- * Creates the line shape from the highlevel user shape. All low level
- * records are created at this point.
- *
- * @param hssfShape The user model shape.
- * @param shapeId The identifier to use for this shape.
- */
- PictureShape( HSSFSimpleShape hssfShape, int shapeId )
- {
- spContainer = createSpContainer(hssfShape, shapeId);
- objRecord = createObjRecord(hssfShape, shapeId);
- }
-
- /**
- * Creates the lowerlevel escher records for this shape.
- */
- private EscherContainerRecord createSpContainer(HSSFSimpleShape hssfShape, int shapeId)
- {
- HSSFPicture shape = (HSSFPicture) hssfShape;
-
- EscherContainerRecord spContainer = new EscherContainerRecord();
- EscherSpRecord sp = new EscherSpRecord();
- EscherOptRecord opt = new EscherOptRecord();
- EscherRecord anchor;
- EscherClientDataRecord clientData = new EscherClientDataRecord();
-
- spContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
- spContainer.setOptions( (short) 0x000F );
- sp.setRecordId( EscherSpRecord.RECORD_ID );
- sp.setOptions( (short) ( (EscherAggregate.ST_PICTUREFRAME << 4) | 0x2 ) );
-
- sp.setShapeId( shapeId );
- sp.setFlags( EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE );
- opt.setRecordId( EscherOptRecord.RECORD_ID );
-// opt.addEscherProperty( new EscherBoolProperty( EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x00800080 ) );
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.BLIP__BLIPTODISPLAY, false, true, shape.getPictureIndex() ) );
-// opt.addEscherProperty( new EscherComplexProperty( EscherProperties.BLIP__BLIPFILENAME, true, new byte[] { (byte)0x74, (byte)0x00, (byte)0x65, (byte)0x00, (byte)0x73, (byte)0x00, (byte)0x74, (byte)0x00, (byte)0x00, (byte)0x00 } ) );
-// opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.FILL__FILLTYPE, 0x00000003 ) );
- addStandardOptions(shape, opt);
- HSSFAnchor userAnchor = shape.getAnchor();
- if (userAnchor.isHorizontallyFlipped())
- sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPHORIZ);
- if (userAnchor.isVerticallyFlipped())
- sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPVERT);
- anchor = createAnchor(userAnchor);
- clientData.setRecordId( EscherClientDataRecord.RECORD_ID );
- clientData.setOptions( (short) 0x0000 );
-
- spContainer.addChildRecord(sp);
- spContainer.addChildRecord(opt);
- spContainer.addChildRecord(anchor);
- spContainer.addChildRecord(clientData);
-
- return spContainer;
- }
-
- /**
- * Creates the low level OBJ record for this shape.
- */
- private ObjRecord createObjRecord(HSSFShape hssfShape, int shapeId)
- {
- HSSFShape shape = hssfShape;
-
- ObjRecord obj = new ObjRecord();
- CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
- c.setObjectType((short) ((HSSFSimpleShape)shape).getShapeType());
- c.setObjectId( getCmoObjectId(shapeId) );
- c.setLocked(true);
- c.setPrintable(true);
- c.setAutofill(true);
- c.setAutoline(true);
- c.setReserved2( 0x0 );
- EndSubRecord e = new EndSubRecord();
-
- obj.addSubRecord(c);
- obj.addSubRecord(e);
-
- return obj;
- }
-
- public EscherContainerRecord getSpContainer()
- {
- return spContainer;
- }
-
- public ObjRecord getObjRecord()
- {
- return objRecord;
- }
-
-}
diff --git a/src/java/org/apache/poi/hssf/model/PolygonShape.java b/src/java/org/apache/poi/hssf/model/PolygonShape.java
deleted file mode 100644
index 2d7b724a34..0000000000
--- a/src/java/org/apache/poi/hssf/model/PolygonShape.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-
-package org.apache.poi.hssf.model;
-
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.record.ObjRecord;
-import org.apache.poi.hssf.record.EscherAggregate;
-import org.apache.poi.hssf.record.CommonObjectDataSubRecord;
-import org.apache.poi.hssf.record.EndSubRecord;
-import org.apache.poi.hssf.usermodel.HSSFShape;
-import org.apache.poi.hssf.usermodel.HSSFPolygon;
-import org.apache.poi.util.LittleEndian;
-
-@Deprecated
-public class PolygonShape
- extends AbstractShape
-{
- public final static short OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING = 30;
-
- private EscherContainerRecord spContainer;
- private ObjRecord objRecord;
-
- /**
- * Creates the low evel records for an polygon.
- *
- * @param hssfShape The highlevel shape.
- * @param shapeId The shape id to use for this shape.
- */
- PolygonShape( HSSFPolygon hssfShape, int shapeId )
- {
- spContainer = createSpContainer( hssfShape, shapeId );
- objRecord = createObjRecord( hssfShape, shapeId );
- }
-
- /**
- * Generates the shape records for this shape.
- *
- */
- private EscherContainerRecord createSpContainer( HSSFPolygon hssfShape, int shapeId )
- {
- HSSFShape shape = hssfShape;
-
- EscherContainerRecord spContainer = new EscherContainerRecord();
- EscherSpRecord sp = new EscherSpRecord();
- EscherOptRecord opt = new EscherOptRecord();
- EscherClientDataRecord clientData = new EscherClientDataRecord();
-
- spContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
- spContainer.setOptions( (short) 0x000F );
- sp.setRecordId( EscherSpRecord.RECORD_ID );
- sp.setOptions( (short) ( ( EscherAggregate.ST_NOT_PRIMATIVE << 4 ) | 0x2 ) );
- sp.setShapeId( shapeId );
- if (hssfShape.getParent() == null)
- sp.setFlags( EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE );
- else
- sp.setFlags( EscherSpRecord.FLAG_CHILD | EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE );
- opt.setRecordId( EscherOptRecord.RECORD_ID );
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.TRANSFORM__ROTATION, false, false, 0));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__RIGHT, false, false, hssfShape.getDrawAreaWidth()));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__BOTTOM, false, false, hssfShape.getDrawAreaHeight()));
- opt.addEscherProperty(new EscherShapePathProperty(EscherProperties.GEOMETRY__SHAPEPATH, EscherShapePathProperty.COMPLEX));
- EscherArrayProperty verticesProp = new EscherArrayProperty(EscherProperties.GEOMETRY__VERTICES, false, new byte[0] );
- verticesProp.setNumberOfElementsInArray(hssfShape.getXPoints().length+1);
- verticesProp.setNumberOfElementsInMemory(hssfShape.getXPoints().length+1);
- verticesProp.setSizeOfElements(0xFFF0);
- for (int i = 0; i < hssfShape.getXPoints().length; i++)
- {
- byte[] data = new byte[4];
- LittleEndian.putShort(data, 0, (short)hssfShape.getXPoints()[i]);
- LittleEndian.putShort(data, 2, (short)hssfShape.getYPoints()[i]);
- verticesProp.setElement(i, data);
- }
- int point = hssfShape.getXPoints().length;
- byte[] data = new byte[4];
- LittleEndian.putShort(data, 0, (short)hssfShape.getXPoints()[0]);
- LittleEndian.putShort(data, 2, (short)hssfShape.getYPoints()[0]);
- verticesProp.setElement(point, data);
- opt.addEscherProperty(verticesProp);
- EscherArrayProperty segmentsProp = new EscherArrayProperty(EscherProperties.GEOMETRY__SEGMENTINFO, false, null );
- segmentsProp.setSizeOfElements(0x0002);
- segmentsProp.setNumberOfElementsInArray(hssfShape.getXPoints().length * 2 + 4);
- segmentsProp.setNumberOfElementsInMemory(hssfShape.getXPoints().length * 2 + 4);
- segmentsProp.setElement(0, new byte[] { (byte)0x00, (byte)0x40 } );
- segmentsProp.setElement(1, new byte[] { (byte)0x00, (byte)0xAC } );
- for (int i = 0; i < hssfShape.getXPoints().length; i++)
- {
- segmentsProp.setElement(2 + i * 2, new byte[] { (byte)0x01, (byte)0x00 } );
- segmentsProp.setElement(3 + i * 2, new byte[] { (byte)0x00, (byte)0xAC } );
- }
- segmentsProp.setElement(segmentsProp.getNumberOfElementsInArray() - 2, new byte[] { (byte)0x01, (byte)0x60 } );
- segmentsProp.setElement(segmentsProp.getNumberOfElementsInArray() - 1, new byte[] { (byte)0x00, (byte)0x80 } );
- opt.addEscherProperty(segmentsProp);
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__FILLOK, false, false, 0x00010001));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINESTARTARROWHEAD, false, false, 0x0));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEENDARROWHEAD, false, false, 0x0));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEENDCAPSTYLE, false, false, 0x0));
-
- addStandardOptions(shape, opt);
-
- EscherRecord anchor = createAnchor( shape.getAnchor() );
- clientData.setRecordId( EscherClientDataRecord.RECORD_ID );
- clientData.setOptions( (short) 0x0000 );
-
- spContainer.addChildRecord( sp );
- spContainer.addChildRecord( opt );
- spContainer.addChildRecord( anchor );
- spContainer.addChildRecord( clientData );
-
- return spContainer;
- }
-
- /**
- * Creates the low level OBJ record for this shape.
- */
- private ObjRecord createObjRecord( HSSFShape hssfShape, int shapeId )
- {
- ObjRecord obj = new ObjRecord();
- CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
- c.setObjectType( OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING );
- c.setObjectId( getCmoObjectId(shapeId) );
- c.setLocked( true );
- c.setPrintable( true );
- c.setAutofill( true );
- c.setAutoline( true );
- EndSubRecord e = new EndSubRecord();
-
- obj.addSubRecord( c );
- obj.addSubRecord( e );
-
- return obj;
- }
-
- public EscherContainerRecord getSpContainer()
- {
- return spContainer;
- }
-
- public ObjRecord getObjRecord()
- {
- return objRecord;
- }
-
-}
diff --git a/src/java/org/apache/poi/hssf/model/SimpleFilledShape.java b/src/java/org/apache/poi/hssf/model/SimpleFilledShape.java
deleted file mode 100644
index 1763b9d562..0000000000
--- a/src/java/org/apache/poi/hssf/model/SimpleFilledShape.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.hssf.model;
-
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.record.ObjRecord;
-import org.apache.poi.hssf.record.EscherAggregate;
-import org.apache.poi.hssf.record.CommonObjectDataSubRecord;
-import org.apache.poi.hssf.record.EndSubRecord;
-import org.apache.poi.hssf.usermodel.HSSFSimpleShape;
-import org.apache.poi.hssf.usermodel.HSSFShape;
-
-@Deprecated
-public class SimpleFilledShape
- extends AbstractShape
-{
- private EscherContainerRecord spContainer;
- private ObjRecord objRecord;
-
- /**
- * Creates the low evel records for an oval.
- *
- * @param hssfShape The highlevel shape.
- * @param shapeId The shape id to use for this shape.
- */
- SimpleFilledShape( HSSFSimpleShape hssfShape, int shapeId )
- {
- spContainer = createSpContainer( hssfShape, shapeId );
- objRecord = createObjRecord( hssfShape, shapeId );
- }
-
- /**
- * Generates the shape records for this shape.
- *
- * @param hssfShape
- * @param shapeId
- */
- private EscherContainerRecord createSpContainer( HSSFSimpleShape hssfShape, int shapeId )
- {
- HSSFShape shape = hssfShape;
-
- EscherContainerRecord spContainer = new EscherContainerRecord();
- EscherSpRecord sp = new EscherSpRecord();
- EscherOptRecord opt = new EscherOptRecord();
- EscherClientDataRecord clientData = new EscherClientDataRecord();
-
- spContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
- spContainer.setOptions( (short) 0x000F );
- sp.setRecordId( EscherSpRecord.RECORD_ID );
- short shapeType = objTypeToShapeType( hssfShape.getShapeType() );
- sp.setOptions( (short) ( ( shapeType << 4 ) | 0x2 ) );
- sp.setShapeId( shapeId );
- sp.setFlags( EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE );
- opt.setRecordId( EscherOptRecord.RECORD_ID );
- addStandardOptions(shape, opt);
- EscherRecord anchor = createAnchor( shape.getAnchor() );
- clientData.setRecordId( EscherClientDataRecord.RECORD_ID );
- clientData.setOptions( (short) 0x0000 );
-
- spContainer.addChildRecord( sp );
- spContainer.addChildRecord( opt );
- spContainer.addChildRecord( anchor );
- spContainer.addChildRecord( clientData );
-
- return spContainer;
- }
-
- private short objTypeToShapeType( int objType )
- {
- short shapeType;
- if (objType == HSSFSimpleShape.OBJECT_TYPE_OVAL)
- shapeType = EscherAggregate.ST_ELLIPSE;
- else if (objType == HSSFSimpleShape.OBJECT_TYPE_RECTANGLE)
- shapeType = EscherAggregate.ST_RECTANGLE;
- else
- throw new IllegalArgumentException("Unable to handle an object of this type");
- return shapeType;
- }
-
- /**
- * Creates the low level OBJ record for this shape.
- */
- private ObjRecord createObjRecord( HSSFShape hssfShape, int shapeId )
- {
- HSSFShape shape = hssfShape;
-
- ObjRecord obj = new ObjRecord();
- CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
- c.setObjectType( (short) ( (HSSFSimpleShape) shape ).getShapeType() );
- c.setObjectId( getCmoObjectId(shapeId) );
- c.setLocked( true );
- c.setPrintable( true );
- c.setAutofill( true );
- c.setAutoline( true );
- EndSubRecord e = new EndSubRecord();
-
- obj.addSubRecord( c );
- obj.addSubRecord( e );
-
- return obj;
- }
-
- public EscherContainerRecord getSpContainer()
- {
- return spContainer;
- }
-
- public ObjRecord getObjRecord()
- {
- return objRecord;
- }
-
-}
diff --git a/src/java/org/apache/poi/hssf/model/TextboxShape.java b/src/java/org/apache/poi/hssf/model/TextboxShape.java
deleted file mode 100644
index d4379fd3af..0000000000
--- a/src/java/org/apache/poi/hssf/model/TextboxShape.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-
-package org.apache.poi.hssf.model;
-
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.record.*;
-import org.apache.poi.hssf.usermodel.*;
-
-/**
- * Represents an textbox shape and converts between the highlevel records
- * and lowlevel records for an oval.
- */
-@Deprecated
-public class TextboxShape
- extends AbstractShape
-{
- private EscherContainerRecord spContainer;
- private TextObjectRecord textObjectRecord;
- private ObjRecord objRecord;
- private EscherTextboxRecord escherTextbox;
-
- /**
- * Creates the low evel records for an textbox.
- *
- * @param hssfShape The highlevel shape.
- * @param shapeId The shape id to use for this shape.
- */
- TextboxShape( HSSFTextbox hssfShape, int shapeId )
- {
- spContainer = createSpContainer( hssfShape, shapeId );
- objRecord = createObjRecord( hssfShape, shapeId );
- textObjectRecord = createTextObjectRecord( hssfShape, shapeId );
- }
-
- /**
- * Creates the low level OBJ record for this shape.
- */
- private ObjRecord createObjRecord( HSSFTextbox hssfShape, int shapeId )
- {
- HSSFShape shape = hssfShape;
-
- ObjRecord obj = new ObjRecord();
- CommonObjectDataSubRecord c = new CommonObjectDataSubRecord();
- c.setObjectType( (short) ( (HSSFSimpleShape) shape ).getShapeType() );
- c.setObjectId( getCmoObjectId(shapeId) );
- c.setLocked( true );
- c.setPrintable( true );
- c.setAutofill( true );
- c.setAutoline( true );
- EndSubRecord e = new EndSubRecord();
-
- obj.addSubRecord( c );
- obj.addSubRecord( e );
-
- return obj;
- }
-
- /**
- * Generates the escher shape records for this shape.
- *
- * @param hssfShape
- * @param shapeId
- */
- private EscherContainerRecord createSpContainer( HSSFTextbox hssfShape, int shapeId )
- {
- HSSFTextbox shape = hssfShape;
-
- EscherContainerRecord spContainer = new EscherContainerRecord();
- EscherSpRecord sp = new EscherSpRecord();
- EscherOptRecord opt = new EscherOptRecord();
- EscherClientDataRecord clientData = new EscherClientDataRecord();
- escherTextbox = new EscherTextboxRecord();
-
- spContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
- spContainer.setOptions( (short) 0x000F );
- sp.setRecordId( EscherSpRecord.RECORD_ID );
- sp.setOptions( (short) ( ( EscherAggregate.ST_TEXTBOX << 4 ) | 0x2 ) );
-
- sp.setShapeId( shapeId );
- sp.setFlags( EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE );
- opt.setRecordId( EscherOptRecord.RECORD_ID );
- // opt.addEscherProperty( new EscherBoolProperty( EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 262144 ) );
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.TEXT__TEXTID, 0 ) );
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.TEXT__TEXTLEFT, shape.getMarginLeft() ) );
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.TEXT__TEXTRIGHT, shape.getMarginRight() ) );
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.TEXT__TEXTBOTTOM, shape.getMarginBottom() ) );
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.TEXT__TEXTTOP, shape.getMarginTop() ) );
-
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.TEXT__WRAPTEXT, 0 ) );
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.TEXT__ANCHORTEXT, 0 ) );
- opt.addEscherProperty( new EscherSimpleProperty( EscherProperties.GROUPSHAPE__PRINT, 0x00080000 ) );
-
- addStandardOptions( shape, opt );
- HSSFAnchor userAnchor = shape.getAnchor();
- // if (userAnchor.isHorizontallyFlipped())
- // sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPHORIZ);
- // if (userAnchor.isVerticallyFlipped())
- // sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPVERT);
- EscherRecord anchor = createAnchor( userAnchor );
- clientData.setRecordId( EscherClientDataRecord.RECORD_ID );
- clientData.setOptions( (short) 0x0000 );
- escherTextbox.setRecordId( EscherTextboxRecord.RECORD_ID );
- escherTextbox.setOptions( (short) 0x0000 );
-
- spContainer.addChildRecord( sp );
- spContainer.addChildRecord( opt );
- spContainer.addChildRecord( anchor );
- spContainer.addChildRecord( clientData );
- spContainer.addChildRecord( escherTextbox );
-
- return spContainer;
- }
-
- /**
- * Textboxes also have an extra TXO record associated with them that most
- * other shapes dont have.
- */
- private TextObjectRecord createTextObjectRecord( HSSFTextbox hssfShape, int shapeId )
- {
- HSSFTextbox shape = hssfShape;
-
- TextObjectRecord obj = new TextObjectRecord();
- obj.setHorizontalTextAlignment(hssfShape.getHorizontalAlignment());
- obj.setVerticalTextAlignment(hssfShape.getVerticalAlignment());
- obj.setTextLocked(true);
- obj.setTextOrientation(TextObjectRecord.TEXT_ORIENTATION_NONE);
- obj.setStr(shape.getString());
-
- return obj;
- }
-
- public EscherContainerRecord getSpContainer()
- {
- return spContainer;
- }
-
- public ObjRecord getObjRecord()
- {
- return objRecord;
- }
-
- public TextObjectRecord getTextObjectRecord()
- {
- return textObjectRecord;
- }
-
- public EscherRecord getEscherTextbox()
- {
- return escherTextbox;
- }
-
-}
diff --git a/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java b/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java
index 91b9fb7524..5e91b18e78 100644
--- a/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java
+++ b/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java
@@ -160,7 +160,7 @@ public class LbsDataSubRecord extends SubRecord {
/**
*
* @return a new instance of LbsDataSubRecord to construct auto-filters
- * @see org.apache.poi.hssf.model.ComboboxShape#createObjRecord(org.apache.poi.hssf.usermodel.HSSFSimpleShape, int)
+ * @see org.apache.poi.hssf.usermodel.HSSFCombobox
*/
public static LbsDataSubRecord newAutoFilterInstance(){
LbsDataSubRecord lbs = new LbsDataSubRecord();
@@ -330,7 +330,7 @@ public class LbsDataSubRecord extends SubRecord {
/**
* a string that specifies the current string value in the dropdown
*/
- private String _str;
+ private final String _str;
/**
* Optional, undefined and MUST be ignored.
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFShape.java b/src/java/org/apache/poi/hssf/usermodel/HSSFShape.java
index dbdd741548..dc31858fef 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFShape.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFShape.java
@@ -143,7 +143,12 @@ public abstract class HSSFShape {
return _objRecord;
}
- protected EscherOptRecord getOptRecord() {
+ /**
+ * Return the low-level EscherOptRecord to read/modify not yet wrapped escher properties
+ *
+ * @return the low-level EscherOptRecord
+ */
+ public EscherOptRecord getOptRecord() {
return _optRecord;
}