DroidDiagram Programmer's Guide
DiagramItem Members
Constructors Fields Methods
 


The DiagramItem class represents an element in a diagram. It defines the basic drawing, interaction, undo/redo and serialization functionality for all the types of elements that can be contained in DroidDiagram documents.

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

 Public Constructors

  Name Description

DiagramItem

Overloaded. Initializes a new instance of the DiagramItem class.

 Protected Fields

  Name Description

brush

 

cycleDetected

 

cycleProtect

 

modifyDX

 

modifyDY

 

modifyHandle

 

modifying

 

pen

 

ptEnd

 

ptMdfLast

 

ptOrg

 

ptSavedEnd

 

ptSavedOrg

 

subordinateGroup

 

 Public Methods

  Name Description

clone

Creates a copy of this item.

containsPoint

Overloaded.  

getBounds

Gets the item bounds in logical document coordinates.

getBrush

Gets the brush used to fill the item's interior.

getEffectiveBrush

Gets the effective brush of the item.

getEffectiveFont

Gets the currently effective font of the item. This property returns getFont if it is not null, or a font with the DiagramItemStyle.getFontFamily, DiagramItemStyle.getFontSize, and DiagramItemStyle.getFontStyle properties of the item's style.

getEffectivePen

Gets the effective pen of the item.

getEffectiveShadowBrush

Creates a Brush object representing the currently effective shadow brush of the item. This method returns a system brush corresponding to the item's getShadowBrush if the item's getShadowBrush is not null, or a system brush corresponding to the DiagramItemStyle.getShadowBrush property of the item's style.

getEffectiveTextBrush

Gets the effective text brush of the item.

getFont

Gets the font used to draw the text of an item.

getHyperLink

Gets the hyperlink associated with an item.

getId

Gets user-defined identifier associated with this item.

getIgnoreLayout

Gets a value indicating whether an item should be ignored by the automatic layout algorithms.

getLayerIndex

Gets the zero-based index of the layer this item is associated with, or -1, if the item is not associated with any layer.

getLayoutTraits

Returns a hashtable containing properties specific to layout algorithms.

getLocked

Gets a value indicating whether users are allowed to modify an item.

getMasterGroup

Gets the hierarchical group in which this item is a subordinate.

getParent

Gets the diagram that contains this item.

getPen

Gets the pen used to draw the item frame lines.

getPrintable

Gets a value indicating whether an item will be printed.

getRuntimeIndex

For internal use.

getSelected

Gets a value indicating whether this item is selected.

getShadowBrush

Gets the brush used to paint the item's shadow.

getShadowOffsetX

Gets the horizontal distance between a shadow and the item that casts it.

getShadowOffsetY

Gets the vertical distance between a shadow and the item that casts it.

getStyle

Gets the style associated with the item.

getSubordinateGroup

Gets the group of subordinated items attached to this one.

getTag

Gets user-defined data assigned to an item.

getTextBrush

Gets the brush used to paint texts inside the item.

getTextPadding

Gets the spacing between the item boundaries and its text.

getToolTip

Gets the tooltip text displayed when the pointer rests over this item.

getVisible

Gets a value indicating whether an item is visible.

getWeight

Gets a weight value used in layout and path-finding algorithms.

getZIndex

Gets the position of an item within the diagram's Z-order.

hasSubordinates

Checks whether there are any nodes attached to this item.

hitTest

Returns the diagram item that contains the specified point.

hitTestHandle

Determines whether a selection handle of this item is located at the specified point.

query

Returns the items that can be reached from this item by following the path specified in the given query expression.

readExternal

Implements Externalizable.

setBrush

Sets the brush used to fill the item's interior.

setFont

Sets the font used to draw the text of an item.

setHyperLink

Sets the hyperlink associated with an item.

setId

Assigns user-defined identifier to this item.

setIgnoreLayout

Sets a value indicating whether an item should be ignored by the automatic layout algorithms.

setLayerIndex

Sets the zero-based index of the layer this item is associated with, or -1, if the item is not associated with any layer.

setLocked

Sets a value indicating whether users are allowed to modify an item.

setPen

Sets the pen used to draw the item frame lines.

setPrintable

Sets a value indicating whether an item will be printed.

setSelected

Selects or deselects an item.

setShadowBrush

Sets the brush used to paint the item's shadow.

setShadowOffsetX

Sets the horizontal distance between a shadow and the item that casts it.

setShadowOffsetY

Sets the vertical distance between a shadow and the item that casts it.

setStyle

Sets the style associated with the item.

setTag

Assigns user-defined data to an item. If the tag object is serializable, it will be automatically saved when serializing the diagram into binary format. When serializing to XML, you can save the tag by handling the DiagramListener.serializeTag event.

setTextBrush

Sets the brush used to paint texts inside the item.

setTextPadding

Sets the spacing between the item boundaries and its text.

setToolTip

Sets the tooltip text that should be displayed when the pointer rests over this item.

setVisible

Sets a value indicating whether an item is visible.

setWeight

Sets a weight value used in layout and path-finding algorithms.

setZIndex

Sets the position of an item within the diagram's Z-order.

writeExternal

Implements Externalizable.

zBottom

Moves an item to the bottom of the Z order.

zLevelDown

Moves an item down in the Z order.

zLevelUp

Moves an item up in the Z order.

zTop

Moves an item to the top of the Z order.

 Protected Methods

  Name Description

allowCreate

Invoked while the user draws this item to test whether the operation can be completed in the current context.

allowModify

Invoked during interactive modification of items to test whether the operation can be completed in the current context.

cancelModify

Invoked when the interactive modification of this item has been canceled.

completeCreate

Invoked when the user finishes drawing this item.

completeModify

Invoked when the item modification has been completed.

createProperties

Creates an item property set corresponding to the type of this diagram item. This method is invoked by the undo/redo subsystem when creating a ChangeItemCmd instance.

createState

Creates an item state corresponding to the type of this diagram item.

draw

Draws the item on the specified Canvas surface.

drawShadow

Draws the shadow of this diagram item.

getMeasureUnit

 

getRepaintRect

Gets the repaint region for this item, taking into account factors such as pen, selection handles and shadow.

getValue

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

loadFromXml

Loads the item content from an XML element.

onAdd

Called when an item is added to a Diagram, either by the user, programmatically or by undo / redo.

onChangeFont

 

onChangeTextPadding

 

onChildModified

Called when a group child node has been modified. Override this method if you need to know when a node from the SubordinateGroup is modified.

onClick

Invoked when the user clicks this item.

onDoubleClick

Invoked when the user double-clicks this item.

onLoad

Called when this item is loaded from a file.

onMeasureUnitChanged

Called when the diagram's MeasureUnit changes.

onRemove

Called when an item is removed from a Diagram, either by the user, programmatically or by undo / redo.

onStyleChanged

Invoked when the associated style or theme have changed.

onStyleFontChanged

Invoked when font property values of an associated style change.

putSelected

 

repaint

Overloaded.  

restoreProperties

Restores the properties of this diagram item. This method is invoked by the undo/redo subsystem when undoing or redoing a ChangeItemCmd instance.

restoreState

Restores the state of this diagram item.

saveProperties

Saves the properties of this diagram item. This method is invoked by the undo/redo subsystem when saving a ChangeItemCmd instance.

saveState

Saves the state of this diagram item.

saveToXml

Saves the item content into an XML element.

setDiagramDirty

Marks the diagram as changed.

shouldRender

Determines whether the item is rendered in the current context.

startCreate

Invoked once when the user starts drawing a new item interactively.

startModify

Invoked when the user starts modifying this item interactively.

updateCreate

Invoked during interactive creation of this item.

updateModify

Invoked during interactive modification of this item.

 See Also

DiagramItem Class
com.mindfusion.diagramming Namespace