Shape

Overview

Shape is a class in Aspose.Words FOSS for Java. Inherits from: ShapeBase, ITextBox, IStrokable.

Represents an object in the drawing layer, such as an AutoShape, textbox, freeform, OLE object, ActiveX control, or picture.

Edition status of its 219 listed members (a property and its accessor methods are listed separately, overloads once): 219 not yet exercised by a verified example.

This class declares 138 methods for Shape objects in Java programs. Available methods include: Shape, accept, acceptEnd, acceptStart, adjustWithEffects, canHaveImage, getAdjustments, getAllowOverlap, getAlternativeText, getAnchorLocked, getAspectRatioLocked, getBehindText, and 124 additional methods. Public members are accessible to any Java application after installing the Aspose.Words FOSS for Java package. Properties: adjustments, allowOverlap, alternativeText, anchorLocked, aspectRatioLocked, behindText, and 77 more.

Properties

NameTypeAccessDescription
nodeTypeintReadReturns Shape.
storyTypeintReadGets the story type.
extrusionEnabledbooleanReadReturns true if an extrusion effect is enabled.
shadowEnabledbooleanReadReturns true if a shadow effect is enabled.
strokeStrokeReadDefines a stroke for a shape.
strokedbooleanRead/WriteDefines whether the path will be stroked.
strokeWeightdoubleRead/WriteDefines the brush thickness that strokes the path of a shape in points.
strokeColorColorRead/WriteDefines the color of a stroke.
filledbooleanRead/WriteDetermines whether the closed path of the shape will be filled.
fillColorColorRead/WriteDefines the brush color that fills the closed path of the shape.
imageDataImageDataReadProvides access to the image of the shape.
oleFormatOleFormatReadProvides access to the OLE data of a shape.
textBoxTextBoxReadDefines attributes that specify how text is displayed in a shape.
textPathTextPathReadDefines the text of the text path (of a WordArt object).
firstParagraphParagraphReadGets the first paragraph in the shape.
lastParagraphParagraphReadGets the last paragraph in the shape.
horizontalRuleFormatHorizontalRuleFormatReadProvides access to the properties of the horizontal rule shape.
adjustmentsAdjustmentCollectionReadProvides access to the adjustment raw values of a shape.
signatureLineSignatureLineReadGets SignatureLine object if the shape is a signature line.
chartChartReadProvides access to the chart properties if this shape has a Chart.
fillFillReadGets fill formatting for the shape.
shadowFormatShadowFormatReadGets shadow formatting for the shape.
glowGlowFormatReadGets glow formatting for the shape.
reflectionReflectionFormatReadGets reflection formatting for the shape.
softEdgeSoftEdgeFormatReadGets soft edge formatting for the shape.
screenTipStringRead/WriteDefines the text displayed when the mouse pointer moves over the shape.
hRefStringRead/WriteGets or sets the full hyperlink address for a shape.
targetStringRead/WriteGets or sets the target frame for the shape hyperlink.
alternativeTextStringRead/WriteDefines alternative text to be displayed instead of a graphic.
decorativebooleanRead/WriteGets or sets the flag that specifies whether the shape is decorative in the document.
titleStringRead/WriteGets or sets the title (caption) of the current shape object.
nameStringRead/WriteGets or sets the optional shape name.
insertRevisionbooleanReadGets the insert revision.
deleteRevisionbooleanReadGets the delete revision.
moveFromRevisionbooleanReadGets the move from revision.
moveToRevisionbooleanReadGets the move to revision.
topLevelbooleanReadReturns true if this shape is not a child of a group shape.
groupbooleanReadReturns true if this is a group shape.
imagebooleanReadReturns true if this shape is an image shape.
horizontalRulebooleanReadReturns true if this shape is a horizontal rule.
wordArtbooleanReadReturns true if this shape is a WordArt object.
anchorLockedbooleanRead/WriteSpecifies whether the shape’s anchor is locked.
aspectRatioLockedbooleanRead/WriteSpecifies whether the shape’s aspect ratio is locked.
allowOverlapbooleanRead/WriteGets or sets a value that specifies whether this shape can overlap other shapes.
behindTextbooleanRead/WriteSpecifies whether the shape is below or above text.
inlinebooleanReadA quick way to determine if this shape is positioned inline with text.
leftdoubleRead/WriteGets or sets the position of the left edge of the containing block of the shape.
topdoubleRead/WriteGets or sets the position of the top edge of the containing block of the shape.
rightdoubleReadGets the position of the right edge of the containing block of the shape.
bottomdoubleReadGets the position of the bottom edge of the containing block of the shape.
widthdoubleRead/WriteGets or sets the width of the containing block of the shape.
heightdoubleRead/WriteGets or sets the height of the containing block of the shape.
distanceTopdoubleRead/WriteReturns or sets the distance (in points) between the document text and the top edge of the shape.
distanceBottomdoubleRead/WriteReturns or sets the distance (in points) between the document text and the bottom edge of the shape.
distanceLeftdoubleRead/WriteReturns or sets the distance (in points) between the document text and the left edge of the shape.
distanceRightdoubleRead/WriteReturns or sets the distance (in points) between the document text and the right edge of the shape.
rotationdoubleRead/WriteDefines the angle (in degrees) that a shape is rotated.
zOrderintRead/WriteDetermines the display order of overlapping shapes.
parentParagraphParagraphReadReturns the immediate parent paragraph.
boundsjava.awt.geom.Rectangle2D.FloatRead/WriteGets or sets the bounds.
boundsInPointsjava.awt.geom.Rectangle2D.FloatReadGets the bounds in points.
boundsWithEffectsjava.awt.geom.Rectangle2D.FloatReadGets the bounds with effects.
shapeTypeintReadGets the shape type.
markupLanguagebyteReadGets MarkupLanguage used for this graphic object.
sizeInPointsjava.awt.geom.Point2D.FloatReadGets the size in points.
flipOrientationintRead/WriteSwitches the orientation of a shape.
relativeHorizontalPositionintRead/WriteSpecifies relative to what the shape is positioned horizontally.
relativeVerticalPositionintRead/WriteSpecifies relative to what the shape is positioned vertically.
relativeHorizontalSizeintRead/WriteGets or sets the value of shape’s relative size in horizontal direction.
relativeVerticalSizeintRead/WriteGets or sets the value of shape’s relative size in vertical direction.
leftRelativefloatRead/WriteGets or sets the value that represents shape’s relative left position in percent.
topRelativefloatRead/WriteGets or sets the value that represents shape’s relative top position in percent.
heightRelativefloatRead/WriteGets or sets the value that represents the percentage of shape’s relative height.
widthRelativefloatRead/WriteGets or sets the value that represents the percentage of shape’s relative width.
horizontalAlignmentintRead/WriteSpecifies how the shape is positioned horizontally.
verticalAlignmentintRead/WriteSpecifies how the shape is positioned vertically.
wrapTypeintRead/WriteDefines whether the shape is inline or floating.
wrapSideintRead/WriteSpecifies how the text is wrapped around the shape.
coordOriginjava.awt.PointRead/WriteGets or sets the coord origin.
coordSizejava.awt.DimensionRead/WriteGets or sets the coord size.
fontFontReadProvides access to the font formatting of this object.
layoutInCellbooleanRead/WriteGets or sets a flag indicating whether the shape is displayed inside a table or outside of it.
hiddenbooleanRead/WriteGets or sets a boolean value indicating whether the shape is visible.

Methods

SignatureDescription
Shape(doc: DocumentBase, shapeType: int)Creates a new shape object.
accept(visitor: DocumentVisitor) → booleanCalls accept(visitor) on this Shape instance.
acceptStart(visitor: DocumentVisitor) → intAccepts a visitor for visiting the start of the shape.
acceptEnd(visitor: DocumentVisitor) → intAccepts a visitor for visiting the end of the shape.
getNodeType() → intReturns Shape.
getStoryType() → intReturns the story type.
getExtrusionEnabled() → booleanReturns true if an extrusion effect is enabled.
getShadowEnabled() → booleanReturns true if a shadow effect is enabled.
getStroke() → StrokeDefines a stroke for a shape.
getStroked() → booleanDefines whether the path will be stroked.
setStroked(value: boolean)Sets the stroked value.
getStrokeWeight() → doubleDefines the brush thickness that strokes the path of a shape in points.
setStrokeWeight(value: double)Sets the stroke weight value.
getStrokeColor() → ColorDefines the color of a stroke.
setStrokeColor(value: Color)Sets the stroke color value.
getFilled() → booleanDetermines whether the closed path of the shape will be filled.
setFilled(value: boolean)Sets the filled value.
getFillColor() → ColorDefines the brush color that fills the closed path of the shape.
setFillColor(value: Color)Sets the fill color value.
hasImage() → booleanReturns true if the shape has image bytes or links an image.
getImageData() → ImageDataProvides access to the image of the shape.
getOleFormat() → OleFormatProvides access to the OLE data of a shape.
getTextBox() → TextBoxDefines attributes that specify how text is displayed in a shape.
getTextPath() → TextPathDefines the text of the text path (of a WordArt object).
getFirstParagraph() → ParagraphGets the first paragraph in the shape.
getLastParagraph() → ParagraphGets the last paragraph in the shape.
getHorizontalRuleFormat() → HorizontalRuleFormatProvides access to the properties of the horizontal rule shape.
getAdjustments() → AdjustmentCollectionProvides access to the adjustment raw values of a shape.
getSignatureLine() → SignatureLineGets SignatureLine object if the shape is a signature line.
hasChart() → booleanReturns true if this Shape has a Chart.
hasSmartArt() → booleanReturns true if this Shape has a SmartArt object.
getChart() → ChartProvides access to the chart properties if this shape has a Chart.
localToParent(value: java.awt.geom.Point2D.Float) → java.awt.geom.Point2D.FloatCalls localToParent(value) on this Shape instance.
getFill() → FillGets fill formatting for the shape.
getShadowFormat() → ShadowFormatGets shadow formatting for the shape.
getGlow() → GlowFormatGets glow formatting for the shape.
getReflection() → ReflectionFormatGets reflection formatting for the shape.
getSoftEdge() → SoftEdgeFormatGets soft edge formatting for the shape.
getScreenTip() → StringDefines the text displayed when the mouse pointer moves over the shape.
setScreenTip(value: String)Sets the screen tip value.
getHRef() → StringGets or sets the full hyperlink address for a shape.
setHRef(value: String)Sets the h ref value.
getTarget() → StringGets or sets the target frame for the shape hyperlink.
setTarget(value: String)Sets the target value.
getAlternativeText() → StringDefines alternative text to be displayed instead of a graphic.
setAlternativeText(value: String)Sets the alternative text value.
isDecorative() → booleanGets or sets the flag that specifies whether the shape is decorative in the document.
isDecorative(value: boolean)Calls isDecorative(value) on this Shape instance.
getTitle() → StringGets or sets the title (caption) of the current shape object.
setTitle(value: String)Sets the title value.
getName() → StringGets or sets the optional shape name.
setName(value: String)Sets the name value.
isInsertRevision() → booleanReturns true if insert revision is set.
isDeleteRevision() → booleanReturns true if delete revision is set.
isMoveFromRevision() → booleanReturns true if move from revision is set.
isMoveToRevision() → booleanReturns true if move to revision is set.
isTopLevel() → booleanReturns true if this shape is not a child of a group shape.
isGroup() → booleanReturns true if this is a group shape.
isImage() → booleanReturns true if this shape is an image shape.
isHorizontalRule() → booleanReturns true if this shape is a horizontal rule.
isWordArt() → booleanReturns true if this shape is a WordArt object.
canHaveImage() → booleanReturns true if the shape type allows the shape to have an image.
getAnchorLocked() → booleanSpecifies whether the shape’s anchor is locked.
setAnchorLocked(value: boolean)Sets the anchor locked value.
getAspectRatioLocked() → booleanSpecifies whether the shape’s aspect ratio is locked.
setAspectRatioLocked(value: boolean)Sets the aspect ratio locked value.
getAllowOverlap() → booleanGets or sets a value that specifies whether this shape can overlap other shapes.
setAllowOverlap(value: boolean)Sets the allow overlap value.
getBehindText() → booleanSpecifies whether the shape is below or above text.
setBehindText(value: boolean)Sets the behind text value.
isInline() → booleanA quick way to determine if this shape is positioned inline with text.
getLeft() → doubleGets or sets the position of the left edge of the containing block of the shape.
setLeft(value: double)Sets the left value.
getTop() → doubleGets or sets the position of the top edge of the containing block of the shape.
setTop(value: double)Sets the top value.
getRight() → doubleGets the position of the right edge of the containing block of the shape.
getBottom() → doubleGets the position of the bottom edge of the containing block of the shape.
getWidth() → doubleGets or sets the width of the containing block of the shape.
setWidth(value: double)Sets the width value.
getHeight() → doubleGets or sets the height of the containing block of the shape.
setHeight(value: double)Sets the height value.
getDistanceTop() → doubleReturns or sets the distance (in points) between the document text and the top edge of the shape.
setDistanceTop(value: double)Sets the distance top value.
getDistanceBottom() → doubleReturns or sets the distance (in points) between the document text and the bottom edge of the shape.
setDistanceBottom(value: double)Sets the distance bottom value.
getDistanceLeft() → doubleReturns or sets the distance (in points) between the document text and the left edge of the shape.
setDistanceLeft(value: double)Sets the distance left value.
getDistanceRight() → doubleReturns or sets the distance (in points) between the document text and the right edge of the shape.
setDistanceRight(value: double)Sets the distance right value.
getRotation() → doubleDefines the angle (in degrees) that a shape is rotated.
setRotation(value: double)Sets the rotation value.
getZOrder() → intDetermines the display order of overlapping shapes.
setZOrder(value: int)Sets the z order value.
getParentParagraph() → ParagraphReturns the immediate parent paragraph.
getBounds() → java.awt.geom.Rectangle2D.FloatReturns the bounds.
setBounds(value: java.awt.geom.Rectangle2D.Float)Sets the bounds value.
getBoundsInPoints() → java.awt.geom.Rectangle2D.FloatReturns the bounds in points.
getBoundsWithEffects() → java.awt.geom.Rectangle2D.FloatReturns the bounds with effects.
adjustWithEffects(source: java.awt.geom.Rectangle2D.Float) → java.awt.geom.Rectangle2D.FloatCalls adjustWithEffects(source) on this Shape instance.
getShapeType() → intGets the shape type.
getMarkupLanguage() → byteGets MarkupLanguage used for this graphic object.
getSizeInPoints() → java.awt.geom.Point2D.FloatReturns the size in points.
getFlipOrientation() → intSwitches the orientation of a shape.
setFlipOrientation(value: int)Sets the flip orientation value.
getRelativeHorizontalPosition() → intSpecifies relative to what the shape is positioned horizontally.
setRelativeHorizontalPosition(value: int)Sets the relative horizontal position value.
getRelativeVerticalPosition() → intSpecifies relative to what the shape is positioned vertically.
setRelativeVerticalPosition(value: int)Sets the relative vertical position value.
getRelativeHorizontalSize() → intGets or sets the value of shape’s relative size in horizontal direction.
setRelativeHorizontalSize(value: int)Sets the relative horizontal size value.
getRelativeVerticalSize() → intGets or sets the value of shape’s relative size in vertical direction.
setRelativeVerticalSize(value: int)Sets the relative vertical size value.
getLeftRelative() → floatGets or sets the value that represents shape’s relative left position in percent.
setLeftRelative(value: float)Sets the left relative value.
getTopRelative() → floatGets or sets the value that represents shape’s relative top position in percent.
setTopRelative(value: float)Sets the top relative value.
getHeightRelative() → floatGets or sets the value that represents the percentage of shape’s relative height.
setHeightRelative(value: float)Sets the height relative value.
getWidthRelative() → floatGets or sets the value that represents the percentage of shape’s relative width.
setWidthRelative(value: float)Sets the width relative value.
getHorizontalAlignment() → intSpecifies how the shape is positioned horizontally.
setHorizontalAlignment(value: int)Sets the horizontal alignment value.
getVerticalAlignment() → intSpecifies how the shape is positioned vertically.
setVerticalAlignment(value: int)Sets the vertical alignment value.
getWrapType() → intDefines whether the shape is inline or floating.
setWrapType(value: int)Sets the wrap type value.
getWrapSide() → intSpecifies how the text is wrapped around the shape.
setWrapSide(value: int)Sets the wrap side value.
getCoordOrigin() → java.awt.PointReturns the coord origin.
setCoordOrigin(value: java.awt.Point)Sets the coord origin value.
getCoordSize() → java.awt.DimensionReturns the coord size.
setCoordSize(value: java.awt.Dimension)Sets the coord size value.
getFont() → FontProvides access to the font formatting of this object.
isSignatureLine() → booleanIndicates that shape is a SignatureLine.
isLayoutInCell() → booleanGets or sets a flag indicating whether the shape is displayed inside a table or outside of it.
isLayoutInCell(value: boolean)Calls isLayoutInCell(value) on this Shape instance.
getHidden() → booleanGets or sets a boolean value indicating whether the shape is visible.
setHidden(value: boolean)Sets the hidden value.

See Also