DroidDiagram Programmer's Guide
Shape Members
Constructors Methods
 


A Shape object describes a shape consisting of a series of straight lines, arcs and Bezier curves. The main component of a shape definition is its outline, which describes the shape region that will be filled in color, and used for hit-testing and aligning links to the shape. A shape can also contain decorations - lines, arcs or Bezier curves that are drawn with the shape but do not influence the fill or hit testing.

A shape is used by applying it to a ShapeNode instance by calling the setShape method.

The following tables list the members exposed by the Shape type.

 Public Constructors

  Name Description

Shape

Overloaded.  

 Public Methods

  Name Description

draw

Draws this shape on the specified Canvas surface.

fromId

Returns the shape that has the specified identifier.

fromXmlElement

Creates a Shape from xml shape element

fromXmlElements

 

getAnchorPattern

Gets the anchor pattern to use for nodes using this shape, if their anchor pattern is set to null.

getDecorations

Gets a list of all decorations of this shape.

getDisplayName

 

getId

Returns the shape identifier.

getImage

Gets an image that is displayed by default in all instances of this shape.

getImageLocation

Get the image location. Will be null if the image was set with setImage, which does not provide location, or if there is no image.

getImageRectangle

Gets the location of the shape image relatively to the bounding rectangles of boxes of this shape.

getIsArrowhead

Gets a value indicating if this shape is used as arrowhead.

getLinkSegmentInset

Gets what length of link's line segment is drawn inside the arrowhead shape, expressed as percents of arrowhead size.

getOutline

Gets the outline of this shape.

getShapes

Returns a list of all shapes definitions.

getTextArea

Gets the outline of the text area of this shape.

initData

 

isEllipse

Gets a value indicating whether this shape is elliptic.

setAnchorPattern

Sets the anchor pattern to use for nodes using this shape, if their anchor pattern is set to null.

setDisplayName

 

setId

 

setImage

Sets an image that should be displayed by default in all instances of this shape.

setImageLocation

Accepted are absolute URLs, and relative paths with both back and forward slashes.

setImageRectangle

Sets the location of the shape image relatively to the bounding rectangles of boxes of this shape.

setLinkSegmentInset

Sets what length of link's line segment is drawn inside the arrowhead shape, expressed as percents of arrowhead size.

setTextArea

Sets the outline of the text area of this shape.

toDOM

 

toDOM

 

 See Also

Shape Class
com.mindfusion.diagramming Namespace