Class XDGFShape

java.lang.Object
org.apache.poi.xdgf.usermodel.XDGFSheet
org.apache.poi.xdgf.usermodel.XDGFShape

public class XDGFShape extends XDGFSheet
A shape is a collection of Geometry Visualization, Format, Text, Images, and Shape Data in a Drawing Page.
  • Constructor Details

    • XDGFShape

      public XDGFShape(com.microsoft.schemas.office.visio.x2012.main.ShapeSheetType shapeSheet, XDGFBaseContents parentPage, XDGFDocument document)
    • XDGFShape

      public XDGFShape(XDGFShape parent, com.microsoft.schemas.office.visio.x2012.main.ShapeSheetType shapeSheet, XDGFBaseContents parentPage, XDGFDocument document)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • readProperties

      protected void readProperties()
    • setupMaster

      protected void setupMaster(XDGFPageContents pageContents, XDGFMasterContents master)
      Setup top level shapes Shapes that have a 'Master' attribute refer to a specific master in the page, whereas shapes with a 'MasterShape' attribute refer to a subshape of a Master.
    • setupSectionMasters

      protected void setupSectionMasters()
    • getXmlObject

      @Internal public com.microsoft.schemas.office.visio.x2012.main.ShapeSheetType getXmlObject()
    • getID

      public long getID()
    • getType

      public String getType()
    • getTextAsString

      public String getTextAsString()
    • hasText

      public boolean hasText()
    • getCell

      public XDGFCell getCell(String cellName)
      Description copied from class: XDGFSheet
      A cell is really just a setting
      Overrides:
      getCell in class XDGFSheet
      Parameters:
      cellName - The particular setting you want
    • getGeometryByIdx

      public GeometrySection getGeometryByIdx(long idx)
    • getShapes

      public List<XDGFShape> getShapes()
      Only available if this shape is a shape group, may be null
    • getName

      public String getName()
    • getShapeType

      public String getShapeType()
    • getSymbolName

      public String getSymbolName()
    • getMasterShape

      public XDGFShape getMasterShape()
    • getParentShape

      public XDGFShape getParentShape()
      Returns:
      The parent shape if this is a subshape, null otherwise
    • getTopmostParentShape

      public XDGFShape getTopmostParentShape()
    • hasMaster

      public boolean hasMaster()
    • hasMasterShape

      public boolean hasMasterShape()
    • hasParent

      public boolean hasParent()
    • hasShapes

      public boolean hasShapes()
    • isTopmost

      public boolean isTopmost()
    • isShape1D

      public boolean isShape1D()
    • isDeleted

      public boolean isDeleted()
    • getText

      public XDGFText getText()
    • getPinX

      public Double getPinX()
    • getPinY

      public Double getPinY()
    • getWidth

      public Double getWidth()
    • getHeight

      public Double getHeight()
    • getLocPinX

      public Double getLocPinX()
    • getLocPinY

      public Double getLocPinY()
    • getBeginX

      public Double getBeginX()
    • getBeginY

      public Double getBeginY()
    • getEndX

      public Double getEndX()
    • getEndY

      public Double getEndY()
    • getAngle

      public Double getAngle()
    • getFlipX

      public Boolean getFlipX()
    • getFlipY

      public Boolean getFlipY()
    • getTxtPinX

      public Double getTxtPinX()
    • getTxtPinY

      public Double getTxtPinY()
    • getTxtLocPinX

      public Double getTxtLocPinX()
    • getTxtLocPinY

      public Double getTxtLocPinY()
    • getTxtAngle

      public Double getTxtAngle()
    • getTxtWidth

      public Double getTxtWidth()
    • getTxtHeight

      public Double getTxtHeight()
    • getLineCap

      public Integer getLineCap()
      Overrides:
      getLineCap in class XDGFSheet
    • getLineColor

      public Color getLineColor()
      Overrides:
      getLineColor in class XDGFSheet
    • getLinePattern

      public Integer getLinePattern()
      Overrides:
      getLinePattern in class XDGFSheet
    • getLineWeight

      public Double getLineWeight()
      Overrides:
      getLineWeight in class XDGFSheet
    • getFontColor

      public Color getFontColor()
      Overrides:
      getFontColor in class XDGFSheet
    • getFontSize

      public Double getFontSize()
      Overrides:
      getFontSize in class XDGFSheet
    • getStroke

      public Stroke getStroke()
    • getGeometrySections

      public Iterable<GeometrySection> getGeometrySections()
    • getBounds

      public Rectangle2D.Double getBounds()
      Returns:
      rectangle in local coordinates
    • getBoundsAsPath

      public Path2D.Double getBoundsAsPath()
      Returns:
      returns bounds as a path in local coordinates, which is userful if you need to transform to global coordinates Warning: Don't use this for 1d objects, and will fail for infinite line objects
    • getPath

      public Path2D.Double getPath()
      Returns:
      The outline of the shape in local coordinates
    • hasGeometry

      public boolean hasGeometry()
    • getParentTransform

      protected AffineTransform getParentTransform()
      Returns a transform that can translate shape-local coordinates to the coordinates of its parent shape
    • visitShapes

      public void visitShapes(ShapeVisitor visitor, AffineTransform tr, int level)
      The visitor will first visit this shape, then it's children This is useful because exceptions will be marked with the shapes as it propagates up the shape hierarchy.
    • visitShapes

      public void visitShapes(ShapeVisitor visitor, int level)
      The visitor will first visit this shape, then it's children. No transform is calculated for this visit This is useful because exceptions will be marked with the shapes as it propagates up the shape hierarchy.