Shape Attributes

syntax: attribute "=" value ";"

example:

shape main

{

       //Initialisation attributes - must be before drawing commands

       noshadow = "true";

       h_align = "center";

 

       //drawing commands

       rectangle(0,0,100,100);

       println("foo bar");

}

 

Attribute Name

Type

Description

bottomAnchorOffset

(int,int)

When creating a Shape Script for an embedded element (such as a Port), use this attribute to offset the shape from the bottom edge of its parent.

For example:

bottomAnchorOffset=(0,-10); move embedded element up 10 pixels from the bottom edge

dockable

string

Makes the shape default to dockable, so that it can be aligned with and joined to other elements (both other Shape Scripts and standard elements) on a diagram. You cannot reverse the dockable status with the Appearance menu option; to change the status, you must edit the Shape Script.

Valid values: standard or off

editableField

string

Defines a shape as an editable region of the element.

This field impacts element shapes only, line glyphs are not supported.

Valid Values: alias, name, note, stereotype

endPointY, endPointX

integer

Only used for the reserved target and source shapes for connectors; this point determines where the main connector line connects to the end shapes.

Default: 0 and 0

fixedAspectRatio

string

Set to true to fix the aspect ratio. Do not use if you do not want to fix the aspect ratio.

h_Align

string

Affects horizontal placement of printed text and subshapes depending on the layoutType attribute.

Valid values: left, center, or right

layoutType

string

Determines how subshapes are sized and positioned. See Subshape Layout for further details.

Valid values: leftright, topdown, border

leftAnchorOffset

(int,int)

When creating a Shape Script for an embedded element (such as a Port), use this attribute to offset the shape from the left edge of its parent.

For example:

leftAnchorOffset=(10,0); move embedded element right 10 pixels from the left edge

noShadow

string

Set to true to suppress the shapes shadow from being rendered.

Valid values: true or false (default= false)

orientation

string

Applies to decoration shapes only. Determines where the decoration is positioned within the containing element glyph.

Valid values: NW, N, NE, E, SE, S, SW, W

preferredHeight

 

Used by border layoutType - north and south

Used in drawing the source and target shapes for connectors to determine how wide the line is.

preferredWidth

 

Used by border layoutType - east and west.

Used by leftright layoutType, shapes where scalable is false to determine how much space they occupy for layout purposes.

rightAnchorOffset

(int,int)

When creating a Shape Script for an embedded element (such as a Port), use this attribute to offset the shape from the right edge of its parent.

For example:

rightAnchorOffset=(-10,0); move embedded element left 10 pixels from the right edge

rotatable

string

Set to false to prevent rotation of the shape. This attribute is only applicable to the source and target shapes for lines glyphs.

Valid values: true or false (default = true)

scalable

string

Set to false to stop the shape from being relatively sized to the associated diagram glyph.

Valid values: true or false (default= true)

topAnchorOffset

(int,int)

When creating a Shape Script for an embedded element (such as a Port), use this attribute to offset the shape from the top edge of its parent.

For example:

topAnchorOffset=(0,10); move embedded element down 10 pixels from the top edge

v_Align

string

Affects vertical placement of printed text and subshapes depending on the layoutType attribute.

Valid values: top, center, or bottom