|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hslf.usermodel.HSLFShape
public abstract class HSLFShape
Represents a Shape which is the elemental object that composes a drawing. This class is a wrapper around EscherSpContainer which holds all information about a shape in PowerPoint document.
When you add a shape, you usually specify the dimensions of the shape and the position of the upper'left corner of the bounding box for the shape relative to the upper'left corner of the page, worksheet, or slide. Distances in the drawing layer are measured in points (72 points = 1 inch).
Field Summary | |
---|---|
protected EscherContainerRecord |
_escherContainer
Either EscherSpContainer or EscheSpgrContainer record which holds information about this shape. |
protected HSLFFill |
_fill
Fill |
protected ShapeContainer<HSLFShape,HSLFTextParagraph> |
_parent
Parent of this shape. |
protected HSLFSheet |
_sheet
The Sheet this shape belongs to |
protected POILogger |
logger
|
Constructor Summary | |
---|---|
protected |
HSLFShape(EscherContainerRecord escherRecord,
ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
Create a Shape object. |
Method Summary | ||
---|---|---|
protected void |
afterInsert(HSLFSheet sh)
Event which fires when a shape is inserted in the sheet. |
|
protected abstract EscherContainerRecord |
createSpContainer(boolean isChild)
Creates the lowerlevel escher records for this shape. |
|
void |
draw(java.awt.Graphics2D graphics)
|
|
java.awt.Rectangle |
getAnchor()
Returns the anchor (the bounding box rectangle) of this shape. |
|
static
|
getEscherChild(EscherContainerRecord owner,
int recordId)
Helper method to return escher child by record ID |
|
|
getEscherChild(int recordId)
|
|
AbstractEscherOptRecord |
getEscherOptRecord()
|
|
static
|
getEscherProperty(AbstractEscherOptRecord opt,
int propId)
Returns escher property by id. |
|
int |
getEscherProperty(short propId)
Get the value of a simple escher property for this shape. |
|
int |
getEscherProperty(short propId,
int defaultValue)
Get the value of a simple escher property for this shape. |
|
HSLFFill |
getFill()
Fill properties of this shape |
|
FillStyle |
getFillStyle()
|
|
boolean |
getFlipHorizontal()
|
|
boolean |
getFlipVertical()
|
|
HSLFHyperlink |
getHyperlink()
Returns the hyperlink assigned to this shape |
|
ShapeContainer<HSLFShape,HSLFTextParagraph> |
getParent()
|
|
double |
getRotation()
|
|
int |
getShapeId()
|
|
java.lang.String |
getShapeName()
|
|
ShapeType |
getShapeType()
|
|
HSLFSheet |
getSheet()
|
|
EscherContainerRecord |
getSpContainer()
|
|
boolean |
isPlaceholder()
|
|
void |
moveTo(float x,
float y)
Moves the top left corner of the shape to the specified point. |
|
void |
setAnchor(java.awt.Rectangle anchor)
Sets the anchor (the bounding box rectangle) of this shape. |
|
static void |
setEscherProperty(AbstractEscherOptRecord opt,
short propId,
int value)
Set an escher property for this shape. |
|
void |
setEscherProperty(short propId,
int value)
Set an simple escher property for this shape. |
|
void |
setFlipHorizontal(boolean flip)
|
|
void |
setFlipVertical(boolean flip)
|
|
void |
setRotation(double theta)
|
|
void |
setShapeId(int id)
Sets shape ID |
|
void |
setShapeType(ShapeType type)
|
|
void |
setSheet(HSLFSheet sheet)
Assign the SlideShow this shape belongs to |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected POILogger logger
protected EscherContainerRecord _escherContainer
protected ShapeContainer<HSLFShape,HSLFTextParagraph> _parent
null
for the topmost shapes.
protected HSLFSheet _sheet
Sheet
this shape belongs to
protected HSLFFill _fill
Constructor Detail |
---|
protected HSLFShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
escherRecord
- EscherSpContainer
container which holds information about this shapeparent
- the parent of this ShapeMethod Detail |
---|
protected abstract EscherContainerRecord createSpContainer(boolean isChild)
public ShapeContainer<HSLFShape,HSLFTextParagraph> getParent()
getParent
in interface Shape<HSLFShape,HSLFTextParagraph>
public java.lang.String getShapeName()
public ShapeType getShapeType()
RecordTypes
public void setShapeType(ShapeType type)
type
- type of the shape.RecordTypes
public java.awt.Rectangle getAnchor()
getAnchor
in interface Shape<HSLFShape,HSLFTextParagraph>
public void setAnchor(java.awt.Rectangle anchor)
anchor
- new anchorpublic void moveTo(float x, float y)
x
- the x coordinate of the top left corner of the shapey
- the y coordinate of the top left corner of the shapepublic static <T extends EscherRecord> T getEscherChild(EscherContainerRecord owner, int recordId)
null
if not found.public <T extends EscherRecord> T getEscherChild(int recordId)
public static <T extends EscherProperty> T getEscherProperty(AbstractEscherOptRecord opt, int propId)
null
if not found.public static void setEscherProperty(AbstractEscherOptRecord opt, short propId, int value)
opt
- The opt record to set the properties to.propId
- The id of the property. One of the constants defined in EscherOptRecord.value
- value of the property. If value = -1 then the property is removed.public void setEscherProperty(short propId, int value)
propId
- The id of the property. One of the constants defined in EscherOptRecord.value
- value of the property. If value = -1 then the property is removed.public int getEscherProperty(short propId)
propId
- The id of the property. One of the constants defined in EscherOptRecord.public int getEscherProperty(short propId, int defaultValue)
propId
- The id of the property. One of the constants defined in EscherOptRecord.public EscherContainerRecord getSpContainer()
protected void afterInsert(HSLFSheet sh)
sh
- - owning shapepublic HSLFSheet getSheet()
getSheet
in interface Shape<HSLFShape,HSLFTextParagraph>
SlideShow
this shape belongs topublic void setSheet(HSLFSheet sheet)
SlideShow
this shape belongs to
sheet
- owner of this shapepublic int getShapeId()
public void setShapeId(int id)
id
- of the shapepublic HSLFFill getFill()
public FillStyle getFillStyle()
public HSLFHyperlink getHyperlink()
null
if not found.public void draw(java.awt.Graphics2D graphics)
public AbstractEscherOptRecord getEscherOptRecord()
public boolean getFlipHorizontal()
public void setFlipHorizontal(boolean flip)
public boolean getFlipVertical()
public void setFlipVertical(boolean flip)
public double getRotation()
public void setRotation(double theta)
public boolean isPlaceholder()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |