Diagram

Return to Introduction  Previous page  Next page

public Class

A Diagram corresponds to a single Enterprise Architect diagram. It is accessed through the Package Diagrams collection and in turn contains a collection of diagram objects and diagram links. Adding to the DiagramObjects collection adds an element to the diagram (the element must already exist). When adding a new diagram, you must set the diagram type to a valid type; these are:

·Activity
·Analysis
·Component
·Custom
·Deployment
·Logical
·Sequence
·Statechart
·Use Case

Note: Use the Analysis type for a Collaboration Diagram.

Associated table in .EAP file: t_diagram

Diagram Attributes

Attribute

Type

Notes

DiagramObjects

Collection

Read only. A collection of references to DiagramObjects. A DiagramObject is an instance of an element in a diagram, and includes size and display characteristics.

DiagramLinks

Collection

Read only. A list of DiagramLink objects, each containing information about the display characteristics of a connector in a diagram.

Note: A Diagram link is only created once a user modifies a connector in a diagram in some way. Until this condition has been met default values are used and the diagram link is not in use.

DiagramID

Long

Read only. A local ID for the diagram.

PackageID

Long

Read/Write. An ID of the package that this diagram belongs to.

ParentID

Long

Read/Write. An optional ID of an element that 'owns' this diagram; eg. a Sequence diagram owned by a Use Case.

Type

String

Read only. The diagram type. See the t_diagramtypes table in the .EAP file for more information.

Name

String

Read/Write. The diagram name.

Version

String

Read/Write. The version of the diagram.

Author

String

Read/Write. The author.

ShowDetails

String

Read/Write. Flag to indicate Diagram Details text should be shown.

ShowPublic

Boolean

Read/Write. Flag to show or hide Public features.

ShowPrivate

Boolean

Read/Write. Flag to show or hide Private features.

ShowProtected

Boolean

Read/Write. Flag to show or hide Protected features.

Orientation

String

Read/Write. Page orientation: P for Portrait or L for Landscape.

cx

Long

Read/Write. The X dimension of the diagram (default is 800).

cy

Long

Read/Write. The Y dimension of the diagram (default is 1100).

Scale

Long

Read/Write. The zoom scale (default is 100).

CreatedDate

Date

Read/Write. The date the diagram was created.

ModifiedDate

Variant

Read/Write. The date the diagram was last modified.

HighlightImports

Boolean

Read/Write. Flag to indicate elements from other packages should be highlighted.

ShowPackageContents

Boolean

Read/Write. Flag to indicate package contents should be shown in the current diagram.

StyleEx

Long

Read/Write. Advanced style settings.

ExtendedStyle

String

Read/Write. An extended style attribute.

IsLocked

Boolean

Read/Write. Flag indicating whether this diagram is locked or not.

DiagramGUID

Variant

Read/Write. A globally unique ID for this diagram.

Swimlanes

String

Read/Write. Information on swimlanes contained in the diagram. Please note that this property is superseded by SwimlaneDef.

Notes

String

Read/Write. Set/retrieve notes for this diagram.

Stereotype

String

Read/Write. Sets or gets the stereotype for this diagram.

SelectedObjects

Collection

Read only. Gets a collection representing the currently selected elements on the diagram. Can remove objects from this collection to deselect them, and add elements to the collection by passing the Object ID as a name to select them.

ObjectType

ObjectType

Read only.  Distinguishes objects referenced through a Dispatch interface.

SelectedConnector

Connector

Read/Write. The currently selected connector on this diagram. Null if there is no currently selected diagram.

MetaType

String

Read only: The diagram's domain-specific meta type, as defined by an MDG Technology

SwimlaneDef

SwimlaneDef

Read/Write. Information on swimlanes contained in the diagram.

Diagram Methods

Method

Type

Notes

Update () 

Boolean 

Updates the current Diagram Object after modification or appending a new item. If false is returned, check the GetLastError function for more information.

GetLastError () 

String

Returns a string value describing the most recent error that occurred in relation to this object.

This function is rarely used since an exception is thrown when an error occurs.

ReorderMessages ()

void

Resets the display order of Sequence and Collaboration messages. Typically used after inserting or deleting messages in the diagram.