com.spire.doc.fields.shapes
Class ShapeBase

java.lang.Object
  extended by com.spire.doc.OwnerHolder
      extended by com.spire.doc.documents.xml.DocumentSerializable
          extended by com.spire.doc.DocumentObject
              extended by com.spire.doc.DocumentBase
                  extended by com.spire.doc.fields.ParagraphBase
                      extended by com.spire.doc.fields.shapes.ShapeBase
All Implemented Interfaces:
IDocumentObject, IDocumentSerializable, IParagraphBase
Direct Known Subclasses:
Shape, ShapeGroup

public abstract class ShapeBase
extends ParagraphBase

Base class for objects in the Psawing layer, such as an AutoShape, freeform, OLE object, ActiveX control, or picture.

This is an abstract class. The two derived classes that you can instantiate are and .

A shape is a node in the document tree.

If the shape is a child of a object, then the shape is said to be "top-level". Top-level shapes are measured and positioned in points.

A shape can also occur as a child of a object when several shapes are grouped. Child shapes of a group shape are positioned in the coordinate space and units defined by the and properties of the parent group shape.

A shape can be positioned inline with text or floating. The positioning method is controlled using the property.

When a shape is floating, it is positioned relative to something (e.g the current paragraph, the margin or the page). The relative positioning of the shape is specified using the and properties.

A floating shape be positioned explicitly using the and properties or aligned relative to some other object using the and properties.


Method Summary
 com.spire.ms.System.Drawing.RectangleF adjustWithEffects(com.spire.ms.System.Drawing.RectangleF source)
           
 boolean getAllowOverlap()
          Gets or sets the boolean a value.
 java.lang.String getAlternativeText()
          Gets or sets the alternative text.
 boolean getAspectRatioLocked()
          Gets the boolean valut.
 boolean getBehindText()
          Gets or sets the boolean a valut.
 double getBottom()
          Gets the position of the bottom edge of the containing block of the shape.
 DocumentObjectCollection getChildObjects()
          Gets the child objects of the entity.
 com.spire.ms.System.Drawing.Point getCoordOrigin()
           
 com.spire.ms.System.Drawing.Size getCoordSize()
           
 double getDistanceBottom()
           
 double getDistanceLeft()
           
 double getDistanceRight()
           
 double getDistanceTop()
           
 Fill getFill()
          Gets the fill of the shape.
 float getHeight()
          Gets the height of the containing block of the shape.
 ShapeHorizontalAlignment getHorizontalAlignment()
          Specifies how the shape is positioned horizontally.
 HorizontalOrigin getHorizontalOrigin()
          Specifies relative to what the shape is positioned horizontally.
 float getHorizontalPosition()
           
 double getRight()
          Gets the position of the right edge of the containing block of the shape.
 double getRotation()
           
 ShapeType getShapeType()
          Gets the shape type.
 com.spire.ms.System.Drawing.SizeF getSize()
          Gets the size of the shape in its native units.
 TextWrappingStyle getTextWrappingStyle()
          Defines whether the shape is inline or floating.
 TextWrappingType getTextWrappingType()
          Specifies how the text is wrapped around the shape.
 ShapeVerticalAlignment getVerticalAlignment()
          Specifies how the shape is positioned vertically.
 VerticalOrigin getVerticalOrigin()
          Specifies relative to what the shape is positioned vertically.
 float getVerticalPosition()
           
 float getWidth()
          Gets the width of the containing block of the shape.
 TextWrappingStyle getWrapType()
           
 int getZOrder()
           
 boolean hasImage()
          Returns true if the shape has image bytes or links an image.
 boolean isHidden()
          Gets the flag the specifies whether the shape is visible in the document or not.
 void isHidden(boolean value)
          sets the flag the specifies whether the shape is visible in the document or not.
 boolean isSignatureLine()
           
 com.spire.ms.System.Drawing.PointF localToParent(com.spire.ms.System.Drawing.PointF value)
           
 void setAllowOverlap(boolean value)
          Gets or sets the boolean a value.
 void setAlternativeText(java.lang.String value)
          Gets or sets the alternative text.
 void setAspectRatioLocked(boolean value)
          Sets the boolean valut.
 void setBehindText(boolean value)
          Gets or sets the boolean a valut.
 void setCoordOrigin(com.spire.ms.System.Drawing.Point value)
           
 void setCoordSize(com.spire.ms.System.Drawing.Size value)
           
 void setDistanceBottom(double value)
           
 void setDistanceLeft(double value)
           
 void setDistanceRight(double value)
           
 void setDistanceTop(double value)
           
 void setHeight(float value)
          Sets the height of the containing block of the shape.
 void setHorizontalAlignment(ShapeHorizontalAlignment value)
          Specifies how the shape is positioned horizontally.
 void setHorizontalOrigin(HorizontalOrigin value)
          Specifies relative to what the shape is positioned horizontally.
 void setHorizontalPosition(float value)
           
 void setRotation(double value)
           
 void setShapeType(ShapeType shapeType)
          Sets the shape type.
 void setTextWrappingStyle(TextWrappingStyle value)
          Defines whether the shape is inline or floating.
 void setTextWrappingType(TextWrappingType value)
          Specifies how the text is wrapped around the shape.
 void setVerticalAlignment(ShapeVerticalAlignment value)
          Specifies how the shape is positioned vertically.
 void setVerticalOrigin(VerticalOrigin value)
          Specifies relative to what the shape is positioned vertically.
 void setVerticalPosition(float value)
           
 void setWidth(float value)
          Sets the width of the containing block of the shape.
 void setWrapType(TextWrappingStyle value)
           
 void setZOrder(int value)
           
 
Methods inherited from class com.spire.doc.fields.ParagraphBase
applyCharacterFormat, applyStyle, getCharacterFormat, getDeleteRevision, getInsertRevision, getNextWidgetSibling, getOwnerParagraph, getPreviousWidgetSibling, getStyleName, isDeleteRevision, isInsertRevision
 
Methods inherited from class com.spire.doc.DocumentObject
deepClone, getDocumentObjectType, getFirstChild, getLastChild, getNextSibling, getOwner, getPreviousSibling, isComposite, prependChild, toString
 
Methods inherited from class com.spire.doc.OwnerHolder
getDocument
 
Methods inherited from interface com.spire.doc.interfaces.IDocumentObject
deepClone, getDocument, getDocumentObjectType, getNextSibling, getOwner, getPreviousSibling, isComposite
 

Method Detail

localToParent

public com.spire.ms.System.Drawing.PointF localToParent(com.spire.ms.System.Drawing.PointF value)

setShapeType

public void setShapeType(ShapeType shapeType)
Sets the shape type. Users are not to modify shape type directly.


getChildObjects

public DocumentObjectCollection getChildObjects()
Gets the child objects of the entity.

Overrides:
getChildObjects in class ParagraphBase

getAlternativeText

public java.lang.String getAlternativeText()
Gets or sets the alternative text.

The default value is an empty string.


setAlternativeText

public void setAlternativeText(java.lang.String value)
Gets or sets the alternative text.

The default value is an empty string.


isHidden

public boolean isHidden()
Gets the flag the specifies whether the shape is visible in the document or not.

Default is false.


isHidden

public void isHidden(boolean value)
sets the flag the specifies whether the shape is visible in the document or not.

Parameters:
value -

getAspectRatioLocked

public boolean getAspectRatioLocked()
Gets the boolean valut. Specifies that the generating application should not allow aspect ratio changes for the corresponding graphic frame.


setAspectRatioLocked

public void setAspectRatioLocked(boolean value)
Sets the boolean valut. Specifies that the generating application should not allow aspect ratio changes for the corresponding graphic frame.


getAllowOverlap

public boolean getAllowOverlap()
Gets or sets the boolean a value. Specifies whether this shape can overlap other shapes.


setAllowOverlap

public void setAllowOverlap(boolean value)
Gets or sets the boolean a value. Specifies whether this shape can overlap other shapes.


getBehindText

public boolean getBehindText()
Gets or sets the boolean a valut. Specifies whether the shape is below or above text.


setBehindText

public void setBehindText(boolean value)
Gets or sets the boolean a valut. Specifies whether the shape is below or above text.


getHorizontalPosition

public float getHorizontalPosition()

setHorizontalPosition

public void setHorizontalPosition(float value)

getVerticalPosition

public float getVerticalPosition()

setVerticalPosition

public void setVerticalPosition(float value)

getRight

public double getRight()
Gets the position of the right edge of the containing block of the shape.


getBottom

public double getBottom()
Gets the position of the bottom edge of the containing block of the shape.


getWidth

public float getWidth()
Gets the width of the containing block of the shape.

The default value is 0.


setWidth

public void setWidth(float value)
Sets the width of the containing block of the shape.

The default value is 0.


getHeight

public float getHeight()
Gets the height of the containing block of the shape.

The default value is 0.


setHeight

public void setHeight(float value)
Sets the height of the containing block of the shape.

The default value is 0.


getDistanceTop

public double getDistanceTop()

setDistanceTop

public void setDistanceTop(double value)

getDistanceBottom

public double getDistanceBottom()

setDistanceBottom

public void setDistanceBottom(double value)

getDistanceLeft

public double getDistanceLeft()

setDistanceLeft

public void setDistanceLeft(double value)

getDistanceRight

public double getDistanceRight()

setDistanceRight

public void setDistanceRight(double value)

getRotation

public double getRotation()

setRotation

public void setRotation(double value)

getZOrder

public int getZOrder()

setZOrder

public void setZOrder(int value)

adjustWithEffects

public com.spire.ms.System.Drawing.RectangleF adjustWithEffects(com.spire.ms.System.Drawing.RectangleF source)

getShapeType

public ShapeType getShapeType()
Gets the shape type.


getHorizontalOrigin

public HorizontalOrigin getHorizontalOrigin()
Specifies relative to what the shape is positioned horizontally.

Has effect only for top level floating shapes.

public virtual RelativeHorizontalPosition RelativeHorizontalPosition


setHorizontalOrigin

public void setHorizontalOrigin(HorizontalOrigin value)
Specifies relative to what the shape is positioned horizontally.

Has effect only for top level floating shapes.

public virtual RelativeHorizontalPosition RelativeHorizontalPosition


getVerticalOrigin

public VerticalOrigin getVerticalOrigin()
Specifies relative to what the shape is positioned vertically.

Has effect only for top level floating shapes.

public virtual RelativeVerticalPosition RelativeVerticalPosition


setVerticalOrigin

public void setVerticalOrigin(VerticalOrigin value)
Specifies relative to what the shape is positioned vertically.

Has effect only for top level floating shapes.

public virtual RelativeVerticalPosition RelativeVerticalPosition


getHorizontalAlignment

public ShapeHorizontalAlignment getHorizontalAlignment()
Specifies how the shape is positioned horizontally.

Has effect only for top level floating shapes.


setHorizontalAlignment

public void setHorizontalAlignment(ShapeHorizontalAlignment value)
Specifies how the shape is positioned horizontally.

Has effect only for top level floating shapes.


getVerticalAlignment

public ShapeVerticalAlignment getVerticalAlignment()
Specifies how the shape is positioned vertically.

Has effect only for top level floating shapes.


setVerticalAlignment

public void setVerticalAlignment(ShapeVerticalAlignment value)
Specifies how the shape is positioned vertically.

Has effect only for top level floating shapes.


getWrapType

public TextWrappingStyle getWrapType()

setWrapType

public void setWrapType(TextWrappingStyle value)

getTextWrappingStyle

public TextWrappingStyle getTextWrappingStyle()
Defines whether the shape is inline or floating. For floating shapes defines the wrapping mode for text around the shape.

Has effect only for top level shapes.

Gets or sets the text wrapping style.


setTextWrappingStyle

public void setTextWrappingStyle(TextWrappingStyle value)
Defines whether the shape is inline or floating. For floating shapes defines the wrapping mode for text around the shape.

Has effect only for top level shapes.

Gets or sets the text wrapping style.


getTextWrappingType

public TextWrappingType getTextWrappingType()
Specifies how the text is wrapped around the shape.

Has effect only for top level shapes.


setTextWrappingType

public void setTextWrappingType(TextWrappingType value)
Specifies how the text is wrapped around the shape.

Has effect only for top level shapes.


getCoordOrigin

public com.spire.ms.System.Drawing.Point getCoordOrigin()

setCoordOrigin

public void setCoordOrigin(com.spire.ms.System.Drawing.Point value)

getCoordSize

public com.spire.ms.System.Drawing.Size getCoordSize()

setCoordSize

public void setCoordSize(com.spire.ms.System.Drawing.Size value)

isSignatureLine

public boolean isSignatureLine()

getSize

public com.spire.ms.System.Drawing.SizeF getSize()
Gets the size of the shape in its native units. Top level shapes are in points. Child shapes are in parent coordinate system.


getFill

public Fill getFill()
Gets the fill of the shape.


hasImage

public boolean hasImage()
Returns true if the shape has image bytes or links an image.