DroidDiagram Programmer's Guide
Diagram Members
Constructors Methods
 


The Diagram class represents a flow diagram.

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

 Public Constructors

  Name Description

Diagram

Initializes a new instance of the Diagram class.

 Public Methods

  Name Description

addDiagramListener

Registers listener so that it will receive events when users create, modify or delete diagram items.

alignPointToGrid

Aligns a point to the alignment grid.

arrangeLinkLabels

Rearranges link labels whose AutoArrange property is enabled.

changeUnit

Sets new MeasureUnit value and scales the coordinates of diagram items so that their absolute size remains unchanged.

clearAll

Deletes all items from the diagram.

copySelection

Creates a copy of the currently selected objects and groups.

createImage

Overloaded. Creates a bitmap image representing the diagram contents.

createItem

Implements the IItemFactory interface.

createStyledText

Creates a styled text object for the specified text string.

createThemeFromDefaults

Creates a Theme object representing the default properties of the diagram. This method is only for compatibility with files saved with versions earlier than 4.0.

destroyGroup

Destroys the specified group. The group items are not deleted, unless its setAutoDeleteItems method is calles.

draw

Renders the diagram on the specified Canvas object.

drawAlignmentGuides

Draws the current alignment guides.

drawLayer

Renders all items of a layer to the specified graphics.

drawString

 

drawStyledText

 

drawTextObject

 

executeCommand

Executes a command and saves it in the undo/redo history.

findGroup

Finds the group that has the specified tag.

findLink

Finds the link that has the specified tag.

findLinkById

Finds the link that has the specified id value.

findNode

Finds the node that has the specified tag.

findNodeById

Finds the node that has the specified id value.

getActiveItem

Gets the active item.

getActiveItemHandlesStyle

Gets the visual style of the manipulation handles displayed around the active item.

getActiveLayer

Gets the zero-based index of the active layer.

getAdjustmentHandlesSize

Gets the size of selection handles.

getAlignmentGuidePen

Gets the pen used to draw alignment guides.

getAlignToGrid

Gets a value indicating whether items are aligned to the alignment grid while users draw them.

getAllowLinksRepeat

Gets a value indicating whether users are allowed to draw more than one links between the same nodes.

getAllowMultipleResize

Gets whether multiple selected nodes can be resized simultaneously.

getAllowSelfLoops

Gets whether users are allowed to draw reflexive links.

getAllowSplitLinks

Gets whether link segments can be added and removed interactively.

getAllowUnanchoredLinks

Gets a value indicating whether users are allowed to attach links to nodes that do not have any anchor points.

getAllowUnconnectedLinks

Gets a value indicating whether users are allowed to draw unconnected links.

getAutoAlignDistance

Gets the maximal horizontal or vertical distance at which a node aligns to the borders of other nodes.

getAutoAlignNodes

Gets whether nodes should automatically align to the borders of other nodes during user interaction.

getAutoCloseDistance

Gets the maximum distance between first and last points of a FreeFormNode for which the node's outline is closed automatically.

getAutoResize

Gets a value specifying whether the document scrollable area is resized automatically when users draw items near the edges of the diagram.

getAutoSnapDistance

Specifies the maximum distance at which links auto-snap to nodes.

getAutoSnapLinks

Gets the default value for the AutoSnapToNode property of new links.

getBackBrush

Gets the diagram's background brush.

getBackgroundImage

Gets the background image.

getBackgroundImageAlign

Gets how the background image is positioned relatively to the scrollable area of the diagram.

getBackgroundImageUrl

Gets the URL of the background image.

getBounds

Gets the bounds of the scrollable area of the diagram.

getBoundsPen

Gets the pen with which the diagram bounds are drawn.

getCellFrameStyle

Gets the default style of the cell frames of new tables.

getClsidTable

Gets the table of registered item identifiers.

getContainerCaption

Gets the default value for the Caption attribute of containers.

getContainerCaptionHeight

Gets the default value for the CaptionHeight attribute of containers.

getContainerHighlightPen

Gets the default value for the HighlightPen attribute of containers.

getContainerMargin

Gets the default value for the Margin attribute of containers.

getContainerMinimumSize

Gets the default value for the MinimumSize attribute of containers.

getContainerNodeStyle

Gets the theme-level style for container nodes.

getContainersFoldable

Gets the default value for the Foldable attribute of containers.

getContentBounds

Returns the smallest rectangle that bounds all diagram items.

getCrossingRadius

Gets the radius of the shapes drawn at link crossing points.

getDefaultControlType

Gets the type of components that will be hosted by default in newly created ControlNode objects.

getDefaultShape

Gets the default shape of nodes.

getDiagramLinkStyle

Gets the theme-level style for diagram links.

getDiagramStyle

Gets the theme-level style for the diagram.

getDirty

Indicates whether the diagram has changed since the last save.

getDisabledHandlesStyle

Gets the visual style of disabled manipulation handles.

getDynamicLinks

Gets a value indicating whether links automatically update their end points positions so that they will always point towards the node centers.

getEffectiveBackBrush

Gets the currently effective background brush of the diagram. This property returns the BackBrush if it is not null, or the brush from the associated style or theme otherwise.

getEnableLanes

Gets whether lanes are enabled.

getEnableStyledText

Gets a value indicating whether new nodes display richly formatted text.

getExpandButtonAction

Gets what should happen when a user clicks the +/- button that is displayed near expandable nodes.

getExpandButtonPosition

Gets where expand/collapse buttons are located relatively to their nodes.

getExpandOnIncoming

Gets which direction of links is considered the tree direction when expanding or collapsing diagram branches.

getFactory

Gets a Factory instance that lets you add programmatically new items to the diagram.

getFoldedContainerSize

Gets the size of folded containers.

getFont

Gets the default font for new diagram items.

getFormatBeingLoaded

Returns the file format id of the file currently being loaded.

getFreeFormAttractDistance

Gets the radius around dragged free-form adjustment handle in which other points of FreeFormNode are modified too.

getFreeFormTargets

Gets an array of Shape objects used to replace FreeFormNode instances with ShapeNode ones when Behavior is set to LinkFreeShapes or DrawFreeShapes.

getGridColor

Gets the color of the alignment grid.

getGridOffsetX

Gets the horizontal offset of the first point of the alignment grid.

getGridOffsetY

Gets the vertical offset of the first point of the alignment grid.

getGridSizeX

Gets the horizontal distance between grid points.

getGridSizeY

Gets the vertical distance between grid points.

getGridStyle

Gets the appearance style of the alignment grid.

getGroups

Gets a collection of all groups in the diagram.

getHitTestPriority

Gets a value indicating the order in which items are hit-tested.

getImageDpiX

Specifies the default resolution of images.

getImageDpiY

 

getInteraction

Gets an InteractionState instance representing the current action being carried out by the user.

getItemAt

Overloaded.  

getItems

Gets a collection of all items in the diagram.

getLaneGrid

Gets the Grid instance that represents the lane grid.

getLayers

Gets a list of the layers in the current diagram.

getLinkAt

Overloaded.  

getLinkBaseShape

Gets the default shape displayed at the origin of new links.

getLinkBaseShapeSize

Gets the default size of the shape displayed at the origin of new links.

getLinkBrush

Gets the default brush assigned to new links.

getLinkCascadeOrientation

Gets the default orientation of the first segments of cascading links.

getLinkCrossings

Gets what shapes are drawn at link crossing points.

getLinkCustomDraw

Gets the default type of custom painting done on links.

getLinkEndsMovable

Gets a value indicating that users are allowed to move the end points of a link after the link is created.

getLinkHandlesStyle

Gets the default style of link selection handles.

getLinkHeadShape

Gets the default shape displayed as head of new links.

getLinkHeadShapeSize

Gets the default size of the shape displayed as arrowhead of new links.

getLinkIntermediateShape

Gets the default shape displayed at the middle of links segments.

getLinkIntermediateShapeSize

Gets the default size of the shape displayed at the middle of links segments.

getLinkPen

Gets the default pen assigned to new links.

getLinkRouter

Gets the component used to find paths for auto-routed links when diagram nodes are added or their positions change.

getLinks

Gets a collection of all links in the diagram.

getLinksAt

Returns the links that contain the specified point.

getLinkSegments

Gets the default number of link segments.

getLinkShape

Gets the default shape of links.

getLinksRetainForm

Gets a value indicating whether new links are set to maintain their shapes while the nodes they connect are moved around.

getLinkText

Gets the default text assigned to new links.

getLinkTextStyle

Gets the default placement and orientation of links' text.

getMeasureUnit

Gets the current unit of measure.

getMergeThreshold

Gets the maximum distance between adjacent control points of a link at which the respective segments can be merged.

getNearestNode

Returns the nearest node whose bounding rectangle is intersected by the circle, defined by origin point and radius.

getNodeAt

Overloaded.  

getNodeEffects

Gets a collection with all effects applied to the nodes of this diagram.

getNodes

Gets a collection of all nodes in the diagram.

getNodesAt

Returns the nodes that contain the specified point.

getNodesExpandable

Gets whether the tree branches that start from new nodes are expandable by default.

getRecursiveExpand

Gets whether tree branches are expanded recursively.

getRenderOptions

 

getRestrictItemsToBounds

Gets a value indicating whether users are allowed to move items outside the currently defined document bounds.

getRouteLinks

Gets a value indicating whether newly created links will automatically find their way between nodes.

getRoutingOptions

Gets a RoutingOptions instance that lets you set various attributes of the link routing algorithm.

getSelectAfterCreate

Gets a value indicating whether newly created items are selected automatically.

getSelectedItemHandlesStyle

Gets the visual style of the manipulation handles displayed around selected items.

getSelection

Gets a Selection instance representing the current selection.

getSelectionOnTop

Gets a value indicating whether selected items are drawn on top of the non-selected ones.

getShadowBrush

Gets .the default brush used to paint the shadows cast by diagram items.

getShadowOffsetX

Gets the default horizontal distance between shadows and the items that cast them.

getShadowOffsetY

Gets the default vertical distance between shadows and the items that cast them.

getShadowsStyle

Gets the style of shadows.

getShapeBrush

Gets the default brush assigned to new nodes.

getShapeCustomDraw

Gets whether new nodes should be custom drawn and what type of custom drawing will be performed on them.

getShapeHandlesStyle

Gets the default value for the HandlesStyle property of new shape nodes.

getShapeNodeStyle

Gets the theme-level style for shape nodes.

getShapeOrientation

Gets the default shape definition orientation angle assigned to new nodes.

getShapePen

Gets the default pen assigned to new nodes.

getShapeText

Gets the default text assigned to new nodes.

getShowAnchors

Gets a value indicating whether anchor points should be shown on screen.

getShowDisabledHandles

Gets whether disabled manipulation handles are displayed.

getShowGrid

Gets a value indicating whether the alignment grid is displayed.

getShowHandlesOnDrag

Gets whether selection handles of objects under the pointer are displayed while another object is being modified.

getSnapToAnchor

Gets a value indicating when links should snap to anchor points.

getStyle

Gets the style associated with the diagram.

getTableBrush

Gets the default brush assigned to new tables.

getTableCaption

Gets the default caption text assigned to new tables.

getTableCaptionHeight

Gets the default height of the caption area of new tables.

getTableColumnCount

Gets how many columns new tables have by default.

getTableColumnWidth

Gets the default width of the columns of new tables.

getTableConnectionStyle

Gets how users are allowed to link tables to each other - as integral entities, by rows, or both.

getTableHandlesStyle

Gets the default style of table selection handles.

getTableNodeStyle

Gets the theme-level style for table nodes.

getTablePen

Gets the default pen assigned to new tables.

getTableRowCount

Gets how many rows new tables have by default.

getTableRowHeight

Gets the default height of the row of new tables.

getTableShape

Gets the default value of the Shape property of new tables.

getTablesScrollable

Gets a value indicating whether users are allowed to scroll new tables.

getTag

Gets the custom data associated with this diagram.

getTextColor

Gets the default text color that is assigned to new items.

getTextFormat

Gets the default format and alignment of the text of new items.

getTheme

Gets the theme associated with the diagram.

getToolTip

Gets the tooltip text.

getTreeViewNodeStyle

Gets the theme-level style for tree view nodes.

getTypeTable

Gets the table of registered item types.

getUndoManager

Gets the diagram's UndoManager.

handlePointerMove

Propagates touch input to interested manipulators.

imageToDoc

Transforms points from the image coordinate space to the document coordinate space.

imageToDocX

Converts from image coordinates to document coordinates.

imageToDocY

Converts from image coordinates to document coordinates.

init

Returns a DiagramBuilder object used to configure this Diagram instance.

isItemInteractive

Checks if the specified item can be modified interactively.

isItemLocked

Checks if the specified item is locked.

isItemVisible

Checks if the specified item is currently visible.

items

Iterates over diagram items of the desired type

loadFromString

Loads the diagram contents from a string.

loadFromXml

Overloaded.  

measureString

Measures a text taking into consideration the current affine transform of the diagram.

pasteSelection

Adds the specified items and groups to the specified diagram document.

raiseActionRedone

Raises the actionRedone event.

raiseActionUndone

Raises the actionUndone event.

raiseCellTextEdited

Raises the DiagramListener.cellTextEdited event.

raiseCellTextEditing

Raises the cellTextEditing event to validate entering in-place editing mode.

raiseClicked

Overloaded.  

raiseDeleting

Raises the appropriate *Deleting (linkDeleting or nodeDeleting) event.

raiseDoubleClicked

Overloaded.  

raiseLinkTextEdited

Raises the DiagramListener.linkTextEdited event.

raiseLinkTextEditing

Raises the linkTextEditing event to validate entering in-place editing mode.

raiseNodeTextEdited

Raises the DiagramListener.nodeTextEdited event.

raiseNodeTextEditing

Raises the nodeTextEditing event to validate entering in-place editing mode.

raiseTreeCollapsed

Raises the treeCollapsed event.

raiseTreeExpanded

Raises the treeExpanded event.

raiseTreeItemTextEdited

Raises the DiagramListener.treeItemTextEdited event.

raiseViewRemoved

Raises the DiagramListener.viewRemoved event.

removeDiagramListener

Unregisters listener so that it will no longer receive diagram events.

repaint

Overloaded.  

resizeToFitItems

Overloaded.  

routeAllLinks

Routes all links in the diagram so that they will not cross any node.

saveTo

Overloaded.  

saveToString

Overloaded.  

saveToXml

Overloaded.  

setActiveItem

Sets the active item.

setActiveLayer

Sets the zero-based index of the active layer.

setAdjustmentHandlesSize

Sets the size of selection handles.

setAlignmentGuidePen

Sets the pen used to draw alignment guides.

setAlignToGrid

Sets a value indicating whether items should be aligned to the alignment grid while users draw them.

setAllowLinksRepeat

Sets a value indicating whether users are allowed to draw more than one links between the same nodes.

setAllowMultipleResize

Sets whether multiple selected nodes can be resized simultaneously.

setAllowSelfLoops

Sets whether users are allowed to draw reflexive links.

setAllowSplitLinks

Sets whether link segments can be added and removed interactively.

setAllowUnanchoredLinks

Sets a value indicating whether users are allowed to attach links to nodes that do not have any anchor points.

setAllowUnconnectedLinks

Sets a value indicating whether users are allowed to draw unconnected links.

setAutoAlignDistance

Sets the maximal horizontal or vertical distance at which a node aligns to the borders of other nodes.

setAutoAlignNodes

Sets whether nodes should automatically align to the borders of other nodes during user interaction.

setAutoCloseDistance

Sets the maximum distance between first and last points of a FreeFormNode for which the node's outline is closed automatically.

setAutoResize

Sets a value specifying whether the document scrollable area should be resized automatically when users draw items near the edges of the diagram.

setAutoSnapDistance

Specifies the maximum distance at which links auto-snap to nodes.

setAutoSnapLinks

Sets the default value for the AutoSnapToNode property of new links.

setBackBrush

Sets the diagram's background brush.

setBackgroundImage

Overloaded.  

setBackgroundImageAlign

Sets how the background image should be positioned relatively to the scrollable area of the diagram.

setBackgroundImageUrl

Sets the URL of the background image.

setBounds

Overloaded.  

setBoundsPen

Sets the pen with which document bounds are drawn.

setCellFrameStyle

Sets the default style of the cell frames of new tables.

setContainerCaption

Sets the default value for the caption of containers.

setContainerCaptionHeight

Sets the default value for the caption height of containers.

setContainerHighlightPen

Sets the default value for the HighlightPen of containers.

setContainerMargin

Sets the default value for the Margin attribute of containers.

setContainerMinimumSize

Sets the default value for the minimum size of containers.

setContainersFoldable

Sets the default value for the Foldable property of containers.

setCrossingRadius

Sets the radius of the shapes drawn at link crossing points.

setDefaultControlType

Sets the type of components that will be hosted by default in newly created ControlNode objects.

setDefaultShape

Sets the default shape that should be assigned to new nodes. The shape of individual nodes can be set by calling their ShapeNode.setShape method.

setDirty

Overloaded. Lets you set or clear the diagram's modification flag.

setDynamicLinks

Sets a value indicating whether links should automatically update their end points positions so that they will always point towards the node centers.

setEnableLanes

Sets whether lanes are enabled.

setEnableStyledText

Sets a value indicating whether newly created nodes should display richly formatted text.

setExpandButtonAction

Sets what should happen when a user clicks the +/- button that is displayed near expandable nodes.

setExpandButtonPosition

Sets where expand/collapse buttons are located relatively to their nodes.

setExpandOnIncoming

Sets which direction of links is considered the tree direction when expanding or collapsing diagram branches.

setFoldedContainerSize

Sets the size of folded containers.

setFont

Sets the default font for new diagram items.

setFreeFormAttractDistance

Sets the radius around dragged free-form adjustment handle in which other points of FreeFormNode are modified too.

setFreeFormTargets

Sets an array of Shape objects used to replace FreeFormNode instances with ShapeNode ones when Behavior is set to LinkFreeShapes or DrawFreeShapes.

setGridColor

Sets the color of the alignment grid.

setGridOffsetX

Sets the horizontal offset of the first point of the alignment grid.

setGridOffsetY

Sets the vertical offset of the first point of the alignment grid.

setGridSizeX

Sets the horizontal distance between grid points.

setGridSizeY

Sets the vertical distance between grid points.

setGridStyle

Sets the appearance style of the alignment grid.

setHitTestPriority

Sets a value indicating the order in which items are hit-tested.

setImageDpiX

Sets the default resolution of images.

setImageDpiY

 

setLinkBaseShape

Sets what shape should be displayed at the origin of new links.

setLinkBaseShapeSize

Sets the default size of the shape displayed at the origin of new links.

setLinkBrush

Sets the default brush that should be assigned to new links.

setLinkCascadeOrientation

Sets the default orientation of the first segments of cascading links.

setLinkCrossings

Sets what shapes should be drawn at the points where links cross.

setLinkCustomDraw

Sets the default type of custom painting done on links.

setLinkEndsMovable

Sets a value indicating users are allowed to move the end points of a link after the link is created.

setLinkHandlesStyle

Sets the style of selection handles that should be assigned to new links.

setLinkHeadShape

Sets what shape should be displayed as arrowhead of new links.

setLinkHeadShapeSize

Sets the default size of the shape displayed as arrowhead of new links.

setLinkIntermediateShape

Sets what shape should be displayed at the middle of links segments.

setLinkIntermediateShapeSize

Sets the default size of the shape displayed at the middle of links segments.

setLinkPen

Sets the default pen that should be assigned to new links.

setLinkRouter

Sets the component used to find paths for auto-routed links when diagram nodes are added or their positions change.

setLinkShape

Sets the style that should be assigned to new links.

setLinksRetainForm

Sets a value indicating whether new links are set to maintain their shapes while the nodes they connect are moved around.

setLinkText

Sets the default text that should be assigned to new links.

setLinkTextStyle

Sets the default placement and orientation of the links labels.

setMeasureUnit

Sets the units for measuring of lengths and sizes.

setMergeThreshold

Sets the maximum distance between adjacent control points of a link at which the respective segments can be merged.

setNodesExpandable

Sets whether the tree branches that start from new nodes should be expandable by default.

setRecursiveExpand

Sets whether tree branches should be expanded recursively.

setRestrictItemsToBounds

Sets a value indicating whether users are allowed to move items outside the currently define document bounds.

setRouteLinks

Sets a value indicating whether newly created links will automatically find their way between nodes.

setSelectAfterCreate

Sets a value indicating whether newly created items should be selected automatically.

setSelectionOnTop

Sets a value indicating whether selected items should be drawn on top of the non-selected ones.

setShadowBrush

Sets the default brush used to paint the shadows cast by diagram items.

setShadowOffset

Sets the distance at which shadows are offset from the items that cast them.

setShadowOffsetX

Sets the default horizontal distance between shadows and the items that cast them.

setShadowOffsetY

Sets the default vertical distance between shadows and the items that cast them.

setShadowsStyle

Sets the style of shadows.

setShapeBrush

Sets the default brush that should be assigned to new nodes.

setShapeCustomDraw

Sets whether new nodes should be custom drawn and what type of custom drawing will be performed on them.

setShapeHandlesStyle

Sets the default value for the HandlesStyle property of new shape nodes.

setShapeOrientation

Sets the default shape definition orientation angle assigned to new nodes.

setShapePen

Sets the default pen that should be assigned to new nodes.

setShapeText

Sets the default text to new nodes.

setShowAnchors

Sets a value indicating whether anchor points should be shown on screen.

setShowDisabledHandles

Sets whether disabled manipulation handles will be displayed.

setShowGrid

Sets a value indicating whether the alignment grid is displayed.

setShowHandlesOnDrag

Sets whether selection handles of objects under the pointer are displayed while another object is being modified.

setSnapToAnchor

Sets a value indicating when links should snap to anchor points.

setStyle

Sets the style associated with the diagram.

setTableBrush

Sets the default brush that is assigned to new tables.

setTableCaption

Sets the default caption text that should be assigned to new tables.

setTableCaptionHeight

Sets the default height of the caption area of new tables.

setTableColumnCount

Sets how many columns should be allocated to new tables.

setTableColumnWidth

Sets the default width of columns in newly created tables.

setTableConnectionStyle

Sets how users are allowed to link tables to each other - as integral entities, by rows, or both.

setTableHandlesStyle

Sets the style of selection handles that should be assigned to new tables.

setTablePen

Sets the default pen that should be assigned to new tables.

setTableRowCount

Sets how many rows should be allocated to new tables.

setTableRowHeight

Sets the default height of rows in newly created tables.

setTableShape

Sets the default value of the Shape property of new tables.

setTablesScrollable

Sets a value indicating whether users are allowed to scroll new tables.

setTag

Associates a custom data with this diagram.

setTextColor

Sets the default text color to be assigned to new items.

setTextFormat

Sets the default format and alignment of the text of new items.

setTheme

Sets the theme associated with the diagram.

setToolTip

Sets the tooltip text that is displayed when the pointer hovers over an unoccupied area of the diagram.

with

Returns a DiagramBuilder object used to configure and create new Diagram instances.

 Protected Methods

  Name Description

getValue

Gets the effective value of the style property with the specified name.

 See Also

Diagram Class
com.mindfusion.diagramming Namespace