Save This Page
Home » poi-src-3.2-FINAL-20081019 » org.apache » poi » hslf » model » [javadoc | source]
org.apache.poi.hslf.model
abstract public class: Shape [javadoc | source]
java.lang.Object
   org.apache.poi.hslf.model.Shape

Direct Known Subclasses:
    ActiveXShape, Background, MovieShape, TextBox, ShapeGroup, SimpleShape, Freeform, TableCell, Table, Line, Picture, TextShape, OLEShape, Polygon, Placeholder, AutoShape

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  POILogger logger     
public static final  int EMU_PER_INCH    In Escher absolute distances are specified in English Metric Units (EMUs), occasionally referred to as A units; there are 360000 EMUs per centimeter, 914400 EMUs per inch, 12700 EMUs per point. 
public static final  int EMU_PER_POINT     
public static final  int EMU_PER_CENTIMETER     
public static final  int MASTER_DPI    Master DPI (576 pixels per inch). Used by the reference coordinate system in PowerPoint. 
public static final  int PIXEL_DPI    Pixels DPI (96 pixels per inch) 
public static final  int POINT_DPI    Points DPI (72 pixels per inch) 
protected  EscherContainerRecord _escherContainer    Either EscherSpContainer or EscheSpgrContainer record which holds information about this shape. 
protected  Shape _parent    Parent of this shape. null for the topmost shapes. 
protected  Sheet _sheet    The Sheet this shape belongs to 
protected  Fill _fill    Fill 
Constructor:
 protected Shape(EscherContainerRecord escherRecord,
    Shape parent) 
    Create a Shape object. This constructor is used when an existing Shape is read from from a PowerPoint document.
    Parameters:
    escherRecord - EscherSpContainer container which holds information about this shape
    parent - the parent of this Shape
Method from org.apache.poi.hslf.model.Shape Summary:
afterInsert,   createSpContainer,   draw,   getAnchor,   getAnchor2D,   getColor,   getEscherChild,   getEscherProperty,   getEscherProperty,   getEscherProperty,   getFill,   getHyperlink,   getLogicalAnchor2D,   getOutline,   getParent,   getShapeId,   getShapeName,   getShapeType,   getSheet,   getSpContainer,   moveTo,   setAnchor,   setEscherProperty,   setEscherProperty,   setShapeId,   setShapeType,   setSheet
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.poi.hslf.model.Shape Detail:
 protected  void afterInsert(Sheet sh) 
    Event which fires when a shape is inserted in the sheet. In some cases we need to propagate changes to upper level containers.
    Default implementation does nothing.
 abstract protected EscherContainerRecord createSpContainer(boolean isChild)
    Creates the lowerlevel escher records for this shape.
 public  void draw(Graphics2D graphics) 
 public Rectangle getAnchor() 
    Returns the anchor (the bounding box rectangle) of this shape. All coordinates are expressed in points (72 dpi).
 public Rectangle2D getAnchor2D() 
    Returns the anchor (the bounding box rectangle) of this shape. All coordinates are expressed in points (72 dpi).
 protected Color getColor(int rgb,
    int alpha) 
 public static EscherRecord getEscherChild(EscherContainerRecord owner,
    int recordId) 
    Helper method to return escher child by record ID
 public int getEscherProperty(short propId) 
    Get the value of a simple escher property for this shape.
 public static EscherProperty getEscherProperty(EscherOptRecord opt,
    int propId) 
    Returns escher property by id.
 public int getEscherProperty(short propId,
    int defaultValue) 
    Get the value of a simple escher property for this shape.
 public Fill getFill() 
    Fill properties of this shape
 public Hyperlink getHyperlink() 
    Returns the hyperlink assigned to this shape
 public Rectangle2D getLogicalAnchor2D() 
 public Shape getOutline() 
    Return shape outline as a java.awt.Shape object
 public Shape getParent() 
 public int getShapeId() 
 public String getShapeName() 
 public int getShapeType() 
 public Sheet getSheet() 
 public EscherContainerRecord getSpContainer() 
 public  void moveTo(float x,
    float y) 
    Moves the top left corner of the shape to the specified point.
 public  void setAnchor(Rectangle2D anchor) 
    Sets the anchor (the bounding box rectangle) of this shape. All coordinates should be expressed in points (72 dpi).
 public  void setEscherProperty(short propId,
    int value) 
    Set an simple escher property for this shape.
 public static  void setEscherProperty(EscherOptRecord opt,
    short propId,
    int value) 
    Set an escher property for this shape.
 public  void setShapeId(int id) 
    Sets shape ID
 public  void setShapeType(int type) 
 public  void setSheet(Sheet sheet) 
    Assign the SlideShow this shape belongs to