shapebase-ag凯发旗舰厅



com.spire.doc.fields.shape
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.shape.shapebase
all implemented interfaces:
irunattrsource, icompositeobject, idocumentobject, iparagraphbase
direct known subclasses:
shapeobject

public abstract class shapebase
extends paragraphbase
implements icompositeobject

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 shape and groupshape.

a shape is a node in the document tree.

if the shape is a child of a paragraph 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 groupshape object when several shapes are grouped. child shapes of a group shape are positioned in the coordinate space and units defined by the coordsize and coordorigin properties of the parent group shape.

a shape can be positioned inline with text or floating. the positioning method is controlled using the wraptype 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 relativehorizontalpositionand relativeverticalposition properties.

a floating shape be positioned explicitly using the left and top properties or aligned relative to some other object using the horizontalalignment and verticalalignment properties.

shape groupshape


method summary
 boolean getallowoverlap()
          gets a value that specifies whether thisshape can overlap other shapes.
 boolean getbehindtext()
          specifies whether the shape is below or above text.
 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.
 double getdistancebottom()
          gets the distance (in points) between the document text and the bottom edge of the shape.
 double getdistanceleft()
          gets the distance (in points) between the document text and the left edge of the shape.
 double getdistanceright()
          gets the distance (in points) between the document text and the right edge of the shape.
 double getdistancetop()
          gets the distance (in points) between the document text and the top edge of the shape.
 documentobjecttype getdocumentobjecttype()
          gets the type of the document object.
 float getheight()
          gets the height of the containing block of the shape.
 shapehorizontalalignment gethorizontalalignment()
          gets how the shape is positioned horizontally.
 horizontalorigin gethorizontalorigin()
           
 float gethorizontalposition()
           
 paragraph getparentparagraph()
          returns the immediate parent paragraph.
 double getright()
          gets the position of the right edge of the containing block of the shape.
 double getrotation()
          gets the angle (in degrees) that a shape is rotated.
 shapetype getshapetype()
          gets the shape type.
 textwrappingstyle gettextwrappingstyle()
          gets whether the shape is inline or floating.
 textwrappingtype gettextwrappingtype()
          gets how the text is wrapped around the shape.
 shapeverticalalignment getverticalalignment()
          specifies how the shape is positioned vertically.
 verticalorigin getverticalorigin()
           
 float getverticalposition()
           
 float getwidth()
          gets the width of the containing block of the shape.
 long getzorder()
          gets the display order of overlapping shapes.
 boolean haskey(int key)
           
 boolean isimage()
          returns true if this shape is an image shape.
 java.awt.geom.point2d localtoparent(java.awt.geom.point2d value)
          converts a value from the local coordinate space into the coordinate space of the parent shape.
 void removeshapeattribute(int key)
          reserved for system use.
 void setallowoverlap(boolean value)
          sets a value that specifies whether thisshape can overlap other shapes.
 void setbehindtext(boolean value)
          sets whether the shape is below or above text.
 void setdistancebottom(double value)
          sets the distance (in points) between the document text and the bottom edge of the shape.
 void setdistanceleft(double value)
          sets the distance (in points) between the document text and the left edge of the shape.
 void setdistanceright(double value)
          sets the distance (in points) between the document text and the right edge of the shape.
 void setdistancetop(double value)
          sets the distance (in points) between the document text and the top edge of the shape.
 void setheight(float value)
          sets the height of the containing block of the shape.
 void sethorizontalalignment(shapehorizontalalignment value)
          sets how the shape is positioned horizontally.
 void sethorizontalorigin(horizontalorigin value)
           
 void sethorizontalposition(float value)
           
 void setrotation(double value)
          sets the angle (in degrees) that a shape is rotated.
 void setshapeattr(int key, java.lang.object value)
          reserved for system use.
 void setshapeattribute(int key, java.lang.object value)
          reserved for system use.
 void setshapetype(shapetype shapetype)
          sets the shape type.
 void settextwrappingstyle(textwrappingstyle value)
          sets whether the shape is inline or floating.
 void settextwrappingtype(textwrappingtype value)
          sets how the text is wrapped around the shape.
 void setverticalalignment(shapeverticalalignment value)
          sets how the shape is positioned vertically.
 void setverticalorigin(verticalorigin value)
           
 void setverticalposition(float value)
           
 void setwidth(float value)
          sets the width of the containing block of the shape.
 void setzorder(long value)
          sets the display order of overlapping shapes.
 
methods inherited from class com.spire.doc.fields.paragraphbase
applycharacterformat, applystyle, getancestor, getcharacterformat, getownerparagraph, getstylename, isdeleterevision, isinsertrevision
 
methods inherited from class com.spire.doc.documentobject
deepclone, getfirstchild, getlastchild, getnextsibling, getowner, getprevioussibling, iscomposite, tostring
 
methods inherited from class com.spire.doc.ownerholder
getdocument
 
methods inherited from interface com.spire.doc.interfaces.idocumentobject
deepclone, getdocument, getnextsibling, getowner, getprevioussibling, iscomposite
 
methods inherited from interface com.spire.doc.documents.irunattrsource
clearrunattrs, fetchinheritedrunattr, getdirectrunattr, getdirectrunattrbyindex, getdirectrunattrscount, setrunattr
 
method detail

getdocumentobjecttype

public documentobjecttype getdocumentobjecttype()
description copied from class: documentobject
gets the type of the document object.
specified by:
getdocumentobjecttype in interface idocumentobject
specified by:
getdocumentobjecttype in class documentobject
returns:
the type of the document object.

setshapetype

public void setshapetype(shapetype shapetype)
sets the shape type. users are not to modify shape type directly.
parameters:
shapetype -

setshapeattribute

public void setshapeattribute(int key,
                              java.lang.object value)
reserved for system use. ishapeattrsource.
parameters:
key - key
value - value

setshapeattr

public void setshapeattr(int key,
                         java.lang.object value)
reserved for system use. ishapeattrsource.
parameters:
key - key
value - value

removeshapeattribute

public void removeshapeattribute(int key)
reserved for system use. ishapeattrsource.
parameters:
key - key

haskey

public boolean haskey(int key)

localtoparent

public java.awt.geom.point2d localtoparent(java.awt.geom.point2d value)
converts a value from the local coordinate space into the coordinate space of the parent shape.
parameters:
value - point2d value
returns:
point2d

getshapetype

public shapetype getshapetype()
gets the shape type.
returns:
shapetype

isimage

public boolean isimage()
returns true if this shape is an image shape.
returns:
is image

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.
returns:
double value

getbottom

public double getbottom()
gets the position of the bottom edge of the containing block of the shape.
returns:
double value

getwidth

public float getwidth()
gets the width of the containing block of the shape. the default value is 0.
returns:
width value

setwidth

public void setwidth(float value)
sets the width of the containing block of the shape.
parameters:
value - width value

getheight

public float getheight()
gets the height of the containing block of the shape. the default value is 0.
returns:
height

setheight

public void setheight(float value)
sets the height of the containing block of the shape.
parameters:
value - height

gethorizontalorigin

public horizontalorigin gethorizontalorigin()

sethorizontalorigin

public void sethorizontalorigin(horizontalorigin value)

getverticalorigin

public verticalorigin getverticalorigin()

setverticalorigin

public void setverticalorigin(verticalorigin value)

gethorizontalalignment

public shapehorizontalalignment gethorizontalalignment()
gets how the shape is positioned horizontally.

has effect only for top level floating shapes

returns:
shapehorizontalalignment

sethorizontalalignment

public void sethorizontalalignment(shapehorizontalalignment value)
sets how the shape is positioned horizontally.
parameters:
value - shapehorizontalalignment

getverticalalignment

public shapeverticalalignment getverticalalignment()
specifies how the shape is positioned vertically.

has effect only for top level floating shapes.

returns:
shapeverticalalignment

setverticalalignment

public void setverticalalignment(shapeverticalalignment value)
sets how the shape is positioned vertically.
parameters:
value - shapeverticalalignment

gettextwrappingstyle

public textwrappingstyle gettextwrappingstyle()
gets 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

returns:
textwrappingstyle

settextwrappingstyle

public void settextwrappingstyle(textwrappingstyle value)
sets whether the shape is inline or floating. for floating shapes defines the wrapping mode for text around the shape.
parameters:
value - textwrappingstyle

gettextwrappingtype

public textwrappingtype gettextwrappingtype()
gets how the text is wrapped around the shape.

has effect only for top level shapes.

returns:
textwrappingtype

settextwrappingtype

public void settextwrappingtype(textwrappingtype value)
sets how the text is wrapped around the shape.
parameters:
value - textwrappingtype

getallowoverlap

public boolean getallowoverlap()
gets a value that specifies whether thisshape can overlap other shapes.

this property affects behavior of the shape in microsoft word.

this property is applicable only to top level shapes.

the default value is true

returns:
boolean

setallowoverlap

public void setallowoverlap(boolean value)
sets a value that specifies whether thisshape can overlap other shapes.
parameters:
value - boolean

getbehindtext

public boolean getbehindtext()
specifies whether the shape is below or above text.

has effect only for top level shapes.

the default value is false.

returns:
boolean

setbehindtext

public void setbehindtext(boolean value)
sets whether the shape is below or above text.
parameters:
value - boolean

getdistancetop

public double getdistancetop()
gets the distance (in points) between the document text and the top edge of the shape.

the default value is 0.

has effect only for top level shapes.

returns:
double

setdistancetop

public void setdistancetop(double value)
sets the distance (in points) between the document text and the top edge of the shape.
parameters:
value - double

getdistancebottom

public double getdistancebottom()
gets the distance (in points) between the document text and the bottom edge of the shape.

the default value is 0.

has effect only for top level shapes.

returns:
double

setdistancebottom

public void setdistancebottom(double value)
sets the distance (in points) between the document text and the bottom edge of the shape.
parameters:
value - double

getdistanceleft

public double getdistanceleft()
gets the distance (in points) between the document text and the left edge of the shape.

the default value is 1/8 inch.

has effect only for top level shapes.

returns:
double

setdistanceleft

public void setdistanceleft(double value)
sets the distance (in points) between the document text and the left edge of the shape.
parameters:
value - double

getdistanceright

public double getdistanceright()
gets the distance (in points) between the document text and the right edge of the shape.

the default value is 1/8 inch.

has effect only for top level shapes.

returns:
double

setdistanceright

public void setdistanceright(double value)
sets the distance (in points) between the document text and the right edge of the shape.
parameters:
value - double

getzorder

public long getzorder()
gets the display order of overlapping shapes.

has effect only for top level shapes.

the default value is 0.

the number represents the stacking precedence. a shape with a higher number will be displayed as if it were overlapping (in "front" of) a shape with a lower number.

the order of overlapping shapes is independent for shapes in the header and in the main text of the document.

the display order of child shapes in a group shape is determined by their order inside the group shape.

returns:
long

setzorder

public void setzorder(long value)
sets the display order of overlapping shapes.
parameters:
value - long

getrotation

public double getrotation()
gets the angle (in degrees) that a shape is rotated. positive value corresponds to clockwise rotation angle.

the default value is 0.

returns:
double

setrotation

public void setrotation(double value)
sets the angle (in degrees) that a shape is rotated. positive value corresponds to clockwise rotation angle.
parameters:
value - double

getparentparagraph

public paragraph getparentparagraph()
returns the immediate parent paragraph.

for child shapes of a group shape always returns null.

returns:
paragraph

getchildobjects

public documentobjectcollection getchildobjects()
description copied from class: paragraphbase
gets the child objects of the entity.
specified by:
getchildobjects in interface icompositeobject
overrides:
getchildobjects in class paragraphbase
returns:
documentobjectcollection


网站地图