About PocketChart

PocketChart is a multi-function diagramming component for mobile devices. It is implemented as a .NET control and can be easily integrated with any application targeting the Microsoft .NET Compact Framework. By providing your software with ready to use capabilities for visualizing and editing relational data, PocketChart saves you from hundreds of hours of coding and debugging efforts.

PocketChart can give graphical representation to:

  • Workflow processes
  • Object hierarchies and relationships
  • Graphs and networks
  • Entity-relationship / database diagrams
  • IVR systems
  • Industrial automation plans
  • Genealogy trees
  • Algorithms and flowcharts
  • Organizational charts
  • XML documents
  • Classification hierarchies
  • And much more

PocketChart has been tested with the most popular .NET development environments and programming languages, and is used by companies from all around the world to create applications in C#, VB.NET and Delphi.NET.

Copyright (c) 2003-2006 MindFusion Ltd. Gibraltar


Features

The PocketChart component

Redistribution is royalty free

Assembly is strong-named

Is digitally signed

Can be purchased with source code

Is written in C#

User interaction

Several user interaction modes

Scrolling and zooming

Automatic scrolling while drawing objects with the stylus

Alignment to grid

Multiple selection

Docking points can be defined for nodes

Ruler control

Programming

Programmatic access to the diagram objects and selections

Numerous properties for customizing appearance and behavior

Numerous utility methods

Events fired for most end-user actions

Store and retrieve diagrams into/from XML documents

Diagram elements

87 predefined node shapes

Tables with unlimited number of rows and columns

Cells in tables can span several columns and rows

Sections of table rows can be expanded or collapsed

Arrows can comprise multiple segments

Arrow segments can be straight lines or curves

Automatic layout

Spring-Embedder graph layout

Directional tree layout

Radial tree layout

Layered graph layout

Grid layout

Appearance

Nodes can display images and text

Various text alignment styles

Customizable fonts and colors

Text can be laid-out in polygonal areas

Ability to define custom node shapes

Shadows

Z order

Invisible nodes

Behavior

Lock diagram elements

Read-only mode supported

Tables can be scrolled

Expand / collapse object hierarchies

Dynamic positioning of arrows relative to linked nodes

Linking via arrows

Nodes to nodes

Table rows to table rows

Nodes to table rows

Hierarchical grouping

Attaching nodes to other nodes

Attaching nodes to arrow control points

Attaching nodes to arrow segments

Copyright (c) 2003-2006 MindFusion Ltd. Gibraltar


What’s new in this release

The list below describes recent changes and additions to PocketChart:

New in version 2

Table enhancements

Setting a row as a Header defines a table section of consecutive rows that runs to the next header. Sections can be collapsed so only their header remains visible, or expanded back to show all their rows. Another new table-related feature allows creating spanning cells. Cells can span over several rows and columns as set in the new ColumnSpan and RowSpan properties.

Text layout

Now it is possible to specify the alignment of text displayed inside boxes using their TextFormat property. Text can be laid out in non-rectangular shape outlines by enabling PolyTextLayout. That works even for shapes that have curved outlines, the text layout algorithm approximates all curves with lines.

Ruler control

The Ruler control provides horizontal and vertical scales that helps users measure and align diagram items. In order to use a Ruler, customize the Visual Studio toolbox and add a reference to “PocketRulerDesigner.dll” in VS2003 or “PocketRuler.dll” in VS2005. To specify which FlowChart instance is shown in the ruler, set the Ruler.Document property.

Miscellaneous

· CaptionBackColor property added to the Table class.

· The GridLayout algorithm has been optimized.

· The new DocToClient method lets you convert from document to device coordinates.

· Use ExpandButtonPosition to select the position of expand/collapse buttons.


Getting Started


Visual Studio 2003

  1. Create a new project or open an existing one
  2. Open the Toolbox window
  3. Right-click a tab header and choose “Add/Remove Items…”
  4. Click the Browse button and navigate to the PocketChart installation folder
  5. Select the PocketChartDesigner.dll and click Open
  6. If you will use the Ruler control, click Browse and select the PocketRulerDesigner.dll
  7. Open the Solution Explorer
  8. Expand the project tree and right-click References
  9. Choose “Add Reference” and click “Browse…”
  10. Select the runtime assemblies PocketChart.dll and optionally PocketRuler.dll
  11. Select the FlowChart icon from the Toolbox and draw on the form
  12. Optionally, select the Ruler icon from the Toolbox and draw on the form
  13. If using a Ruler, set its Document property to the FlowChart instance
  14. Now you can set various FlowChart appearance properties and start coding


Visual Studio 2005

1. Create a new project or open an existing one

2. Open the Toolbox window

3. Right-click a tab header and select “Choose Items…”

4. Click the Browse button and navigate to the PocketChart installation directory

5. Open the “Assemblies for .NET 2” subdirectory

6. Select the PocketChart.dll and click Open

7. If you will use the Ruler control, click Browse and select the PocketRuler.dll

8. Select the FlowChart icon from the Toolbox and draw on the form

9. Optionally, select the Ruler icon from the Toolbox and draw on the form

10. If using a Ruler, set its Document property to the FlowChart instance

11. Now you can set various FlowChart appearance properties and start coding


User interaction

If your application allows users create and edit diagrams, the most important property that must be set is Behavior. It specifies what happens when a user draws with the stylus in the FlowChart canvas area. There are several interaction modes supported by that property, one of them lets users only select and modify items (Modify), other ones let users create new items. The latter include modes that allow creating and connecting Box nodes (FlowChart or CreateBox), or ones that create Table nodes (TableRelations or CreateTable).

You can define the size of the scrollable diagram area by setting the DocExtents property. Users can scroll the diagram using scrollbars, shown by enabling ShowScrollbars. The diagram can scroll automatically when an item is dragged towards the edge of the display if the AutoScroll property is enabled.

The Ruler control facilitates users in measuring and aligning objects. The alignment grid is useful for that purpose too, use the GridSize, SnapToGrid, and ShowGrid properties to set it up.

While users interact with the diagram, the following events could be raised to let you execute application specific code related to the users actions: ItemCreated, ItemModified and ItemDeleted. Methods that handle these events receive as an argument an Item instance that specifies what object has been acted upon. Use .NET reflection to determine the exact type of that object. Enable the AllowDeleteNodes property to specify that a Delete button should be displayed near nodes to let users delete them.

When a user creates new items, their properties are initialized with the values specified in the flowchart default values properties, such as BoxFillColor, TableLinkStyle, etc. Look at the FlowChart property list to find out more about default items properties.


Programming interface

The control provides many methods and properties that let you create or modify diagram items programmatically.

Use the CreateBox, CreateTable and CreateArrow methods to create diagram nodes and links. The DeleteItem method deletes an item from the diagram. Use methods such as GetNodeAt and GetArrowAt to find out what items are there at a specific location in the diagram.

The control lets you access all items in the diagram via the Items collection. The type-specific Boxes and Tables collections let you access diagram nodes. Arrows gives you access to all links. Each node exposes IncomingArrows and OutgoingArrows properties which let you know what links are coming into or going out from a node.

The location of nodes can be changed programmatically using the BoundingRect property or the Move and Resize methods. The shape of links can be changed via the Style and SegmentCount properties of the Arrow class.

The control provides several algorithms that automatically lay out the nodes and links in a diagram. They are implemented in the TreeLayout, LayeredLayout, GridLayout and SpringLayout classes. To use these classes, add a reference to the PocketChartLayout.dll to your project.


Class reference

PocketChart exposes rich programming interface that allows creating and modifying diagrams, customizing appearance of diagram items, and setting appearance and behavior options of the control.

When the control is placed on a form, an instance of the FlowChart class is created. That class represents a diagram, providing access to diagram items and exposing varios customization properties.

Diagram items are objects of classes that inherit the Item class. That class provides basic editing and visualization functionality, which is refined further in its descendants Node, Box, Table and Arrow.


FlowChart Class

A FlowChart instance represents a single diagram. FlowChart provides properties for access to diagram contents and exposes methods to programmatically construct and edit diagrams.

namespace MindFusion.Diagramming.Compact {

  public class FlowChart : Control

}

All diagram items are contained in the Items collection. Depending on its type, each item is additionally contained in one of the Boxes, Tables or Arrows collections.

Diagrams nodes can be created programmatically via the CreateBox and CreateTable methods. Nodes can be linked by calling CreateArrow. An existing item can be deleted via DeleteItem, or all items can be deleted at once via the Clear method.

Items that are selected either by end-users or programmatically are represented by the ActiveItem and Selection properties.

How users interact with PocketChart is controlled via the Behavior, SelectAfterCreate, SnapToAnchor and SnapToGrid properties. The size of the area in which users can draw is specified via DocExtents and RestrObjsToDoc. The Dirty property is set to true if the diagram has been modified since it was last saved.

Users can be prevented from certain operation by nabling or disabling the following properties: AllowDeleteNodes, AllowMoveArrowEnds, AllowLinksRepeat, AllowRefLinks and AllowSplitArrows.

Hit testing can be done by calling ClientToDoc method for getting document coordinates of the stylus position, and GetItemAt, GetNodeAt, etc. methods for getting items at a specified document position. If you need to determine what client coordinates correspond to a document point, call DocToClient.

Scrolling and zooming can be controlled programmatically via ScrollX, ScrollY, Zoom and AutoScroll properties. Scrollbars can be shown or hidden via ShowScrollbars.

FlowChart appearance properties include BackgroundImage and BezierQuality. Shadows can be drawn under items as specified via ShadowsStyle, ShadowColor, ShadowOffsetX and ShadowOffsetY properties.

If PocketChart is used for displaying trees, tree branches can be expanded or collapsed as specified via NodesExpandable, RecursiveExpand and ExpandOnIncoming properties.

The rest of the FlowChart properties provide default values used to initialize newly created diagram items, either when users draw them or when they are created programmatically.

Public Properties

ActiveItem | Gets a reference to the currently selected diagram item.
AllowDeleteNodes | Specifies whether users are allowed to delete items interactively.
AllowLinksRepeat | Specifies whether a pair of nodes can be linked more than once in the same direction.
AllowMoveArrowEnds | Specifies whether the end-points of an arrow can be moved interactively after the arrow has been created.
AllowRefLinks | Specifies whether users are allowed to create reflexive links.
AllowSplitArrows | Specifies whether users are allowed to split arrows into more segments.
ArrowBase | Specifies what shapes are displayed at arrows starting points.
ArrowBaseSize | Specifies the size of shapes displayed at arrows starting points.
ArrowColor | Gets or sets the color of arrow lines.
ArrowFillColor | Gets or sets the color used to fill in arrowhead shapes.
ArrowHead | Specifies what arrowhead shapes are displayed at arrows end-points.
ArrowHeadSize | Specifies the size of arrowhead shapes displayed at arrows end-points.
ArrowIntermSize | Specifies the size of arrowhead shapes displayed at the middle of arrows segments.
Arrows | Gets a collection of all arrows in the flowchart.
ArrowSegmentCount | Specifies how many segments new arrows should have.
ArrowStyle | Specifies the style of arrows.
AutoScroll | Enables or disables automatic scrolling of the drawing area.
BackgroundImage | Gets or sets an image to be displayed as flowchart background.
Behavior | Specifies how user actions with the stylus are to be interpreted.
BezierQuality | Gets or sets a quality factor for drawing Bezier curves.
Boxes | Gets a collection of all boxes in the flowchart.
BoxFillColor | Gets or sets the color used to fill box shapes.
BoxFrameColor | Gets or sets the color of box outlines.
CellFrameStyle | Specifies how the frame lines of table cells should be drawn.
DefaultShape | Gets or sets the default shape assigned to new boxes.
DelBtnPos | Gets or sets relative position of delete-buttons displayed for each item.
DemoVersion | Gets whether the instance of PocketChart is a trial version.
Dirty | A flag indicating whether the flowchart has changed.
DocExtents | Specifies the size of the drawing surface of the flowchart document.
DynamicArrows | Specifies whether arrows dynamically reposition to always point to node centers.
Enabled | Gets or sets a value indicating whether the control can respond to user interaction.
ExpandButtonPosition | Specifies where expand/collapse buttons are located relatively to their nodes.
ExpandOnIncoming | Specifies which arrow direction to follow when expanding or collapsing tree branches.
Font | The default font of new items.
GridColor | Gets or sets a value representing the color of grid points.
GridSize | Gets or sets the distance between adjacent grid points.
IntermArrowHead | Specifies what arrowhead shapes are displayed at the middle of arrow segments.
Items | Gets a collection of all items of the flowchart.
NodeHandlesStyle | Default value for the HandlesStyle property of new nodes.
NodesExpandable | Specifies whether tree branches can be expanded or collapsed.
PolyTextLayout | Enables or disables formatting of text inside non-rectangular box outlines.
PrpArrowStartOrnt | Specifies orientation of the initial segment of ‘perpendicular’-style arrows.
RecursiveExpand | Specifies whether trees of nodes are expanded recursively.
RestrObjsToDoc | Specifies whether items can be drawn or dragged outside the document bounds.
ScrollX | Gets or sets the horizontal scroll position.
ScrollY | Gets or sets the vertical scroll position.
SelectAfterCreate | Specifies whether items are selected automatically after they have been created.
Selection | Returns a Selection object that allows programmatic manipulation of item selection.
SelHandleSize | Gets or sets the size of selection handles.
ShadowColor | Gets or sets the color used to draw shadows.
ShadowOffsetX | Gets or sets the horizontal offset from items to their shadows.
ShadowOffsetY | Gets or sets the vertical offset from items to their shadows.
ShadowsStyle | Specifies how shadows are drawn.
ShapeOrientation | Provides default value for the ShapeOrientation property of boxes.
ShowGrid | Gets or sets a value indicating whether the grid points are visible.
ShowScrollbars | Shows or hides the scrollbars.
SnapToAnchor | Specifies when arrows are snapped to anchor points.
SnapToGrid | Enables or disables aligning items to grid.
TableCaption | Gets or sets default caption of tables.
TableCaptionBackColor | Gets or sets the default color used to fill table caption areas.
TableCaptionHeight | Gets or sets the height of table captions.
TableColCount | Gets or sets the number of columns of new tables.
TableColWidth | Gets or sets the width of table columns.
TableFillColor | Gets or sets the color used to fill in tables.
TableFrameColor | Gets or sets the color of table and cell frames.
TableLinkStyle | Specifies whether drawing an arrow between tables should link rows of those tables, or the tables as integral entities.
TableRowCount | Gets or sets the number of rows of new tables.
TableRowHeight | Gets or sets the height of table rows.
Tables | Gets a collection of all tables in the flowchart.
TablesScrollable | Specifies whether users can scroll tables.
TextColor | Gets or sets the color of items text.
Zoom | Specifies a scaling factor that should be applied to the view transformation..

Public Methods

AlignToGrid | Aligns a point to the grid.
Clear | Clears the flowchart contents.
ClientToDoc | Gets the document coordinates of a device point.
CreateArrow | Creates a new arrow.
CreateBox | Creates a new box.
CreateGroup | Creates a new hierarchical group.
CreateTable | Creates a new table.
DeleteItem | Deletes an item from the flowchart.
DocToClient | Transforms a point from the document coordinate space to the client coordinate space.
GetArrowAt | Returns the arrow at the specified position of the document.
GetBoxAt | Returns the box at the specified position of the document.
GetItemAt | Returns the item at the specified position of the document.
GetNodeAt | Returns the node at the specified position of the document.
GetTableAt | Returns the table at the specified position of the document.

Public Events

DocExtentsChanged | Raised when the document size changes.
ItemCollapsed | Occurs when a user collapses a tree branch.
ItemCreated | Occurs when a new item is drawn by users.
ItemDeleted | Occurs when an item is deleted.
ItemExpanded | Occurs when a user expands a tree branch.
ItemModified | Occurs when an item is moved or resized by users.
ScrollChanged | Raised when the ScrollX or SrollY value changes.
SelectionChanged | Raised when items are added to or removed from the selection.
ZoomChanged | Raised when the Zoom value changes.


FlowChart.ActiveItem Property

Gets a reference to the currently selected diagram item.

Item ActiveItem { get; }

Property Value

A reference to the Item that is currently active; null if there are no selected items.

Remarks

The active item is indicated with white selection handles. If there are multiple selected items, only one of them is considered the active. Usually that is the last selected item.

Your applications will usually associate some data with PocketChart items. Think of the active item as the one whose data users are interested in viewing or editing.

Examples

if (fcx.ActiveObject != null)

      ((Node)fcx.ActiveObject).Picture = fcx.BackgroundImage;

See also

Selection


FlowChart.AlignToGrid Method

Aligns a point to the grid.

Point AlignToGrid(Point pt)

Parameters

pt

A point in document coordinates to be aligned to the grid.

Return Value

The grid point that is nearest to pt.

Remarks

Use this method if you need to create items programmatically and want to get their coordinates aligned to grid.


FlowChart.AllowDeleteNodes Property

Specifies whether users are allowed to delete items interactively.

bool AllowDeleteNodes { get; set; }

Property Value

true if users are allowed to delete flowchart nodes; otherwise false. Default value is false.

Remarks

If this property is true, each node has an associated button that deletes the node when clicked.

See also

ShapeTemplate.DelBtnPos


FlowChart.AllowLinksRepeat Property

Specifies whether a pair of nodes can be linked more than once in the same direction.

bool AllowLinksRepeat { get; set; }

Property Value

true if users are allowed to link two nodes more than once in the same direction; otherwise false. Default value is false.

See also

AllowRefLinks


FlowChart.AllowMoveArrowEnds Property

Specifies whether the end-points of an arrow can be moved interactively after the arrow has been created.

bool AllowMoveArrowEnds { get; set; }

Property Value

true if users are allowed to move arrow end points; otherwise false. Default value is true.


FlowChart.AllowRefLinks Property

Specifies whether users are allowed to create reflexive links.

bool AllowRefLinks { get; set; }

Property Value

true if users are allowed to draw reflexive links; otherwise false. Default value is false.

See also

AllowLinksRepeat


FlowChart.AllowSplitArrows Property

Specifies whether users are allowed to split arrows into more segments.

bool AllowSplitArrows { get; set; }

Property Value

true if users are allowed to split arrow segments; otherwise false. Default value is false.

Remarks

A segment can be split by dragging any of its internal points.

Two segments can be combined into one by draging their jointing point such that the resulting angle defined by the points of the segments is near 180 degrees.

An arrow must be selected in order to split or combine its segments.


FlowChart.ArrowBase Property

Specifies what shapes are displayed at arrows starting points.

ArrowHead ArrowBase { get; set; }

Property Value

A member of the ArrowHead enumeration that specifies the shape to be displayed at arrows starting points. This value is assigned to the ArrowBase property of newly-created arrows. Default value is None.

See also

ArrowHead, IntermArrowHead


FlowChart.ArrowBaseSize Property

Specifies the size of shapes displayed at arrows starting points.

short ArrowBaseSize { get; set; }

Property Value

Size in pixels of the ArrowBase shape of arrows. This value is assigned to the ArrowBaseSize property of newly-created arrows. Default value is 10.


FlowChart.ArrowColor Property

Gets or sets the color of arrow lines.

Color ArrowColor { get; set; }

Property Value

A Color value that represents the color of arrow lines. This value is assigned to the Color property of newly-created arrows. Default value is Color.Black.


FlowChart.ArrowFillColor Property

Gets or sets the color used to fill in arrowhead shapes.

Color ArrowFillColor { get; set; }

Property Value

A Color value that represents the fill-color of arrowhead shapes. This value is assigned to the FillColor property of newly-created arrows. Default value is Color.FromArgb(120, 220, 255).


FlowChart.ArrowHead Property

Specifies what arrowhead shapes are displayed at arrows end-points.

ArrowHead ArrowHead { get; set; }

Property Value

A member of the ArrowHead enumeration that specifies the shape to be displayed at arrows end-points. This value is assigned to the ArrowHead property of newly-created arrows. Default value is Arrow.

See also

ArrowBase, IntermArrowHead


FlowChart.ArrowHeadSize Property

Specifies the size of arrowhead shapes displayed at arrows end-points.

short ArrowHeadSize { get; set; }

Property Value

Size in pixels of the ArrowHead shape of arrows. This value is assigned to the ArrowHeadSize property of newly-created arrows. Default value is 10.


FlowChart.ArrowIntermSize Property

Specifies the size of arrowhead shapes displayed at the middle of arrows segments.

short ArrowIntermSize { get; set; }

Property Value

Size in pixels of the IntermArrowHead shape of arrows. This value is assigned to the IntermHeadSize property of newly-created arrows. Default value is 10.


FlowChart.Arrows Property

Gets a collection of all arrows in the flowchart.

ItemCollection Arrows { get; }

Property Value

An ItemCollection instance representing all Arrow items in the flowchart.

See also

Items


FlowChart.ArrowSegmentCount Property

Specifies how many segments new arrows should have.

short ArrowSegmentCount { get; set; }

Property Value

Number of arrows’ segments. This value is assigned to the SegmentCount property of newly-created arrows. Default value is 1.

Remarks

If ArrowStyle is set to Bezier, each segment of arrows is a curve defined by four control points. Adjacent segments share a control point, so the dependancy between the number of control points and the number of segments is Np = 3*Ns + 1.

If ArrowStyle is set to Polyline or Cascading, each segment of arrows is a line defined by two control points. The dependancy between the number of control points and the number of segments is Np = Ns + 1.


FlowChart.ArrowStyle Property

Specifies the style of arrows.

ArrowStyle ArrowStyle { get; set; }

Property Value

A member of the ArrowStyle enumeration that specifies the style of arrows. This value is assigned to the Style property of newly-created arrows. Default value is Polyline.

Remarks

The table below describes the available arrow styles:

ArrowStyle member | Segment shape | Dependencies
Bezier | curve | Tangents in the jointing point of adjacent segments are always kept coinciding so that the curve goes smooth there.
Polyline | straight line |
Cascading | straight line | Segments have alternating vertical and horizontal orientation. If users move a control point, its adjacent points positions are updated to preserve segments orientation.


FlowChart.AutoScroll Property

Enables or disables automatic scrolling of the drawing area.

bool AutoScroll { get; set; }

Property Value

true if the drawing surface should automatically scroll if users draw outside the currently visible area; otherwise false. Default value is true.


FlowChart.BackgroundImage Property

Gets or sets an image to be displayed as flowchart background.

Image BackgroundImage { get; set; }

Property Value

An Image reference that represents the picture displayed as background of the drawing surface.


FlowChart.Behavior Property

Specifies how user actions with the stylus are to be interpreted.

BehaviorType Behavior { get; set; }

Property Value

A member of the BehaviorType enumeration that specifies how users input should be interpreted and handled by PocketChart. Default value is FlowChart.

Remarks

The property specifies what happens when users draw with the stylus in the document area or over existing items:

 | Over an object | In empty area of the document
Modify | Draws selection rectangle. | Draws selection rectangle.
CreateArrow | Creates an arrow. | Draws selection rectangle.
CreateBox | Creates a box. | Creates a box.
CreateTable | Creates a table. | Creates a table.
FlowChart | Creates an arrow. | Creates a box.
TableRelations | Creates an arrow. | Creates a table.


FlowChart.BezierQuality Property

Gets or sets a quality factor for drawing Bezier curves.

int BezierQuality { get; set; }

Property Value

An integer value that specifies the number of straight segments to use to approximate Bezier curves. Default value is 10.


FlowChart.Boxes Property

Gets a collection of all boxes in the flowchart.

ItemCollection Boxes { get; }

Property Value

An ItemCollection instance representing all Box items in the flowchart.

See also

Items


FlowChart.BoxFillColor Property

Gets or sets the color used to fill box shapes.

Color BoxFillColor { get; set; }

Property Value

A Color value that represents the fill-color of boxes. This value is assigned to the FillColor property of newly-created boxes. Default value is Color.Cornsilk.


FlowChart.BoxFrameColor Property

Gets or sets the color of box outlines.

Color BoxFrameColor { get; set; }

Property Value

A Color value that represents the color of box outlines. This value is assigned to the FrameColor property of newly-created boxes. Default value is Color.Black.


FlowChart.CellFrameStyle Property

Specifies how the frame lines of table cells should be drawn.

CellFrameStyle CellFrameStyle { get; set; }

Property Value

A member of the CellFrameStyle enumeration. The default value is CellFrameStyle.Simple.

Remarks

The value of this property is assigned to the CellFrameStyle property of new tables.

See also

TableFrameColor


FlowChart.Clear Method

Clears the flowchart contents.

void Clear()


FlowChart.ClientToDoc Method

Gets the document coordinates of a device point.

Point ClientToDoc(Point pt)

Parameters

pt

A point in device coordinates to be converted to document coordinates.

Return Value

A document point corresponding to the specified device point.

Remarks

You might use that method to get the position of the stylus (Control.MousePosition) in document coordinates. This might be useful in handlers of stylus or context-menu events when you need to find which object is pointed with the stylus.

Example

private void cmProps_Popup(object sender, System.EventArgs e)

{

      Point ptDev = fcx.PointToClient(Control.MousePosition);

      Point ptDoc = fcx.ClientToDoc(ptDev);

      currBox = fcx.GetBoxAt(ptDoc);

      miProps.Enabled = currBox != null;

}

See also

DocToClient


FlowChart.CreateArrow Method

Creates a new arrow.

Arrow CreateArrow(Node src, Node dest)

Arrow CreateArrow(Table src, int srcRow, Table dest, int destRow)

Arrow CreateArrow(Node src, Table dest, int destRow)

Arrow CreateArrow(Table src, int srcRow, Node dest)

Parameters

src

reference to a Box or a Table at which the new arrow starts.

dest

reference to a Box or a Table at which the new arrow ends.

srcRow

index of table’s row at which the arrow starts.

destRow

index of table’s row at which the arrow ends.

Return Value

A reference to the newly created arrow.

Remarks

If there are anchor points defined for the source or destination nodes, the arrow end points are docked to those points. Otherwise, the arrow ends lay on the intersections of the outlines of the nodes with the line connecting node centers.

See also

CreateBox, CreateTable


FlowChart.CreateBox Method

Creates a new box.

Box CreateBox(int x, int y, int width, int height)

Parameters

x

Horizontal position of the box.

y

Vertical position of the box.

width

Width of the box.

height

Height of the box.

Return Value

A reference to the newly created box.

See also

CreateArrow, CreateTable


FlowChart.CreateGroup Method

Creates a new hierarchical group.

Group CreateGroup(Item main)

Parameters

main

The main Item of the group.

Return Value

A reference to the newly created Group.


FlowChart.CreateTable Method

Creates a new table.

Table CreateTable(int x, int y, int width, int height)

Parameters

x

Horizontal position of the table.

y

Vertical position of the table.

width

Width of the table.

height

Height of the table.

Return Value

A reference to the newly created table.

See also

CreateArrow, CreateBox


FlowChart.DefaultShape Property

Gets or sets the default shape assigned to new boxes.

ShapeTemplate DefaultShape { get; set; }

Property Value

An instance of the ShapeTemplate class; default value is ShapeTemplate.FromId("Decision").

Remarks

The Shape property of newly created boxes is initialized with the value of this property. It defines a series of lines, arcs and curves composed in a complex shape.


FlowChart.DelBtnPos Property

Gets or sets relative position of delete-buttons displayed for each item.

Point DelBtnPos { get; set; }

Property Value

A Point value that specifies the position of ‘Delete’ buttons expressed as percent of items’ width and height.


FlowChart.DeleteItem Method

Deletes an item from the flowchart.

bool DeleteItem(Item obj)

Parameters

obj

A reference to the Item to be deleted.

Return Value

true if the item has been successfully deleted; otherwise false.

See also

AllowDeleteNodes


FlowChart.DemoVersion Property

Gets whether the instance of PocketChart is a trial version.

bool DemoVersion { get; }

Property Value

true if the loaded PocketChart instance is a trial version; otherwise false.


FlowChart.Dirty Property

A flag indicating whether the flowchart has changed.

bool Dirty { get; set; }

Property Value

true if the flowchart contents has changed since last save; otherwise false.


FlowChart.DocExtents Property

Specifies the size of the drawing surface of the flowchart document.

Rectangle DocExtents { get; set; }

Property Value

A Rectangle value that represents the bounds of the flowchart drawing area; measured in pixels.

Remarks

If the drawing area is larger than the bounding rectangle of the control, it can be scrolled via scrollbars. Automatic scrolling can be enabled to scroll the drawing area if users drag the stylus outside the PocketChart control bounds.


FlowChart.DocExtentsChanged Event

Raised when the document size changes.

event EventHandler DocExtentsChanged;


FlowChart.DocToClient Method

Transforms a point from the document coordinate space to the client coordinate space.

Point DocToClient(Point pt)

Parameters

pt

An instance of the .NET Point structure, whose coordinates should be transformed and returned.

Return Value

A Point instance which represents the client coordinates of docPt.

Remarks

This method is useful when the client (device) coordinates of a diagram location are needed. For example, it can be used to get the device point where a context menu should be displayed.

See also

ClientToDoc


FlowChart.DynamicArrows Property

Specifies whether arrows dynamically reposition to always point to node centers.

bool DynamicArrows { get; set; }

Property Value

true if arrows should always point to node centers; otherwise false. This value is assigned to the Dynamic property of newly-created arrows. Default value is false.


FlowChart.Enabled Property

Gets or sets a value indicating whether the control can respond to user interaction.

bool Enabled {get; set;}

Property Value

true if the control can respond to user interaction; otherwise, false. The default is true.


FlowChart.ExpandButtonPosition Property

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

ExpandButtonPosition ExpandButtonPosition { get; set; }

Property Value

A member of the ExpandButtonPosition enumeration. Default is OuterRight.

Remarks

If diagram links tend to flow vertically, it would be useful to have the expand/collapse buttons stay at the left- or right-hand side of nodes. If diagram links tend to flow horizontally, choose position for expand buttons such that they stay above or below nodes. That will prevent button icons from being overlapped by arrows.

See also

NodesExpandable


FlowChart.ExpandOnIncoming Property

Specifies which arrow direction to follow when expanding or collapsing tree branches.

bool ExpandOnIncoming { get; set; }

Property Value

true if the parent-to-child direction is opposite to that of the arrows; otherwise false. Default is false, i.e. child nodes are considered those linked to arrows destination end.

See also

NodesExpandable


FlowChart.Font Property

The default font of new items.

virtual Font Font {get; set;}

Property Value

The Font object to apply to the text displayed by flowchart items. This value is assigned to the Font property of newly created items.


FlowChart.GetArrowAt Method

Returns the arrow at the specified position of the document.

Arrow GetArrowAt(Point pt, int maxDist)

Arrow GetArrowAt(Point pt, int maxDist, bool exclLocked)

Arrow GetArrowAt(Point pt, int maxDist, bool exclLocked, ref int segmNum)

Parameters

pt

A document point at which to look for an arrow.

maxDist

The maximal distance from pt at which to look for arrows.

exclLocked

Specifies whether locked arrows are excluded from the search.

segmNum

An output parameter; refers to the segment of the found arrow, which is closest to pt.

Return Value

A reference to the Arrow closest to the specified point.

See also

GetItemAt


FlowChart.GetBoxAt Method

Returns the box at the specified position of the document.

Box GetBoxAt(Point pt)

Parameters

pt

A document point at which to look for a box.

Return Value

A reference to the Box that contains the specified point.

See also

GetItemAt, GetNodeAt


FlowChart.GetItemAt Method

Returns the item at the specified position of the document.

Item GetItemAt(Point pt, bool excludeLocked)

Parameters

pt

A document point at which to look for an item.

exclLocked

Specifies whether locked items are excluded from the search.

Return Value

A reference to the Item that contains the specified point.

See also

GetArrowAt, GetBoxAt, GetTableAt


FlowChart.GetNodeAt Method

Returns the node at the specified position of the document.

Node GetNodeAt(Point pt)

Parameters

pt

A document point at which to look for a node.

Return Value

A reference to the Node that contains the specified point.

See also

GetBoxAt, GetTableAt


FlowChart.GetTableAt Method

Returns the table at the specified position of the document.

Table GetTableAt(Point pt)

Parameters

pt

A document point at which to look for a table.

Return Value

A reference to the Table that contains the specified point.

See also

GetItemAt, GetNodeAt


FlowChart.GridColor Property

Gets or sets a value representing the color of grid points.

Color GridColor { get; set; }

Property Value

A Color value representing the color of grid points. The default value is Color.Gray.

See also

ShowGrid


FlowChart.GridSize Property

Gets or sets the distance between adjacent grid points.

int GridSize { get; set; }

Property Value

An integer value that specifies the distance between grid points, measured in pixels. The default value is 16.

See also

ShowGrid, SnapToGrid


FlowChart.IntermArrowHead Property

Specifies what arrowhead shapes are displayed at the middle of arrow segments.

ArrowHead IntermArrowHead { get; set; }

Property Value

A member of the ArrowHead enumeration that specifies the shape to be displayed at the middle of arrow segments. This value is assigned to the IntermArrowHead property of newly-created arrows. Default value is None.

See also

ArrowBase, ArrowHead


FlowChart.ItemCollapsed Event

Occurs when a user collapses a tree branch.

event DiagramEventHandler ItemCollapsed;

Parameters

args

Instance of the DiagramEventArgs class.

Remarks

If the Expandable property of a node is enabled, the node has an associated +/- button displayed beside it. Users can expand or collapse the tree branch that starts from the node using that button.


FlowChart.ItemCreated Event

Occurs when a new item is drawn by users.

event DiagramEventHandler ItemCreated;

Parameters

args

Instance of the DiagramEventArgs class.


FlowChart.ItemDeleted Event

Occurs when an item is deleted.

event DiagramEventHandler ItemDeleted;

Parameters

args

Instance of the DiagramEventArgs class.

Remarks

The event is not fired if an item is deleted programmatically, but only if users delete an item interactively. Users are allowed to delete diagram nodes if AllowDeleteNodes is set to true.


FlowChart.ItemExpanded Event

Occurs when a user expands a tree branch.

event DiagramEventHandler ItemExpanded;

Parameters

args

Instance of the DiagramEventArgs class.

Remarks

If the Expandable property of a node is enabled, the node has an associated +/- button displayed beside it. Users can expand or collapse the tree branch that starts from the node using that button.


FlowChart.ItemModified Event

Occurs when an item is moved or resized by users.

event DiagramEventHandler ItemModified;

Parameters

args

Instance of the DiagramEventArgs class.


FlowChart.Items Property

Gets a collection of all items of the flowchart.

ItemCollection Items { get; }

Property Value

An ItemCollection instance representing all items in the flowchart.

See also

Arrows, Boxes, Tables


FlowChart.NodeHandlesStyle Property

Default value for the HandlesStyle property of new nodes.

HandlesStyle NodeHandlesStyle { get; set; }

Property Value

A member of the HandlesStyle enumeration. Default value is SquareHandles.

Remarks

This property specifies the initial value of the HandlesStyle property of new nodes, created either programmatically or by the user. That property specifies how selected boxes are indicated visually, and how they can be moved, resized or linked to other objects.


FlowChart.NodesExpandable Property

Specifies whether tree branches can be expanded or collapsed.

bool NodesExpandable { get; set; }

Property Value

true if users are allowed to collapse/expand (sub)trees of nodes; otherwise false. This value is assigned to the Expandable property of new nodes. Default value is false.

Remarks

Small buttons are shown beside expandable nodes to allow users expand or collapse node (sub)trees.

See also

ExpandOnIncoming, ExpandButtonPosition


FlowChart.PrpArrowStartOrnt Property

Specifies orientation of the initial segment of ‘perpendicular’-style arrows.

Orientation PrpArrowStartOrnt { get; set; }

Property Value

A member of the Orientation enumeration. It defines whether the first segment of arrows, whose Style is set to Cascading, should be either horizontal or vertical, or its orientation should be automatically computed by PocketChart. Default value is Auto.


FlowChart.RecursiveExpand Property

Specifies whether trees of nodes are expanded recursively.

bool RecursiveExpand { get; set; }

Property Value

true if expanding a node should show the sub-nodes from all tree levels; false to show only the sub-nodes from the first level, i.e. the ones directly connected with the tree root. Default value is false.

See also

NodesExpandable


FlowChart.RestrObjsToDoc Property

Specifies whether items can be drawn or dragged outside the document bounds.

RestrictToDoc RestrObjsToDoc { get; set; }

Property Value

A member of the RestrictToDoc enumeration specifying whether users are allowed to draw or drag flowchart nodes outside of the document bounds. Default value is NoRestriction.


FlowChart.ScrollChanged Event

Raised when the ScrollX or SrollY value changes.

event EventHandler ScrollChanged;


FlowChart.ScrollX Property

Gets or sets the horizontal scroll position.

int ScrollX { get; set; }

Property Value

An integer value representing the horizontal scroll position.


FlowChart.ScrollY Property

Gets or sets the vertical scroll position.

int ScrollY { get; set; }

Property Value

An integer value representing the vertical scroll position.


FlowChart.SelectAfterCreate Property

Specifies whether items are selected automatically after they have been created.

bool SelectAfterCreate { get; set; }

Property Value

true to automatically select an item just after it has been created; otherwise false. Default value is true.

Remarks

In order to move or resize an item, users must select it first. Enable this property if you expect items to be modified immediately after they are created in your application.


FlowChart.Selection Property

Returns a Selection object that allows programmatic manipulation of item selection.

Selection Selection { get; }

Property Value

Reference to a Selection instance that represents the current selection of items.

See also

ActiveItem


FlowChart.SelectionChanged Event

Raised when items are added to or removed from the selection.

event EventHandler SelectionChanged;


FlowChart.SelHandleSize Property

Gets or sets the size of selection handles.

int SelHandleSize { get; set; }

Property Value

An integer value that specifies the size of selection handles or width of selection hatch frames. Default value is 8 pixels.


FlowChart.ShadowColor Property

Gets or sets the color used to draw shadows.

Color ShadowColor { get; set; }

Property Value

A Color value that represents the color of item shadows. Default is Color.Silver.

See also

ShadowsStyle, ShadowOffsetX, ShadowOffsetY


FlowChart.ShadowOffsetX Property

Gets or sets the horizontal offset from items to their shadows.

short ShadowOffsetX { get; set; }

Property Value

Horizontal offset from items to their shadows measured in pixels. This value is assigned to the ShadowOffsetX property of newly created items. Default value is 2.

See also

ShadowsStyle, ShadowOffsetY, ShadowColor


FlowChart.ShadowOffsetY Property

Gets or sets the vertical offset from items to their shadows.

short ShadowOffsetY { get; set; }

Property Value

Vertical offset from items to their shadows measured in pixels. This value is assigned to the ShadowOffsetY property of newly created items. Default value is 2.

See also

ShadowsStyle, ShadowOffsetX, ShadowColor


FlowChart.ShadowsStyle Property

Specifies how shadows are drawn.

ShadowsStyle ShadowsStyle { get; set; }

Property Value

A member of the ShadowsStyle enumeration that defines whether and how shadows are to be painted under items. Default value is OneLevel.

See also

ShadowOffsetX, ShadowOffsetY, ShadowColor


FlowChart.ShapeOrientation Property

Provides default value for the ShapeOrientation property of boxes.

int ShapeOrientation { get; set; }

Property Value

An integer value specifying an angle in degrees. The default value is 0.

Remarks

Possible values are 0, 90, 180 and 270. Use this property in conjunction with DefaultShape to define what shape will be assigned to new nodes that end-users draw.


FlowChart.ShowGrid Property

Gets or sets a value indicating whether the grid points are visible.

bool ShowGrid { get; set; }

Property Value

true if the grid points are visible; otherwise false. The default value is false.

See also

SnapToGrid, GridSize, GridColor


FlowChart.ShowScrollbars Property

Shows or hides the scrollbars.

bool ShowScrollbars { get; set; }

Property Value

true to display scrollbars; otherwise false.


FlowChart.SnapToAnchor Property

Specifies when arrows are snapped to anchor points.

SnapToAnchor SnapToAnchor { get; set; }

Property Value

A member of the SnapToAnchor enumeration that specifies when arrow ends will snap to anchor points. Default value is OnCreate.


FlowChart.SnapToGrid Property

Enables or disables aligning items to grid.

bool SnapToGrid { get; set; }

Property Value

true to align items to grid points; otherwise false. Default value is false.

See also

GridSize, ShowGrid


FlowChart.TableCaption Property

Gets or sets default caption of tables.

string TableCaption { get; set; }

Property Value

A string to be displayed in the caption area of tables. This value is assigned to the Caption property of newly created tables. Default value is “Table”.

See also

TableCaptionHeight


FlowChart.TableCaptionBackColor Property

Gets or sets the default color used to fill table caption areas.

Color TableCaptionBackColor { get; set; }

Property Value

The default value is Color.Empty.

Remarks

The value of this property is assigned to the CaptionBackColor property of new tables.


FlowChart.TableCaptionHeight Property

Gets or sets the height of table captions.

int TableCaptionHeight { get; set; }

Property Value

An integer value that specifies the height of tables’ caption area. This value is assigned to the CaptionHeight property of newly created tables. Default value is 22.

See also

TableCaption


FlowChart.TableColCount Property

Gets or sets the number of columns of new tables.

int TableColCount { get; set; }

Property Value

Specifies the number of table columns. This value is used as default number of columns of newly created tables. Default value is 2.


FlowChart.TableColWidth Property

Gets or sets the width of table columns.

int TableColWidth { get; set; }

Property Value

An integer value that specifies the width of table columns. This value is assigned to the ColumnWidth property of newly created tables. Default is 30 pixels.


FlowChart.TableFillColor Property

Gets or sets the color used to fill in tables.

Color TableFillColor { get; set; }

Property Value

A Color value that represent the color used to fill in tables and cells. This value is assigned to the FillColor property of newly created tables. Default is Color.FromArgb(180, 160, 160).


FlowChart.TableFrameColor Property

Gets or sets the color of table and cell frames.

Color TableFrameColor { get; set; }

Property Value

A Color value that represent the color of table and cell frame lines. This value is assigned to the FrameColor property of newly created tables. Default is Color.Black.


FlowChart.TableLinkStyle Property

Specifies whether drawing an arrow between tables should link rows of those tables, or the tables as integral entities.

TableLinkStyle TableLinkStyle { get; set; }

Property Value

A member of the TableLinkStyle enumeration. Default is TableLinkStyle.Rows.

Remarks

The value of TableLinkStyle is used to initialize the LinkStyle property of new tables. There are three possible ways to relate tables to other nodes. This property specifies how users are allowed to create such relations:

· tlsRows – relation ends are the rows of a table. An arrow connected to the table is linked to a particular row. This mode is convenient for database diagrams.

· tlsTable – relations target the table as a whole entity, and not any particular row. This mode is convenient for class diagrams.

· tlsBoth – a mixed mode where arrows can target either a row of the table or the table itself.

Programmatically, arrows can be linked to a table in any way, regardless of the LinkStyle. LinkStyle value is considered only when end-users draw arrows to or from a table. To link to a table as an entity and not to a specific row, pass –1 as row argument of the CreateArrow method.


FlowChart.TableRowCount Property

Gets or sets the number of rows of new tables.

int TableRowCount { get; set; }

Property Value

Specifies the number of table rows. This value is assigned as default number of rows of newly created tables. Default value is 4.


FlowChart.TableRowHeight Property

Gets or sets the height of table rows.

int TableRowHeight { get; set; }

Property Value

An integer value that specifies the height of table rows. This value is assigned to the RowHeight property of newly created tables. Default is 20 pixels.


FlowChart.Tables Property

Gets a collection of all tables in the flowchart.

ItemCollection Tables { get; }

Property Value

An ItemCollection instance representing all Table items in the flowchart.


FlowChart.TablesScrollable Property

Specifies whether users can scroll tables.

bool TablesScrollable { get; set; }

Property Value

true to allow users scroll table rows; otherwise false. This value is assigned to the Scrollable property of newly created tables.

Remarks

Arrow buttons appear in the caption bar of scrollable tables, allowing users to scroll rows up and down.


FlowChart.TextColor Property

Gets or sets the color of items text.

Color TextColor { get; set; }

Property Value

A Color value that represents the color of items’ text. This value is assigned to the TextColor property of newly created items. Default is Color.Black.


FlowChart.Zoom Property

Specifies a scaling factor that should be applied to the view transformation.

int Zoom { get; set; }

Property Value

An integer value that defines scaling transformation as percent of flowchart original size. Default is 100.


FlowChart.ZoomChanged Event

Raised when the Zoom value changes.

event EventHandler ZoomChanged;


Item Class

Item exposes properties and methods available for all kinds of diagram items. This class is inherited by Node, Box, Table and Arrow classes.

namespace MindFusion.Diagramming.Compact {

  public abstract class Item

}

Common appearance properties are Visible, Font, ShadowOffsetX and ShadowOffsetY. ZIndex controls whether an item appears below or above other items. Common color properties are TextColor and FillColor.

Items selected by end-users have their Selected property set to true. That property also allows selecting an item programmatically.

Users can be prevented from selecting or modifying an item by setting its Locked property. To prevent automatic layout routines from moving an item, set its IgnoreLayout property to true. Some layout methods use the Weight property of items to determine how the items should be placed relatively to other diagram elements.

The ContainsPoint and HitTestHandle methods can be used for hit testing.

The Tag property allows associating custom data with an item; it can refer to any object.

Nodes that were attached to an item via the AttachTo method can be accessed using the SubordinateGroup property and its members.


Item.ContainsPoint Method

Determines whether the item contains the specified point.

virtual bool ContainsPoint(Point pt)

Parameters

pt

A point specified in document coordinates.

Return Value

true if the item contains the specified point; otherwise false.


Item.FillColor Property

Gets or sets the color used to fill in the item.

Color FillColor { get; set; }

Property Value

A Color value that represents the color used to fill in nodes.

Remarks

Depending on the type of the item, the property is initialized with the value of the respective FlowChart default properties: ArrowFillColor, BoxFillColor or TableFillColor.

If the item is an arrow, FillColor is used to fill in the arrowhead.


Item.Font Property

Gets or sets the font of item’s text.

System.Drawing.Font Font { get; set; }

Property Value

Reference to a Font instance that specifies the name, size and attributes of the font used to draw item’s text. This property is initialized with the value of FlowChart.Font.


Item.HitTestHandle Method

Determines whether a selection handle lies at the specified point.

virtual int HitTestHandle(Point pt)

Parameters

pt

A point specified in document coordinates.

Return Value

Index of the selection handle that contains the specified point; -1 if there is no selection handle containing that point.


Item.IgnoreLayout Property

Specifies whether the position of a diagram item is changed by automatic layout methods.

bool IgnoreLayout { get; set; }

Property Value

true if the item must stay at its place nevertheless an automatic layout is performed; otherwise false. Default is false.

Remarks

Enable IgnoreLayout to specify that the Arrange methods of automatic layout classes should ignore an item. If enabled, the position of an item won’t be changed. This property applies to visible nodes. Invisible nodes are always ignored by automatic layout methods.

See also

Locked


Item.Locked Property

Specifies whether the item can be modified interactively by users.

bool Locked { get; set; }

Property Value

true to prevent users from selecting or modifying the item; otherwise false.


Item.Selected Property

Specifies whether the item is currently selected.

bool Selected { get; set; }

Property Value

A boolean value representing the item’s selection state. true if the item is selected; otherwise false.


Item.ShadowOffsetX Property

Gets or sets the horizontal offset from the item to its shadow.

short ShadowOffsetX { get; set; }

Property Value

Horizontal offset from the item to its shadow measured in pixels. The property is initialized with the value of FlowChart.ShadowOffsetX.


Item.ShadowOffsetY Property

Gets or sets the vertical offset from the item to its shadow.

short ShadowOffsetY { get; set; }

Property Value

Vertical offset from the item to its shadow measured in pixels. The property is initialized with the value of FlowChart.ShadowOffsetY.


Item.SubordinateGroup Property

Gets a reference to the group of objects that are attached to this one.

short SubordinateGroup { get; }

Property Value

Reference to a Group instance.

Remarks

Diagram items can be grouped hierarchically in such a manner that if an item is moved, all of its subordinate items in the hierarchy move too. The immediate subordinates of an item are contained and represented by a Group instance. The property provides access to the group of objects that are attached to this one. If there are no attached objects the property returns null.

See also

Node.MasterGroup, Node.AttachTo


Item.Tag Property

Gets or sets a custom value associated with the item.

object Tag { get; set; }

Property Value

An object of any type associated with this item.


Item.TextColor Property

Gets or sets the color of item’s text.

Color TextColor { get; set; }

Property Value

A Color value that represents the color of item’s text. The property is initialized with the value of FlowChart.TextColor.


Item.Visible Property

Hides or shows the item.

bool Visible { get; set; }

Property Value

true to display the item; otherwise false.


Item.Weight Property

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

float Weight { get; set; }

Property Value

The default value is 1.

Remarks

Currently Weight is used in the implementations of

  • The SpringLayout class: the weight of an arrow connecting two nodes is multiplied by the desired NodeDistance to determine the final distance between the nodes.

  • The PathFinder class: an override of the FindShortestPath method uses the Weight values of nodes and/or arrows to find the path with smallest total weight.


Item.ZIndex Property

Specified the index of the item in the Z-order.

int ZIndex { get; set; }

Property Value

An integer value specifying the position of the item in the Z-order. Items with smaller Z index appear behind items with bigger Z index.


Node Class

PocketChart diagram nodes are represented by descendants of the Node class. That class is inherited by Box and Table. Node contains properties and methods common for both node types.

namespace MindFusion.Diagramming.Compact {

  public abstract class Node : Item

}

The links between diagram nodes are represented by instances of the Arrow class. The arrows connected to a node can be accessed using the IncomingArrows and OutgoingArrows collections, depending on their direction.

Position and size of nodes can be set via the BoundingRect property or the Move and Resize methods.

Nodes can be attached to other diagram items and follow their movements automatically. This is done by invoking the AttachTo method. The item group to which a node is attached can be accessed via MasterGroup.

Common appearance properties are FrameColor, Picture, and HandlesStyle.

What modifications users are allowed to perform on a node is controlled via EnabledHandles. Where arrows can connect to a node is specified via AnchorPattern. Expanding/collapsing of tree branches is controlled via Expandable and Expanded properties.

Public Properties

AnchorPattern | Gets or sets the pattern of anchor points associated with the node.
BoundingRect | Gets or sets the position and size of the node.
EnabledHandles | Specifies the kinds of modifications that end-users are permitted to perform on a node.
Expandable | Specifies whether the (sub)tree starting from the node can be expanded or collapsed.
Expanded | Expands or collapses the (sub)tree starting from the node.
FrameColor | Gets or sets the color of the node’s frame or outline.
HandlesStyle | Specifies how node selection handles behave and what they look like.
IncomingArrows | Gets the collection of arrows coming into this node.
MasterGroup | Gets a reference to the group to which the object is attached.
OutgoingArrows | Returns the collection of arrows that start from this node.
Picture | Gets or sets an image displayed as node’s background.

Public Methods

AttachTo | Attaches a node to another diagram item.
Detach | Removes the node from its master group.
Move | Moves the node to a new position.
Resize | Resizes the node.


Node.AnchorPattern Property

Gets or sets the pattern of anchor points associated with the node.

AnchorPattern AnchorPattern { get; set; }

Property Value

Reference to an AnchorPattern instance representing the set of anchor points through which arrows can be linked to the node. Default value is null – no anchor points are defined and arrows can be linked to any point of the node.


Node.AttachTo Method

Attaches a node to another diagram item.

void AttachTo(Arrow arrow, AttachToArrow attType, int index)

void AttachTo(Node node, AttachToNode attType)

void AttachTo(Node node,

  int percentX1, int percentY1, int percentX2, int percentY2)

Parameters

arrow

An arrow to whose control point or segment to attach this node.

attType

In the first override, specifies whether to attach the node to a segment or to a control point of the arrow.

In the second override, specifies to which corner of a node to attach this node.

index

An index of arrow’s control point or segment, depending on the attType value.

node

A node to whose corner to attach this node.

percentX1

Left-hand side coordinate of the node, expressed as percent of main node’s width.

percentY1

Top side coordinate of the node, expressed as percent of main node’s height.

percentX2

Right-hand side coordinate of the node, expressed as percent of main node’s width.

percentY2

Bottom side coordinate of the node, expressed as percent of main node’s height.

Remarks

This method attaches a node to another item, so that the node is moved or resized automatically to maintain its position relative to the master item. For example, this allows a node to be used as a text label or a picture-holder attached to another node.

If there isn’t a Group instance already associated with the master item, one is created automatically by this method. The group is then accessible via the master’s SubordinateGroup property, or this node’s MasterGroup property. The node is attached by calling the appropriate Group methods:

  • The first AttachTo override invokes the AttachToArrowPoint or AttachToArrowSegment methods of Group, depending on the value of the attType argument. The attached node maintains its original offset from an arrow’s point or segment when arrow’s shape changes.

  • The second override corresponds to the AttachToCorner method. The attached node maintains its original offset from another node’s corner point.

  • The last override corresponds to the AttachProportional method. The attached node maintains its size and position so that it always covers the specified rectangular area of the master node.

See also

Detach


Node.BoundingRect Property

Gets or sets the position and size of the node.

virtual Rectangle BoundingRect { get; set; }

Property Value

A Rectangle value that represents position and size of the node measured in pixels.


Node.Detach Method

Removes the node from its master group.

void Detach()

See also

AttachTo


Node.EnabledHandles Property

Specifies the kinds of modifications that end-users are permitted to perform on a node.

Handles EnabledHandles { get; set; }

Property Value

A combination of the Handles enumeration members. The default value is Handles.All.

Remarks

Disabling some selection handles allows restricting the types of modifications that users can perform on a node. Each manipulation handle can be enabled or disabled by setting or clearing the respective flag in the combination. For example, to make a node resizable only horizontally set this property to a combination of the Move, ResizeMiddleLeft and ResizeMiddleRight flags. That will disable all manipulation handles, except the left and right ones, which allow horizontal resizing, and the central one allowing movement of the node.

See also

HandlesStyle


Node.Expandable Property

Specifies whether the (sub)tree starting from the node can be expanded or collapsed.

bool Expandable { get; set; }

Property Value

true if users are allowed to collapse/expand the (sub)tree of nodes starting from this one; otherwise false. The property is initialized with the value of FlowChart.NodesExpandable.

Remarks

When a user expands a tree branch, the ItemExpanded event is raised. If a user collapses a tree branch, the ItemCollapsed event is raised.

See also

Expanded


Node.Expanded Property

Expands or collapses the (sub)tree starting from the node.

bool Expanded { get; set; }

Property Value

true if the (sub)tree of nodes starting from this one is expanded, i.e. all sub-nodes are visible; false if the (sub)tree is collapsed.

See also

Expandable


Node.FrameColor Property

Gets or sets the color of the node’s frame or outline.

Color FrameColor { get; set; }

Property Value

A Color value that represents the color of node outlines.


Node.HandlesStyle Property

Specifies how node selection handles behave and what they look like.

HandlesStyle HandlesStyle { get; set; }

Property Value

A member of the HandlesStyle enumeration. Initialized with the value of NodeHandlesStyle.

Remarks

The value of this property specifies how node selection status is indicated visually. In addition, this property defines how manipulation of the box can be done, i.e. how to move it, resize it or link it to other nodes. You can assign any of the HandlesStyle members to this property.


Node.IncomingArrows Property

Gets the collection of arrows coming into this node.

ItemCollection IncomingArrows { get; }

Property Value

An ItemCollection instance representing the Arrow items whose destination is this node.

See also

OutgoingArrows


Node.MasterGroup Property

Gets a reference to the group to which the object is attached.

Group MasterGroup { get; }

Property Value

Reference to a Group instance.

Remarks

Diagram objects can be grouped hierarchically in such a manner, that if an object is moved all of its subordinated objects in the hierarchy move too. The immediate subordinates of an object are contained and represented by a Group instance. This property provides access to the group that contains the object as a subordinate. If the object is not subordinated to another, the property returns null.

See also

AttachTo, Item.SubordinateGroup


Node.Move Method

Moves the node to a new position.

void Move(int x, int y)

Parameters

x

New x coordinate of the node’s top left point.

y

New y coordinate of the node’s top left point.

See also

Resize


Node.OutgoingArrows Property

Returns the collection of arrows that start from this node.

ItemCollection OutgoingArrows { get; }

Property Value

An ItemCollection instance representing the Arrow items whose origin is this node.

See also

IncomingArrows


Node.Picture Property

Gets or sets an image displayed as node’s background.

Image Picture { get; set; }

Property Value

Reference to an Image to be displayed as node’s background.


Node.Resize Method

Resizes the node.

void Resize(int width, int height)

Parameters

width

New width of the node, measured in pixels.

height

New height of the node, measured in pixels.

See also

Move


Box Class

The Box class represents diagram nodes that can have arbitrary shapes.

namespace MindFusion.Diagramming.Compact {

  public class Box : Node

}

The members of Box are described below. More properties and methods are define in its base class Node.

The shape of a box is specified via the Shape property, which assigns a ShapeTemplate definition to the box. It lets you use one of the 87 predefined shapes or define a custom one. The ShapeOrientation property specifies an angle at which the points in shape definition are rotated when applying it to a box.

Text inside a box is represented by the Text property. Its attributes can be changed via the TextColor and TextFormat properties. Text can be laid out inside arbitrary polygonal shapes by enabling PolyTextLayout.

Arrows that are linked to a box can be enumerated through the IncomingArrows and OutgoingArrows collections defined in the Node class.

Public Properties

PolyTextLayout | Enables or disables the formatting of box’ Text inside non-rectangular outline.
Shape | Gets or sets the shape of the box.
ShapeOrientation | Gets or sets an angle at which a shape definition is transformed when applying it to the box.
Text | Gets or sets the text displayed in this box.
TextFormat | Gets or sets the alignment of the text that is displayed inside boxes.


Box.PolyTextLayout Property

Enables or disables the formatting of box’ Text inside non-rectangular outline.

bool PolyTextLayout { get; set; }

Property Value

true to enable polygonal text formatting; false to disable it.

Remarks

This property is useful for boxes of non-rectangular shape. The formatting algorithm is designed to layout text inside polygonal outlines. A polygonal approximation is created for outlines that have curved segments, so text can be laid out in shapes that consist of Bezier curves too.

See also

Shape


Box.Shape Property

Gets or sets the shape of the box.

ShapeTemplate Shape { get; set; }

Property Value

Reference to a ShapeTemplate instance that defines the shape of the box. Initialized with the value of FlowChart.DefaultShape.

Remarks

Rotation transformation can be applied to a shape definition via the ShapeOrientation property. The rotation applies to all elements of the shape definition – outline, decorations, text rectangle and image position.

Example

      Box start = fcx.CreateBox(10, 10, 40, 30);

      start.Shape = ShapeTemplate.FromId("Ellipse");

      start.Text = "Start";

      start.TextColor = Color.Green;

See also

ShapeTemplate.FromId


Box.ShapeOrientation Property

Gets or sets an angle at which a shape definition is transformed when applying it to the box.

int ShapeOrientation { get; set; }

Property Value

An integer value specifying an angle in degrees. Initialized with the value of FlowChart.ShapeOrientation.

Remarks

This property does not rotate the box, i.e. does not rotate the bounding rectangle of the box around its center. It specifies a rotation transformation to be performed on the definition of the Shape when it is applied to a box; the box’ bounding rectangle /location, width and height/ remain intact. In the current PocketChart version, only 0, 90, 180 or 270 can be set as values of ShapeOrientation.


Box.Text Property

Gets or sets the text displayed in this box.

string Text { get; set; }

Property Value

The text caption displayed in the box.

See also

Item.TextColor, PolyTextLayout


Box.TextFormat Property

Gets or sets the alignment of the Text displayed inside boxes.

TextFormat TextFormat { get; set; }

Property Value

An instance of the TextFormat class. The default value specified top-left alignment.

See also

Item.TextColor, PolyTextLayout


Table Class

Table instances can represent tables in database diagrams, entities in ER diagrams, classes in class hierarchies, etc.

namespace MindFusion.Diagramming.Compact {

  public class Table : Node

}

The members of Table are described below. More properties and methods are define in its base class Node.

Tables consist of Cell instances distributed across rows and columns. Number of rows and columns can be set using the Count property of the Rows and Columns collections. The width of the columns is set with ColumnWidth property and the height of the rows with the RowHeight property. Individual cells can be accessed via the cell indexer. Cells can be made to span several rows and columns by setting their RowSpan and ColumnSpan properties to values larger than 1.

Probably the most important property of tables is LinkStyle, which specifies whether users are allowed to draw arrows to the rows of a table, to the table as an integral entity, or both. Each row exposes IncomingArrows and OutgoingArrows collections, and depending on the LinkStyle value, the respective arrows collections inherited from Node might be used too. Where arrows can connect to table rows is specified via the table’s RowAnchorPattern and the AnchorPattern property of rows.

Rows can be assigned to distinct sections of the table. Each section can be collapsed or expanded, hiding or showing all rows in the section except the header one. To define a section, set a Header row. A section consists of all rows after a header row and spans to the next header. Each header row displays a +/- button that allows expanding or collapsing the section interactively. The button appears either on the left of the first cell of a header row or in a separate column, as set in OffsetHeaderRows. Sections can be collapsed or expanded programmatically using the Expanded property of their header rows.

The structure of a table can be dynamically changed by adding and deleting rows and columns. This can be done with the help of the RedimTable method, as well as with the AddRow, AddColumn, InsertRow, InsertColumn, DeleteRow and DeleteColumn methods.

Tables have a caption text, which is set via the Caption property. The height of the caption area is specified via CaptionHeight. The caption area is filled using the color set in CaptionBackColor. Default cell appearance can be set via ColumnWidth, RowHeight and CellFrameStyle.

Table rows can be scrolled up and down; properties related to that are Scrollable and TopRow.

Public Properties

Caption | Gets or sets the table’s caption text.
CaptionBackColor | Gets or sets the color used to fill the caption area of this table.
CaptionColor | Gets or sets the color of table’s caption text.
CaptionHeight | Gets or sets the height of table’s caption bar.
Cell Indexer | Gets a reference to table’s cell.
CellFrameStyle | Specifies how the frame lines of table cells should be drawn.
Columns | Gets the collection of table’s columns.
ColumnWidth | Gets or sets the width of table’s columns.
LinkStyle | Specifies whether drawing an arrow from/to a table, should link a row of that table, or the whole table as an integral entity.
OffsetHeaderRows | Specifies whether the table cells are offset to the right to accommodate for the expand buttons of Header rows.
RowAnchorPattern | Gets or sets the pattern of anchor points associated with table’s rows.
RowHeight | Gets or sets the height of table’s rows.
Rows | Gets the collection of table’s rows.
Scrollable | Specifies whether users are allowed to scroll the table’s rows.
TopRow | Gets or sets the table’s top scroll row.

Public Methods

AddColumn | Appends new column to the table.
AddRow | Appends new row to the table.
DeleteColumn | Deletes a column.
DeleteRow | Deletes a row.
InsertColumn | Inserts a new column at the specified position.
InsertRow | Inserts a new row at the specified position.
RedimTable | Changes the table dimensions, i.e. the number of rows and columns.


Table.AddColumn Method

Appends new column to the table.

int AddColumn()

Return Value

An integer index of the newly created column.

See also

InsertColumn, DeleteColumn


Table.AddRow Method

Appends new row to the table.

int AddRow()

Return Value

An integer index of the newly created row.

See also

InsertRow, DeleteRow


Table.Caption Property

Gets or sets the table’s caption text.

string Caption { get; set; }

Property Value

The text caption displayed in table’s title area. Initialized with the value of FlowChart.TableCaption.

See also

CaptionColor, CaptionHeight


Table.CaptionBackColor Property

Gets or sets the color used to fill the caption area of this table.

Color CaptionBackColor { get; set; }

Property Value

A Color instance representing the color of the caption area background. Initialized with the value of TableCaptionBackColor.

Remarks

If the value of this property is Color.Empty, the caption area is filled with the color specified in the FillColor property of the table.

See also

Caption, CaptionColor


Table.CaptionColor Property

Gets or sets the color of table’s caption text.

Color CaptionColor { get; set; }

Property Value

A Color value that represent the color of the Caption. Initialized with the value of FlowChart.TextColor.


Table.CaptionHeight Property

Gets or sets the height of table’s caption bar.

int CaptionHeight { get; set; }

Property Value

Height in pixels of the table’s caption area. Initialized with the value of FlowChart.TableCaptionHeight.

See also

Caption, CaptionBackColor


Table.Cell Class

Represent cell of a table. Currently Cell exposes only the Text property.

Public Properties

ColumnSpan | Specifies how many columns a cell should span.
RowSpan | Specifies how many rows a cell should span.
Text | Gets or sets the text to be displayed inside the cell.


Table.Cell Indexer

Gets a reference to table’s cell.

Cell this[int col, int row]


Table.CellFrameStyle Property

Specifies how the frame lines of table cells should be drawn.

CellFrameStyle CellFrameStyle { get; set; }

Property Value

A value from the CellFrameStyle enumeration. Initialized from FlowChart.CellFrameStyle.


Table.Column Class

Represent column of a table.

ColumnStyle specifies whether a column should be resized when its containing table is resized. Width specifies the width of a fixed-size column.


Table.Columns Property

Gets the collection of table’s columns.

ColumnCollection Columns { get; }

Property Value

Reference to a ColumnCollection collection representing all columns of the table.

See also

Rows


Table.ColumnWidth Property

Gets or sets the width of table’s columns.

int ColumnWidth { get; set; }

Property Value

An integer value that specifies the width of table columns. This value is assigned to the Width property of newly added columns.


Table.DeleteColumn Method

Deletes a column.

void DeleteColumn(int col)

Parameters

col

Zero-based index of the column to delete.

See also

AddColumn, RedimTable


Table.DeleteRow Method

Deletes a row.

void DeleteRow(int row)

Parameters

row

Zero-based index of the row to delete.

See also

AddRow, RedimTable


Table.InsertColumn Method

Inserts a new column at the specified position.

void InsertColumn(int col)

Parameters

col

Zero-based index of the column to insert.


Table.InsertRow Method

Inserts a new row at the specified position.

void InsertRow(int row)

Parameters

row

Zero-based index of the row to insert.

Example

private void _menuInsertRow_Click(object sender, System.EventArgs e)

{

      if(!(_itemClicked is Table))

            return;

      Table table = (Table)_itemClicked;

      table.InsertRow(_rowClicked + 1);

      table[0, _rowClicked + 1].Text = "Number";

      table[1, _rowClicked + 1].Text = "Field";

}


Table.LinkStyle Property

Specifies whether drawing an arrow from/to a table, should link a row of that table, or the whole table as an integral entity.

TableLinkStyle LinkStyle { get; set; }

Property Value

A member of the TableLinkStyle enumeration. Initialized with the value of FlowChart.TableLinkStyle.

Remarks

There are three possible ways to relate tables to other nodes. This property specifies how users are allowed to create such relations:

· tlsRows – relation ends are the rows of a table. An arrow connected to the table is linked to a particular row. This mode is convenient for database diagrams.

· tlsTable – relations target the table as a whole entity, and not any particular row. This mode is convenient for class diagrams.

· tlsBoth – a mixed mode where arrows can target either a row of the table or the table itself.

Programmatically, arrows can be linked to a table in any way, regardless of the LinkStyle. LinkStyle value is considered only when end-users draw arrows to or from a table. To link to a table as an entity and not to a specific row, pass –1 as row argument of the CreateArrow method.


Table.OffsetHeaderRows Property

Specifies whether the table cells are offset to the right to accommodate for the expand buttons of Header rows.

bool OffsetHeaderRows { get; set; }

Property Value

true to offset table cells when there are header rows defined, otherwise false. The default value is false.

Remarks

If this property is set to false, the +/- buttons used to expand or collapse table sections are drawn inside the first cell of each header row. Otherwise, the buttons are drawn in their own column in front of the table’s first column of cells.


Table.RedimTable Method

Changes the table dimensions, i.e. the number of rows and columns.

void RedimTable(int cols, int rows)

Parameters

cols

New number of columns.

rows

New number of rows.

Remarks

If the table is enlarged, new cells have their text initialized with empty strings. If the table is shrinked, its remaining cells have their content preserved.

See also

AddRow, AddColumn, DeleteRow, DeleteColumn


Table.Row Class

Row instances represent rows of a table.

Arrows that are linked to a row can be enumerated through the IncomingArrows and OutgoingArrows collections. The RelatedManyToOne and RelatedOneToMany are shortcuts for getting related tables in DB diagrams.

The height of a row is exposed via the Height property.

Where arrows can connect to a row is specified via AnchorPattern.

Public Properties

AnchorPattern | Gets or sets the pattern of anchor points associated the row.
Expanded | Gets or sets whether the table section starting from a Header row is collapsed or expanded.
Header | Specifies whether this row is a section header.
Height | Gets or sets the row height.
IncomingArrows | Gets the collection of arrows coming into the row.
OutgoingArrows | Gets the collection of arrows going out of the row.
RelatedManyToOne | Gets collection of tables related to this row.
RelatedOneToMany | Gets collection of tables related to this row.


Table.RowAnchorPattern Property

Gets or sets the pattern of anchor points associated with table’s rows.

AnchorPattern RowAnchorPattern { get; set; }

Property Value

Reference to an AnchorPattern instance representing the set of anchor points through which arrows can be linked to table rows. Default value is null – no anchor points are defined and arrows can be linked to any point of a row.


Table.RowHeight Property

Gets or sets the height of table’s rows.

int RowHeight { get; set; }

Property Value

An integer value that specifies the height of table rows. This value is assigned to the Height property of newly added rows.


Table.Rows Property

Gets the collection of table’s rows.

RowCollection Rows { get; }

Property Value

Reference to a RowCollection collection representing all rows of the table.

See also

Columns


Table.Scrollable Property

Specifies whether users are allowed to scroll the table’s rows.

bool Scrollable { get; set; }

Property Value

true to allow users scroll the table’s rows up and down; otherwise false. Initialized with the value of FlowChart.TablesScrollable.


Table.TopRow Property

Gets or sets the table’s top scroll row.

int TopRow { get; set; }

Property Value

Represents the index of the topmost visible row of the table. The value can be greater than zero if users have scrolled the table rows.


Cell.ColumnSpan Property

Specifies how many columns a cell should span.

int ColumnSpan { get; set; }

Property Value

A positive integer value specifying how many columns the cell spans to the right. The default value is 1.

Remarks

Use this property and RowSpan to define a cell that overlaps several columns and rows of the table’s grid. The spanning cell covers any non-spanning cells to the right or below it, as far as the spanned columns and rows go. The Text of spanning cells is aligned and laid out inside the enlarged bounding rectangles of the cells.


Cell.RowSpan Property

Specifies how many rows a cell should span.

int RowSpan { get; set; }

Property Value

A positive integer value specifying how many rows the cell spans downwards. The default value is 1.

Remarks

Use this property and ColumnSpan to define a cell that overlaps several columns and rows of the table’s grid. The spanning cell covers any non-spanning cells to the right or below it, as far as the spanned columns and rows go. The Text displayed in spanning cells is aligned and laid out inside the enlarged bounding rectangles of the cells.


Cell.Text Property

Gets or sets the text to be displayed inside the cell.

string Text { get; set; }

Property Value

The text caption displayed in the cell.

See also

Item.TextColor


Column.ColumnStyle Property

Gets or sets the resizing style of the column.

ColumnStyle ColumnStyle { get; set; }

Property Value

Member of the ColumnStyle enumeration specifying whether and how width of the column is changed if its containing table is resized.


Column.Width Property

Gets or sets the column width.

int Width { get; set; }

Property Value

Represents the width in pixels of the column.

Remarks

The property value is ignored if ColumnStyle is set to AutoWidth.


Row.AnchorPattern Property

Gets or sets the pattern of anchor points associated the row.

AnchorPattern AnchorPattern { get; set; }

Property Value

Reference to an AnchorPattern instance representing the set of anchor points through which arrows can be linked to the row. If this property is different from null, it overrides the value of Table.RowAnchorPattern.

Remarks

If an arrow is drawn over a row, whose AnchorPattern does not allow arrows of that type (incoming or outgoing), the arrow will be linked to the nearest row that would accept it.


Row.Expanded Property

Gets or sets whether the table section starting from a Header row is collapsed or expanded.

bool Expanded { get; set; }

Property Value

true if the table section that starts from this row is expanded, otherwise false. The default value is true.

Remarks

This property can be set only if the row is a Header. Arrows connected to the rows of a collapsed table section appear to be connected to the section header row.


Row.Header Property

Specifies whether this row is a section header.

bool Header { get; set; }

Property Value

true if this is the header row of a table section, otherwise false. The default value is false.

Remarks

Each header row defines a section of the table that includes all non-header rows after the header. Such sections can be expanded or collapsed, i.e. the rows included in them can be shown or hidden. This can be done interactively by pressing the +/- button displayed in header rows, or programmatically by setting the Expanded property.

See also

Table.OffsetHeaderRows


Row.Height Property

Gets or sets the row height.

int Height { get; set; }

Property Value

Represents the height in pixels of the row.


Row.IncomingArrows Property

Gets the collection of arrows coming into the row.

ItemCollection IncomingArrows { get; }

Property Value

An ItemCollection instance representing the Arrow items whose destination is this row.


Row.OutgoingArrows Property

Gets the collection of arrows going out of the row.

ItemCollection OutgoingArrows { get; }

Property Value

An ItemCollection instance representing the Arrow items whose origin is this row.


Row.RelatedManyToOne Property

Gets collection of tables related to this row.

ItemCollection RelatedManyToOne { get; }

Property Value

Collection of Table items, which are in many-to-one relation with this row.


Row.RelatedOneToMany Property

Gets collection of tables related to this row.

ItemCollection RelatedOneToMany { get; }

Property Value

Collection of Table items, which are in one-to-many relation with this row.


Arrow Class

Instances of the Arrow class represent links between diagram nodes.

namespace MindFusion.Diagramming.Compact {

  public class Arrow : Item

}

The nodes linked by an arrow are exposed via the Origin and Destination properties. If an arrow is docked to anchor point, the index of that point within its containing AnchorPattern can be get via OrgnIndex and DestIndex.

The shape of an arrow is defined via Style and SegmentCount. The value of those also determines the number of control points an arrow has. Control points are accessible via the ControlPoints collection, which also allows changing their positions. After moving control points programmatically, you must call the UpdateFromPoints method. The smallest rectangle that contains all points of an arrow is returned by BoundingRect.

Users can be prevented form moving arrows control points by setting AllowMoveStart or AllowMoveEnd. Arrow can be made to always point linked nodes centers by setting is Dynamic. For arrows whose style is set to Cascading, the PrpStartOrientation property specifies the oientation of their starting segment.

The following properties specify the outline and size of arrowhead shapes that appear at arrow ends and in the centers of arrow segments:ArrowBase, ArrowBaseSize, ArrowHead, ArrowHeadSize, IntermArrowHead, IntermHeadSize.

Other appearance settings include Color and Text.


Arrow.AllowMoveEnd Property

Specifies whether users are allowed to move arrow’s ending point.

bool AllowMoveEnd { get; set; }

Property Value

true if users are allowed to move the end-point of the arrow; otherwise false. Initialized with the value of FlowChart.AllowMoveArrowEnds.


Arrow.AllowMoveStart Property

Specifies whether users are allowed to move arrow’s starting point.

bool AllowMoveStart { get; set; }

Property Value

true if users are allowed to move the starting point of the arrow; otherwise false. Initialized with the value of FlowChart.AllowMoveArrowEnds.


Arrow.ArrowBase Property

Specifies what shape is displayed at the starting point of the arrow.

ArrowHead ArrowBase { get; set; }

Property Value

A member of the ArrowHead enumeration that specifies the shape to be displayed at the starting point of the arrow. Initialized with the value of FlowChart.ArrowBase.


Arrow.ArrowBaseSize Property

Specifies the size of the shape displayed at arrow’s starting point.

int ArrowBaseSize { get; set; }

Property Value

Size in pixels of the ArrowBase shape of the arrow. Initialized with the value of FlowChart.ArrowBaseSize.


Arrow.ArrowHead Property

Specifies what arrowhead shape is displayed at the ending point of the arrow.

ArrowHead ArrowHead { get; set; }

Property Value

A member of the ArrowHead enumeration that specifies the shape to be displayed at the end-point of the arrow. Initialized with the value of FlowChart.ArrowHead.


Arrow.ArrowHeadSize Property

Specifies the size of the arrowhead shape displayed at arrow’s ending point.

int ArrowHeadSize { get; set; }

Property Value

Size in pixels of the ArrowHead shape of the arrow. Initialized with the value of FlowChart.ArrowHeadSize.


Arrow.BoundingRect Property

Gets the rectangle that bounds all arrows’ control points.

Rectangle BoundingRect { get; }

Property Value

The smallest Rectangle that bounds all points of the arrow.


Arrow.Color Property

Gets or sets the color of the arrow.

Color Color { get; set; }

Property Value

A Color value that represents the color of the arrow lines. Initialized with the value of FlowChart.ArrowColor.


Arrow.ControlPoints Property

Gets the collection of arrow’s control points.

PointCollection ControlPoints { get; }

Property Value

A collection of control points that define the shape of the arrow.


Arrow.Destination Property

Gets the arrow’s destination node.

Item Destination { get; }

Property Value

The arrow points to this item.

See also

Origin


Arrow.DestIndex Property

Gets the index of the anchor point to which the arrow is connected.

int DestIndex { get; }

Property Value

Index of the anchor point to which the end of the arrow is docked. If there are no anchor points defined for the Arrow.Destination node, this property equals to -1.


Arrow.Dynamic Property

Specifies whether the arrow should always point to connected node centers.

bool Dynamic { get; set; }

Property Value

true to make the arrow always point to the connected nodes centers; otherwise false.


Arrow.IntermArrowHead Property

Specifies what arrowhead shapes are displayed at the middle of arrow segments.

ArrowHead IntermArrowHead { get; set; }

Property Value

A member of the ArrowHead enumeration that specifies the shape to be displayed at the middle of arrow segments. Initialized with the value of FlowChart.IntermArrowHead.


Arrow.IntermHeadSize Property

Specifies the size of arrowhead shapes displayed at the middle of arrow segments.

int IntermHeadSize { get; set; }

Property Value

Size in pixels of the IntermArrowHead shape. Initialized with the value of FlowChart.ArrowIntermSize.


Arrow.OrgnIndex Property

Gets the index of the anchor point to which the arrow is connected.

int OrgnIndex { get; }

Property Value

Index of the anchor point to which the start of the arrow is docked. If there are no anchor points defined for the Arrow.Origin node, this property equals to -1.


Arrow.Origin Property

Gets the node that is arrow’s origin.

Item Origin { get; }

Property Value

The arrow comes from this item.

See also

Destination


Arrow.PrpStartOrientation Property

Specifies orientation of the initial segment of ‘perpendicular’-style arrow.

Orientation PrpStartOrientation { get; set; }

Property Value

A member of the Orientation enumeration. It defines whether the first segment of arrows, whose Style is set to Cascading, should be either horizontal or vertical, or its orientation should be automatically computed by PocketChart. Initialized with the value of FlowChart.PrpArrowStartOrnt.


Arrow.SegmentCount Property

Gets or sets the number of arrow segments.

short SegmentCount { get; set; }

Property Value

Represent the number of segment the arrow is made of.


Arrow.Style Property

Gets or sets the style of the arrow.

ArrowStyle Style { get; set; }

Property Value

Member of the ArrowStyle enumeration that specifies whether the segments of an arrow are straight lines or curves.


Arrow.Text Property

Gets or sets the arrow’s text.

string Text { get; set; }

Property Value

The text caption displayed above the arrow.

See also

Item.TextColor


Arrow.UpdateFromPoints Method

Call this after changing ControlPoints coordinates.

void UpdateFromPoints()


Selection Class

Selection of items is represented by instance of the Selection class.

All selected items can be enumerated through the Items collection. Items can be also enumerated according to their types through the Boxes, Tables and Arrows collections.

Selection can be modified programmatically via the following methods: AddItem, Change, Toggle, RemoveItem, Clear.

Users can be prevented from selecting multiple items by disabling AllowMultiSel. Appearance of multiple selection indication can be changed via Style.

Public Properties

AllowMultiSel | Specifies whether users are allowed to select multiple items at the same time.
Arrows | Get a collection of all selected arrows.
Boxes | Get a collection of all selected boxes.
Items | Get a collection of all selected flowchart items.
Style | Specifies how to display multiple selection of items.
Tables | Get a collection of all selected tables.

Public Methods

AddItem | Adds an item to the current selection.
Change | Selects an item.
Clear | Clears the selection.
RemoveItem | Removes an item from the selection.
Toggle | Toggles item selection.


Selection.AddItem Method

Adds an item to the current selection.

void AddItem(Item obj)

Parameters

obj

Reference to the Item to be added to the selection.


Selection.AllowMultiSel Property

Specifies whether users are allowed to select multiple items at the same time.

bool AllowMultiSel { get; set; }

Property Value

true to allow users select multiple items simultaneously; otherwise false.

See also

Style


Selection.Arrows Property

Get a collection of all selected arrows.

ItemCollection Arrows { get; }

Property Value

An ItemCollection collection that represents all selected arrows.

See also

Items


Selection.Boxes Property

Get a collection of all selected boxes.

ItemCollection Boxes { get; }

Property Value

An ItemCollection collection that represents all selected boxes.

See also

Items


Selection.Change Method

Selects an item.

void Change(Item obj)

Parameters

obj

Refers to the Item to be selected.

Remarks

Calling Change is equivalent to calling consecutively Clear and AddItem.


Selection.Clear Method

Clears the selection.

void Clear()


Selection.Items Property

Get a collection of all selected flowchart items.

ItemCollection Items { get; }

Property Value

An ItemCollection collection that represents all selected items.

See also

Arrows, Boxes, Tables


Selection.Style Property

Specifies how to display multiple selection of items.

SelectionStyle Style { get; set; }

Property Value

A member of the SelectionStyle enumeration; the default value is SelectionHandles.

Remarks

The property specifies how multiple-selection is presented visually to users – with manipulation handles painted around each item or with a rectangle painted around all items.


Selection.RemoveItem Method

Removes an item from the selection.

bool RemoveItem(Item obj)

Parameters

obj

Refers to the Item to be removed from the selection.

Return Value

false if obj is not selected at the time the method is invoked; otherwise true.


Selection.Tables Property

Get a collection of all selected tables.

ItemCollection Tables { get; }

Property Value

An ItemCollection collection that represents all selected tables.

See also

Items


Selection.Toggle Method

Toggles item selection.

void Toggle(Item obj)

Parameters

obj

The Item whose selection-state to toggle.


Group Class

Represents a hierarchical group of items in the flowchart document.

An hierarchy of objects can be built, so that moving an object that is higher in the hierarchy makes all subordinated objects move too. The immediate subordinates of an object are represented by a Group instance. Every group should have a single master object, to which all group members are attached. The master object can be accessed via the MainItem property. The group of objects attached to another object is accessed via the SubordinateGroup property of the latter. MasterGroup gets the group in which an object is subordinate.

To create a group, call the CreateGroup method of the FlowChart class. A group is automatically destroyed when its master item is deleted. To destroy a group programmatically, call DestroyGroup. If AutoDeleteItems is enabled, subordinate items in the group are deleted too. If AutoDeleteItems is disabled, subordinate items are just detached from their master and remain intact.

Items can be attached to a group in several ways, depending on the type of the master item. If the master is a node, other nodes can be attached via the AttachProportional or AttachToCorner methods. If the master is an arrow, nodes can be attached to it using the AttachToArrowSegment or AttachToArrowPoint methods. The Node class provides a shortcut AttachTo method, which creates a group if necessary and calls the group’s appropriate AttachTo* method. Items can be detached from a group via the Detach method.

The Tag property allows attaching custom data to any group.


Group.AttachedItems Property

Gets a collection of the items attached to this group.

ItemCollection AttachedItems { get; }

Property Value

A collection that references all subordinate items in the group.

Remarks

The MainItem is not included in this collection.


Group.AttachProportional Method

Attaches a node to a group in a way it covers a percentage of main node’s area.

bool AttachProportional(Node node,

  int left, int top, int right, int bottom)

Parameters

node

The Node to be attached.

left

left side of the object’s bounding rectangle, expressed as percent of main object’s width.

top

top side of the object’s bounding rectangle, expressed as percent of main object’s height.

right

right side of the object’s bounding rectangle, expressed as percent of main object’s width.

bottom

bottom side of the object’s bounding rectangle, expressed as percent of main object’s height.


Group.AttachToArrowPoint Method

Attaches a node to the specified control point of the arrow set as MainItem.

bool AttachToArrowPoint(Node node, int point)

Parameters

node

The Node to be attached.

point

The arrow point to which the object should be attached.


Group.AttachToArrowSegment Method

Attaches a node to the specified segment of the arrow set as MainItem.

bool AttachToArrowSegment(Node node, int segment)

Parameters

node

The Node to be attached.

segment

The arrow segmen to which the object should be attached.


Group.AttachToCorner Method

Attaches a node to the specified corner of the node set as MainItem.

bool AttachToCorner(Node node, int corner)

Parameters

node

The Node to be attached.

corner

the 0 – based index of the object’s corner.


Group.Detach Method

Detaches an item from the group.

bool Detach(Item item)

Parameters

item

The Node to be detached.


Group.MainItem Property

Gets the main item of this group.

Item MainItem { get; }

Property Value

An Item instance that represents the main item.

Remarks

Each group has a main item. Any changes made to its location or size propagate recursively through its subordinate items. This main item can be a node or an arrow and is passed as an argument to the CreateGroup method.


Group.Tag Property

Associates custom data with the group.

object Tag { get; set; }

Property Value

Object that represents the tag.

Remarks

This property holds data that you define. PocketChart does not use it in any way. Possible usage might be to store an integer identifier or a reference to a larger structure.


Group.Visible Property

Shows or hides all items in this group.

bool Visible { get; set; }

Property Value

Object that represents the tag.


Collection Classes

There are two collection classes available in PocketChart: ItemCollection and PointCollection. They provide type-safe lists for storing respectively Item and Point instances. In order to keep the memory footprint low, separate collection for boxes, arrows and tables are not implemented.

Do not add items directly to the collections exposed by the FlowChart class. Instead, use CreateBox, CreateArrow, etc. Create new ItemCollection instances if you need to store references to existing items in a type-safe list.


Collection Indexer

Gets a reference to member of the collection.

Item this[int index]


Collection.Add Method

Adds a new item to the collection.

void Add(Item obj)

Parameters

obj

The item to be added to the end of the collection.


Collection.Clear Method

Clears the collection.

new void Clear()


Collection.Contains Method

Determines if the collection contains the specified item.

bool Contains(Item obj)

Parameters

obj

The item to locate in the collection.

Return Value

true if the item is found; otherwise false.


Collection.GetAt Method

Gets the item at the specified index.

Item GetAt(int i)

Parameters

i

Zero-based index of the item to get.

Return Value

Reference to the item at the specified position in the collection.


Collection.Insert Method

Inserts an item at the specified position.

void Insert(int i, Item a)

Parameters

i

Zero-based index at which the item should be inserted.

a

The item to insert.


Collection.Remove Method

Removes an item from the collection.

void Remove(Item a)

Parameters

The item to remove from the collection.


ShapeTemplate Class

The ShapeTemplate class provides means to define a shape, including shape outlines, decorations, text and picture rectangles. The definition of a shape is carried-out entirely via contructor call.

Shapes are identified by a string specified via the constructor call. That identifier can be accessed through the ShapeId property. Use the FromId method to get the shape that has a specified id.

Shape definitions also include relative coordinates of the ‘delete’ button position, specified via DelBtnPos.


ShapeTemplate Constructor

Defines a new shape template.

ShapeTemplate(

  string shapeId,

  object[] outline)

ShapeTemplate(

  string shapeId,

  object[] outline,

  object[] decorations)

ShapeTemplate(

  string shapeId,

  object[] outline,

  object[] decorations,

  Rectangle textRect)

ShapeTemplate(

  string shapeId,

  object[] outline,

  object[] decorations,

  Rectangle textRect,

  Rectangle pictureRect)

Parameters

shapeId

A string that uniquely identifies the shape.

outline

A sequence of points and joint specifiers. Point coordinates are specified as percent of box bounding rectangle.

decorations

A sequence of points and joint specifiers. Point coordinates are specified as percent of box bounding rectangle.

textRext

A rectangle in which box Text will be rendered; specified as percent of box bounding rectangle.

pictureRext

A rectangle in which box Picture will be rendered; specified as percent of box bounding rectangle.

Remarks

Joint specifiers are ShapeTemplate.StraightSegment and ShapeTemplate.BezierSegment.

StraightSegment specifies a straight line between the previous and next points in the sequence.

BezierSegment specifies a Bezier curve defined by the previous point in the sequence and the next three points. The end points lie on the curve and the middle two points define the bend of the curve.

A sequence is automatically closed to its first point.

When a new ShapeTemplate is crated, reference to it is automatically stored in a static array. A shape can be retrieved from that array by calling the FromId method.

Example

The stock Delay shape is defined as follows:

new ShapeTemplate("Delay", new object[]

{

      new Point(0, 0),

      ShapeTemplate.StraightSegment,

new Point(50, 0),

      ShapeTemplate.BezierSegment,

new Point(80, 0), new Point(100, 30), new Point(100, 50),

      ShapeTemplate.BezierSegment,

new Point(100, 70), new Point(80, 100), new Point(50, 100),

      ShapeTemplate.StraightSegment,

new Point(0, 100),

      ShapeTemplate.StraightSegment // to 0, 0

});


ShapeTemplate.DelBtnPos Property

Gets or sets relative position of the delete-button associated with a box.

Point DelBtnPos { get; set; }

Property Value

A Point value that represents the position at which to display delete- buttons, specified as percent of box extents.


ShapeTemplate.FromId Method

Gets the shape that has the specified identifier.

static ShapeTemplate FromId(string shapeId)

Parameters

shapeId

Identifier of the shape definition to locate.

Return Value

Reference to the found ShapeTemplate or null if no shape definition with the specified identifier exists.


ShapeTemplate.ShapeId Property

Gets the string identifier of the shape template.

string ShapeId { get; }

Property Value

The identifier assigned to the shape definition.


AnchorPattern Class

AnchorPattern represents a set of anchor points that can be applied as a whole to a node or a table’s row.

Anchor points specify the points within a node to which arrows can be docked. If a node does not have attached anchor points, arrow can link to any point of that node. When users draw an arrow starting or ending at a node, the respective arrow end-point is snapped to the nearest anchor point.

Anchor patterns are identified via string passed as argument to the constructor. The PatternId returns that string. The static FromId method returns the anchor pattern having a specified identifier.


AnchorPattern Constructor

Creates a new AnchorPattern instance.

AnchorPattern(string patternId, AnchorPoint[] points)

Parameters

patternId

A string that uniquely identifies the anchor pattern.

points

Array of anchor points in this pattern.

Remarks

When an anchor pattern is created, a reference to it is automatically stored in a static array. Call FromId to retrieve a pattern from that array.

Example

new AnchorPattern("Decision1In3Out",

new AnchorPoint[]

{

      new AnchorPoint(50, 0, true, false),

      new AnchorPoint(0, 50, false, true),

      new AnchorPoint(50, 100, false, true),

      new AnchorPoint(100, 50, false, true)

});


AnchorPattern.FromId Method

Gets the anchor pattern that has the specified identifier.

static AnchorPattern FromId(string patternId)

Parameters

patternId

Identifier of the anchor pattern to locate.

Return Value

Reference to the found AnchorPattern or null if no pattern with the specified identifier exists.


AnchorPattern.PatternId Property

Gets the string identifier of the anchor pattern.

string PatternId { get; }

Property Value

The identifier assigned to the anchor pattern.


AnchorPoint Class

AnchorPoint represent a point inside a node to which arrows are allowed to link. AnchorPoint points can be assigned to a node only through an AnchorPattern instance.

The position of an anchor point within a node is specified as percent of node’s width and height through the X and Y properties. When defining anchor point for use with tables, the Column property can be set optionally.

Whether a point accepts incoming and outgoing arrows is specified via AllowIncoming and AllowOutgoing.


AnchorPoint Constructor

Creates an anchor point.

AnchorPoint(

  short x,

  short y)

AnchorPoint(

  short x,

  short y,

  bool allowIncoming,

  bool allowOutgoing)

AnchorPoint(

  short x,

  short y,

  bool allowIncoming,

  bool allowOutgoing,

  int column)

Parameters

x

Specified horizontal position expressed as percent of node width.

y

Specified vertical position expressed as percent of node height.

allowIncoming

Specifies whether the point accepts incoming arrows.

allowOutgoing

Specifies whether the point accepts outgoing arrows.

column

Specifies a table column to be associated with the anchor point.


AnchorPoint.AllowIncoming Property

Specifies whether the point accepts incoming arrows.

bool AllowIncoming { get; set; }

Property Value

true to allow incoming arrows dock to this point; otherwise false.

See also

AllowOutgoing


AnchorPoint.AllowOutgoing Property

Specifies whether the point accepts outgoing arrows.

bool AllowOutgoing { get; set; }

Property Value

true to allow outgoing arrows dock to this point; otherwise false.

See also

AllowIncoming


AnchorPoint.Column Property

Specifies a table column to be associated with the anchor point.

int Column { get; set; }

Property Value

Index of table’s column to which the point is related. Default value is –1.

Remarks

This property is used if the anchor point is applied to a table. If its value equals –1, the point coordinates are relative to the row to which the anchor pattern is applied; otherwise the coordinates are relative to the cell defined by that row and the specified column.


AnchorPoint.X Property

Specified horizontal position expressed as percent of node width.

short X { get; set; }

Property Value

Relative position of the anchor point expressed as percent of node width.


AnchorPoint.Y Property

Specified vertical position expressed as percent of node height.

short Y { get; set; }

Property Value

Relative position of the anchor point expressed as percent of node height.


TextFormat Class

This class encapsulates text alignment attributes.

namespace MindFusion.Diagramming.Compact {

  public class TextFormat : ICloneable

}

At this time TextFormat exposes two properties, Alignment and LineAlignment. They specify how a string is aligned horizontally or vertically to its bounding rectangle.


TextFormat.Alignment Property

Specifies how a string is aligned horizontally.

TextAlignment Alignment { get; set; }

Property Value

A member of the TextAlignment enumeration. The default value is Near.


TextFormat.LineAlignment Property

Specifies how a string is aligned vertically.

TextAlignment LineAlignment { get; set; }

Property Value

A member of the TextAlignment enumeration. The default value is Near.


XmlWriter Class

The Write method of this class stores a FlowChart instance into an XML document.


XmlWriter.Write Method

Stores a flowchart into the specified XML document.

void Write(Stream stream)

void Write(string fileName)

void Write(System.Xml.XmlWriter writer)

Parameters

stream

A stream into which to store the XML output.

fileName

Path to a file into which to store the XML output.

writer

The XmlWriter used to write the XML document.

Example

private void _menuSave_Click(object sender, System.EventArgs e)

{

      if(_saveFileDialog.ShowDialog() == DialogResult.OK)

      {

            XmlWriter writer = new XmlWriter(_chart);

            writer.Write(_saveFileDialog.FileName);

      }

}


XmlReader Class

The Read method of this class loads a FlowChart diagram from an XML document.


XmlReader.Read Method

Loads a flowchart from the specified XML document.

void Read(Stream stream)

void Read(string fileName)

void Read(System.Xml.XmlReader reader)

Parameters

stream

A stream from which to load previously stored XML flowchart document.

fileName

Path to a file from which to load previously stored XML flowchart document.

reader

The XmlReader used to read the XML document.

Remarks

This method can load only XML documents that were previously saved via the XmlWriter.Write method. InvalidFormatException is thrown if you try to load a document with unrecognized schema.


GridLayout Class

Implements a grid graph layout algorithm.

namespace MindFusion.Diagramming.Compact.Layout {

  class GridLayout;

}

GridLayout arranges diagram nodes in a grid, keeping connected nodes close together. The algorithm aims to achieve a small number of arrow crossings. It is based on an iterative process whose initial steps shuffle the grid nodes randomly. That can lead to very different results each time the algorithm is run.

To apply the layout to a diagram, create a GridLayout instance, set its members and invoke the Arrange method.

The distance between points in the layout grid can be changed via GridSize. Nodes to be placed at the upper-left and lower-right corners of the grid can be assigned to StartNode and EndNode.

Anchoring specifies whether the layout algorithm must attach arrows to the anchor points of graphs nodes.

Public Properties

Anchoring | Specifies how to align arrows to the anchor points of graph nodes.
EndNode | A node to be placed at the lower right corner of the grid.
GridSize | Specifies the desired distance between adjacent grid points.
Iterations | Specifies for how many iterations to run the grid layout algorithm.
KeepGroupLayout | Specifies that a group of attached nodes should be treated as a single vertex of the arranged graph.
Progress | Allows tracking the progress of the layout algorithm.
RndSeed | Gets or sets the randomization seed to use for generating random node positions.
StartNode | A node to be placed at the upper left corner of the grid.

Public Methods

Arrange

Applies the layout to the specified FlowChart instance.


GridLayout Constructor

GridLayout ();


GridLayout.Anchoring Property

Specifies how to align arrows to the anchor points of tree nodes.

Anchoring Anchoring { get; set; }

Property value

A member of the Anchoring enumeration; default value is Ignore.

Remarks

The grid layout algorithm produces best results if it can place arrow ends at arbitrary positions over nodes’ outlines, i.e. when using the Ignore value. If your application logic requires arrows to be always attached to anchor points, use the other two values. In such cases Reassign would yield better results.

See Also

AnchorPattern


GridLayout.Arrange Method

Applies the layout to the specified FlowChart instance.

virtual bool Arrange(FlowChart chart);

Return Value

true if the layout is successfully applied; false if StartNode and EndNode are specified and there is no path between them.


GridLayout.EndNode Property

A node to be placed at the lower right corner of the grid.

new Node EndNode { get; set; }

Property value

Reference to a diagram Node. Default value is null / nothing.

Remarks

If you assign a node to that property, then StartNode cannot be null and must be set too. GridLayout usually produces better layouts if both StartNode and EndNode are null references; in such a case the algorithm automatically selects suitable nodes.


GridLayout.GridSize Property

Specifies the desired distance between adjacent grid points.

float GridSize { get; set; }

Property value

A real number specifying the grid size; default value is 25.

Remarks

When placing a node at a grid position, the node center point is aligned to the grid point at that position.


GridLayout.Iterations Property

Specifies for how many iterations to run the grid layout algorithm.

int Iterations { get; set; }

Property value

An integer number specifying the number of iterations. Default value is 3000.

Remarks

More iterations would yield better layouts but require more time to complete.

See also

Progress


GridLayout.KeepGroupLayout Property

Specifies that a group of attached nodes should be treated as a single vertex of the arranged graph.

bool KeepGroupLayout { get; set; }

Property value

True to treat a group as a single graph vertex; otherwise false.

Remarks

If enabled, a group of diagram nodes is treated as a single graph vertex while arranging the graph. Relative positions of the grouped items won’t be changed, but the group as a whole will be moved to produce a better layout.

See also

Node.AttachTo


GridLayout.Progress Property

Allows tracking the progress of the layout algorithm.

LayoutProgress Progress { get; set; }

Property Value

A LayoutProgress delegate method to call while the algorithm proceeds.

Remarks

It might take a lot of time to arrange large diagrams or run more iterations of the algorithm to get better results. In such situations an application can indicate to end users the progress of the layout routine by connecting a delegate to this property.

Example

The C# example below updates a label text to indicate GridLayout algorithm progress:

GridLayout gl = new GridLayout();

gl.Iterations = 20000;

gl.Progress = new LayoutProgress(onProgress);

gl.Arrange(fc);

void onProgress(int c, int n)

{

label1.Text = (100*c/n).ToString() + "% complete";

label1.Refresh();

}

See also

Iterations


GridLayout.RndSeed Property

Gets or sets the randomization seed to use for generating random node positions.

int RndSeed { get; set; }

Property Value

An integer seed passed to the constructor of Random. The default value is 0.

Remarks

In its initial stages, the grid layout routine places nodes at random locations. The default value of 0 makes random numbers generated from a different seed each time the routine runs. However that could lead to the same graph having a different layout each time the algorithm is executed. To prevent this, assign a value different than zero to this property.


GridLayout.StartNode Property

A node to be placed at the upper left corner of the grid.

new Node StartNode { get; set; }

Property value

Reference to a diagram Node. Default value is null / nothing.

Remarks

If you assign a node to that property, then EndNode cannot be null and must be set too. GridLayout usually produces better layouts if both StartNode and EndNode are null references; in such a case the algorithm automatically selects suitable nodes.


LayeredLayout Class

Implements a layered graph layout algorithm.

namespace MindFusion.Diagramming.Compact.Layout {

  class LayeredLayout;

}

This algorithm arranges diagram nodes in layers, according to several criteria. Most importantly: connected nodes must be placed close together; arrows must flow in one direction if possible; arrows must cross as few layers as possible; arrows must not cross other arrows.

To apply the layout to a diagram, create a LayeredLayout instance, set its members and invoke the Arrange method. The overall flow of the diagram can be set via Orientation and Direction.

Properties that control how nodes are distributed are NodeDistance, LayerDistance and SplitLayers.

Anchoring specifies whether the layout algorithm must attach arrows to the anchor points of graph nodes.

Public Properties

Anchoring | Specifies how to align arrows to the anchor points of graph nodes.
ArrowsCompactFactor | Gets or sets a value indicating how much to compact the outermost arrows.
Direction | Specifies the direction of the arranged diagram.
KeepGroupLayout | Specifies that a group of attached nodes should be treated as a single vertex of the arranged graph.
LayerDistance | Specifies the desired distance between layer axis lines.
NodeDistance | Specifies the desired distance between adjacent nodes in a layer.
Orientation | Specifies the overall orientation of the arranged diagram.
Progress | Allows tracking the progress of the layout algorithm.
SplitLayers | Specifies whether to split layers that are much wider than the other layers.
TimeLimit | Specifies a time-out value for the path-finding part of the layered layout algorithm.

Public Methods

Arrange

Applies the layout to the specified FlowChart instance.


LayeredLayout Constructors

LayeredLayout();

LayeredLayout(

      Orientation orientation,

      float layerDistance,

      float nodeDistance,

      float xGap,

      float yGap);


LayeredLayout.Anchoring Property

Specifies how to align arrows to the anchor points of graph nodes.

Anchoring Anchoring { get; set; }

Property Value

A member of the Anchoring enumeration; default is Ignore.

Remarks

The layered graph layout algorithm produces best results if it can place arrow ends at arbitrary positions over nodes’ outlines, i.e. when using the Ignore value. If your application logic requires arrows to be always attached to anchor points, use the other two values. In such cases Reassign would yield better results.

See Also

AnchorPattern


LayeredLayout.Arrange Method

Applies the layout to the specified FlowChart instance.

bool Arrange(FlowChart chart);

Return Value

LayeredLayout.Arrange always returns true.


LayeredLayout.ArrowsCompactFactor Property

Gets or sets a value indicating how much to compact the outermost arrows.

float ArrowsCompactFactor { get; set; }

Property value

A real number in the interval [0,1]. Default value is 1.

Remarks

Arrows and nodes on the same graph layer are distributed uniformly as specified via the NodeDistance value. However, if there are more than 2-3 outermost arrows on a layer, they usually take up too much space without improving the visual quality of the diagram layout. This property allows compacting such arrows to save space. The factor specifies roughly a fraction of NodeDistance to leave between outer arrows.


LayeredLayout.Direction Property

Specifies the direction of the arranged diagram.

Direction Direction { get; set; }

Property value

A member of the Direction enumeration; default is Direction.Straight.

Remarks

If Orientation is set to Horizontal, Direction.Straight stands for “left to right” and Direction.Reversed for “right to left”. If Orientation is set to Vertical, Direction.Straight stands for “top to bottom” and Direction.Reversed for “bottom to top”.


LayeredLayout.KeepGroupLayout Property

Specifies that a group of attached nodes should be treated as a single vertex of the arranged graph.

bool KeepGroupLayout { get; set; }

Property value

True to treat a group as a single graph vertex; otherwise false.

Remarks

If enabled, a group of diagram nodes is treated as a single graph vertex while arranging the graph. Relative positions of the grouped items won’t be changed, but the group as a whole will be moved to produce a better layout.

See also

Node.AttachTo


LayeredLayout.LayerDistance Property

Specifies the desired distance between layer axis lines.

float LayerDistance { get; set; }

Property value

Default value is 25.


LayeredLayout.NodeDistance Property

Specifies the desired distance between adjacent nodes in a layer.

float NodeDistance { get; set; }

Property value

Default value is 20.


LayeredLayout.Orientation Property

Specifies the overall orientation of the arranged diagram.

Orientation Orientation { get; set; }

Property value

Orientation.Vertical to have arrows flow in vertical direction; otherwise Orientation.Horizontal. Default value is Orientation.Vertical.

Remarks

The orientation of the resulting layers is opposite to that of the arrows. E.g. if the arrow tend to go in vertical direction, the nodes are distributed in horizontal layers.

See also

Direction


LayeredLayout.Progress Property

Allows tracking the progress of the layout algorithm.

LayoutProgress Progress { get; set; }

Property Value

A LayoutProgress delegate method to call while the algorithm proceeds.

Remarks

It might take a lot of time to arrange large diagrams or run more iterations of the algorithm to get better results. In such situations an application can indicate to end users the progress of the layout routine by connecting a delegate to this property.

See also

TimeLimit


LayeredLayout.SplitLayers Property

Specifies whether to split layers that are much wider than the other layers.

bool SplitLayers { get; set; }

Property value

Default value is false.


LayeredLayout.TimeLimit Property

Specifies a time-out value for the path-finding part of the layered layout algorithm.

long TimeLimit { get; set; }

Property value

An integer value specifying time-out in milliseconds; the default value is 10000 (10 seconds)

Remarks

The layered layout algorithm arranges graph nodes and links along the longest path in the graph. Large graphs with many links could contain hundreds of thousands of possible paths, so finding the longest one would be very time-consuming. When the time-out set with this property occurs, the path-finding routine stops and the layout algorithm uses the longest path known at that moment. Usually, for graphs containing several hundreds of nodes, 1-2 seconds are enough to find a long-enough path to produce nice layered layout.


SpringLayout Class

Implements the Spring-Embedder graph layout algorithm.

namespace MindFusion.Diagramming.Compact.Layout {

  class SpringLayout;

}

Call the Arrange method of a SpringLayout instance to apply the Spring-Embedder graph layout algorithm on the specified FlowChart instance.

Spring-Embedder produces layouts with uniform distribution of nodes, by simulating a physical system in which nodes repulse each other, and the links between them act as confining springs. The desired distance between adjacent nodes is set via the NodeDistance property.

Nodes are moved around in an iterative process. The forces that act on a node are calculated, taking in account the positions of surrounding nodes and links from the previous iteration. The number of iterations to run the layout routine is set in IterationCount.

SpringLayout can produce clustered or non-clustered layouts, as specified via EnableClusters.

Anchoring specifies whether the layout algorithm must attach arrows to the anchor points of graph nodes.

Public Properties

Anchoring | Specifies how to align arrows to the anchor points of graph nodes.
EnableClusters | Enables or disables allocating nodes to distinct clusters.
IterationCount | Specifies for how many iterations to run the layout routine.
KeepGroupLayout | Specifies that a group of attached nodes should be treated as a single vertex of the arranged graph.
MinimizeCrossings | Enables or disables crossing minimization mode.
NodeDistance | Gets or sets the desired distance between nodes.
Progress | Allows tracking the progress of the layout algorithm.
RndSeed | Gets or sets the randomization seed to use for generating random node positions.

Public Methods

Arrange

Applies the layout to the specified FlowChart instance.


SpringLayout Constructors

SpringLayout();

SpringLayout(

  int iterationCount,

  float nodeDistance,

  bool minimizeCrossings);


SpringLayout.Anchoring Property

Specifies how to align arrows to the anchor points of graph nodes.

Anchoring Anchoring { get; set; }

Property Value

A member of the Anchoring enumeration; default is Ignore.

Remarks

The Spring-Embedder layout algorithm produces best results if it can place arrow ends at arbitrary positions over nodes’ outlines, i.e. when using the Ignore value. If your application logic requires arrows to be always attached to anchor points, use the other two values. In such cases Reassign would yield better results.

See Also

AnchorPattern


SpringLayout.Arrange Method

Applies the layout to the specified FlowChart instance.

bool Arrange(FlowChart chart);

Return Value

SpringLayout.Arrange always returns true.


SpringLayout.EnableClusters Property

Enables or disables allocating nodes to distinct clusters.

bool EnableClusters { get; set; }

Property Value

true to detect and process node clusters, otherwise false; default is false.

Remarks

If enabled, the SpringLayout algorithm detects node clusters and places them at distinct positions. Each cluster consists of a center node surrounded by several local nodes. Clusters might be linked with other clusters via their center nodes. Best-looking results are achieved when there aren’t links between the local nodes in a cluster.


SpringLayout.IterationCount Property

Specifies for how many iterations to run the layout routine.

int IterationCount { get; set; }

Property Value

The default value is 100.


SpringLayout.KeepGroupLayout Property

Specifies that a group of attached nodes should be treated as a single vertex of the arranged graph.

bool KeepGroupLayout { get; set; }

Property value

True to treat a group as a single graph vertex; otherwise false.

Remarks

If enabled, a group of diagram nodes is treated as a single graph vertex while arranging the graph. Relative positions of the grouped items won’t be changed, but the group as a whole will be moved to produce a better layout.

See also

Node.AttachTo


SpringLayout.MinimizeCrossings Property

Enables or disables crossing minimization mode.

bool MinimizeCrossings { get; set; }

Property Value

The default value is false.

Remarks

If enabled, PocketChart tries to decrease number of crossing links. For better results, use greater IterationCount.


SpringLayout.NodeDistance Property

Gets or sets the desired distance between nodes.

float NodeDistance { get; set; }

Property Value

The default value is 30.

Remarks

The final distance between linked nodes is determined by multiplying the Weight of the arrow that connects them by the value of NodeDistance.


SpringLayout.Progress Property

Allows tracking the progress of the layout algorithm.

LayoutProgress Progress { get; set; }

Property Value

A LayoutProgress delegate method to call while the algorithm proceeds.

Remarks

It might take a lot of time to arrange large diagrams or run more iterations of the algorithm to get better results. In such situations an application can indicate to end users the progress of the layout routine by connecting a delegate to this property.

See also

IterationCount


SpringLayout.RndSeed Property

Gets or sets the randomization seed to use for generating random node positions.

int RndSeed { get; set; }

Property Value

An integer seed passed to the constructor of Random. The default value is 0.

Remarks

In some situations, e.g. when two nodes are placed at the same locations, the layout routine places nodes at random locations. The default value of 0 makes random numbers generated from a different seed each time the algorithm runs. However that could lead to the same graph having a different layout each time the algorithm is executed. To prevent this, assign a value different than zero to this property.


TreeLayout Class

Implements several algorithms for arranging tree structures.

namespace MindFusion.Diagramming.Compact.Layout {

  class TreeLayout;

}

Call the Arrange method of a TreeLayout instance to apply directional or radial layout on a tree/subtree in the current diagram. Several properties allow you to customize the layout.

Anchoring specifies whether the layout algorithm must attach arrows to the anchor points of tree nodes.

Public Properties

Anchoring | Specifies how to align arrows to the anchor points of tree nodes.
ArrowStyle | Specifies how the arrows in the arranged tree should look.
Direction | Specifies the direction of the arranged diagram.
IgnoreArrowDirection | Ignore the direction of arrows when arranging a tree.
KeepGroupLayout | Specifies that a group of attached nodes should be treated as a single vertex of the arranged tree.
KeepRootPosition | Keep the root at its original position.
LevelDistance | Gets or sets how much space to leave between levels of the tree.
NodeDistance | Gets or sets how much space to leave between nodes on the same level.
Orientation | Specifies the overall orientation of the arranged diagram.
Progress | Allows tracking the progress of the layout algorithm.
ReversedArrows | Specifies the arrow direction that relates parent to children.
Root | Specifies the root node of the tree.
StretchFactor | Allows using elliptic outlines for radial layout.
Type | Type of tree layout: BorderAligned, Centralized or Radial.

Public Methods

Arrange

Applies the layout to the specified FlowChart instance.


TreeLayout Constructors

TreeLayout();

TreeLayout(ChartObject root);

TreeLayout(

  MindFusion.Diagramming.Compact.Layout.TreeLayoutType type);

TreeLayout(

  ChartObject root,

  MindFusion.Diagramming.Compact.Layout.TreeLayoutType type);

TreeLayout(

  ChartObject root,

  MindFusion.Diagramming.Compact.Layout.TreeLayoutType type,

  bool reversedArrows,

  MindFusion.Diagramming.Compact.Layout.TreeLayoutArrowType arrowStyle,

  MindFusion.Diagramming.Compact.Layout.TreeLayoutDirection direction,

  float levelDistance,

  float nodeDistance,

  bool keepRootPosition,

  float xGap,

  float yGap);


TreeLayout.Anchoring Property

Specifies how to align arrows to the anchor points of tree nodes.

Anchoring Anchoring { get; set; }

Property Value

A member of the Anchoring enumeration; default is Ignore.

Remarks

The tree layout algorithm produces best results if it can place arrow ends at arbitrary positions over nodes’ outlines, i.e. when using the Ignore value. If your application logic requires arrows to be always attached to anchor points, use the other two values. In such cases Reassign would yield better results.

See Also

AnchorPattern


TreeLayout.Arrange Method

Applies the layout to the specified FlowChart instance.

bool Arrange(FlowChart chart);


TreeLayout.ArrowStyle Property

Specifies how arrows in the arranged tree should look. Possible values are: Straight, Perpendicular2, Perpendicular3 and Rounded. This property is ignored if Type is set to Radial.

MindFusion.Diagramming.Compact.Layout.TreeLayoutArrowType ArrowStyle { get; set; }


TreeLayout.Direction Property

Specifies the direction of the arranged diagram.

Direction Direction { get; set; }

Property value

A member of the Direction enumeration; default is Direction.Straight.

Remarks

If Orientation is set to Horizontal, Direction.Straight stands for “left to right” and Direction.Reversed for “right to left”. If Orientation is set to Vertical, Direction.Straight stands for “top to bottom” and Direction.Reversed for “bottom to top”.


TreeLayout.IgnoreArrowDirection Property

Ignore direction of arrows when arranging a tree. Parent-child direction is considered the one in which nodes go further from the root, instead that of the arrows. If IgnoreArrowDirection is set to true, you must explicitly specify the tree Root.

bool IgnoreArrowDirection { get; set; }


TreeLayout.KeepGroupLayout Property

Specifies that a group of attached nodes should be treated as a single vertex of the arranged tree.

bool KeepGroupLayout { get; set; }

Property value

True to treat a group as a single tree vertex; otherwise false.

Remarks

If enabled, a group of diagram nodes is treated as a single tree node while arranging the tree. Relative positions of the grouped items won’t be changed, but the group as a whole will be moved to produce a better layout.

See also

Node.AttachTo


TreeLayout.KeepRootPosition Property

Keep the root at its original position.

bool KeepRootPosition { get; set; }


TreeLayout.LevelDistance Property

Gets or sets how much space to leave between levels of the tree.

float LevelDistance { get; set; }


TreeLayout.NodeDistance Property

Gets or sets how much space to leave between nodes on the same level. Ignored for radial layouts

float NodeDistance { get; set; }


TreeLayout.Orientation Property

Specifies the overall orientation of the arranged diagram.

Orientation Orientation { get; set; }

Property value

Orientation.Vertical to have arrows flow in vertical direction; otherwise Orientation.Horizontal. Default value is Orientation.Vertical.

Remarks

The orientation of the resulting tree layers is opposite to that of the arrows. E.g. if the arrow tend to go in vertical direction, the nodes are distributed in horizontal layers.

See also

Direction


TreeLayout.Progress Property

Allows tracking the progress of the layout algorithm.

LayoutProgress Progress { get; set; }

Property Value

A LayoutProgress delegate method to call while the algorithm proceeds.

Remarks

It might take a lot of time to arrange large diagrams or run more iterations of the algorithm to get better results. In such situations an application can indicate to end users the progress of the layout routine by connecting a delegate to this property.


TreeLayout.ReversedArrows Property

Specifies the arrow direction that relates parent to children.

bool ReversedArrows { get; set; }


TreeLayout.Root Property

Specifies the root node of the tree. If not set, PocketChart will try to find the root automatically.

ChartObject Root { get; set; }


TreeLayout.StretchFactor Property

Allows using elliptic outlines for radial layout.

float StretchFactor { get; set; }

Property value

A real number specifying the ratio between the horizontal and vertical radii of radial layout outlines. Default value is 1.

Remarks

When applying a radial layout, node layers are laid out in concentric circles around the Root node. Stretching them by changing this property makes layers laid out in elliptic outlines.


TreeLayout.Type Property

Type of tree layout: BorderAligned, Centralized or Radial.

MindFusion.Diagramming.Compact.Layout.TreeLayoutType Type { get; set; }


DiagramEventArgs Class

Passed as an argument to DiagramEvent event handlers. Currently the class contains a single property called Item. Item refers to the diagram item to which the handled event pertains.


Anchoring Enumeration

Defines values that specify how automatic layout algorithms align arrows to anchor points.

Ignore | Anchor points are ignored.
Keep | Arrows remain attached to their original anchor points.
Reassign | Arrows are aligned to new anchor points, depending on the positions of graph nodes after a layout is applied.

Remarks

Assign values of this enumeration to the Anchoring property of layout algorithms. Most algorithms produce best results if they can place arrow ends at arbitrary positions over nodes’ outlines, i.e. when using the Ignore value. If your application logic requires arrows to be always attached to anchor points, use the other two values. In such cases Reassign would yield better results.


ArrowHead Enumeration

ArrowHead members identify arrowhead shapes that can be assigned to ArrowHead, ArrowBase and IntermArrowHead properties of the Arrow class. All members and their values are listed below:

None | Don’t display an arrowhead.
Arrow | Display an arrow-like arrowhead.
Triangle | Display a triangle.
Circle | Display a circle.
Tetragon | Display a tetragon
Rhombus | Display a rhombus.
BowArrow | Display a bow arrow.
PointerArrow | Display a pointer arrow.
Pentagon | Display a pentagon.
DoubleArrow | Display a double arrow.
Reversed | Display a reversed arrowhead.
RevTriangle | Display a reversed triangle.
Quill | Display a quill.
RevWithLine | Display a reversed arrowhead with intersecting line.
RevWithCirc | Display a reversed arrowhead with a circle.
BackSlash | Display a a back slash.
Slash | Display a a slash.


ArrowStyle Enumeration

ArrowStyle members specify the shape of arrow segments and how adjacent segments are situated. These values can be assigned to the Style property of arrows.

Bezier | The segments of an arrow are Bezier curves.
Polyline | The segments of the arrow are straight lines.
Cascading | The segments of an arrow are perpendicular to each other lines.


AttachToArrow Enumeration

Defines values specifying the possible ways to attach a node to an arrow.

Point | The node is attached to a fixed control point of the arrow.
Segment | The node is attached to a fixed segment of the arrow.


AttachToNode Enumeration

Defines values specifying the possible ways to attach a node to another node.

TopLeft | The node is attached to the top-left corner of the master node.
TopRight | The node is attached to the top-right corner of the master node.
BottomLeft | The node is attached to the bottom-left corner of the master node.
BottomRight | The node is attached to the bottom-right corner of the master node.


BehaviorType Enumeration

BehaviorType members identify the possible ways to interpret users actions with the stylus, e.g. what happens when users start to draw over empty area or over a node. These values can be assigned to the Behavior property of FlowChart class:

Modify | Objects can be selected and modified. New objects cannot be created.
CreateBox | Drawing with the mouse creates Box instances.
CreateArrow | Drawing started over a node creates an Arrow. Otherwise a lasso rectangle is displayed allowing the selection of items.
FlowChart | A mode that is suitable for creating flowcharts and process diagrams. Drawing over empty document area creates a Box instance. Drawing started over a node creates an Arrow.
TableRelations | A mode that is suitable for creating entity-relationship diagrams. Drawing over empty document area creates a Table instance. Drawing started over a node creates an Arrow.
CreateTable | Drawing with the mouse creates Table instances.


CellFrameStyle Enumeration

CellFrameStyle members identify different appearance styles of border frames of table cells. These values can be assigned to the CellFrameStyle property of tables:

None | Table cells have no border.
Simple | The border of table cells is simple line.


ColumnStyle Enumeration

ColumnStyle members identify resizing options for table columns. These values can be assigned to the ColumnStyle property of table columns:

FixedWidth | The columns has fixed, unchangeable width.
AutoWidth | The columns’ width changes when the table is resized.


ExpandButtonPosition Enumeration

Defines values that specify possible locations for expand/collapse buttons:

OuterRight | Place expand/collapse buttons at the right-hand side of their nodes.
OuterLowerRight | Place expand/collapse buttons at the lower-right corner of their nodes.
OuterUpperRight | Place expand/collapse buttons at the upper-right corner of their nodes.
OuterBottom | Place expand/collapse buttons at the bottom side of their nodes.
OuterLeft | Place expand/collapse buttons at the left-hand side of their nodes.
OuterLowerLeft | Place expand/collapse buttons at the lower-left corner of their nodes.
OuterUpperLeft | Place expand/collapse buttons at the upper-left corner of their nodes.
OuterTop | Place expand/collapse buttons at the top side of their nodes.

Remarks

The values from this enumeration can be assigned to the ExpandButtonPosition property of the FlowChart class.


Handles Enumeration

Identifies the distinct selection handles of a node:

None | Specifies that none of the selection handles can be used to modify the node.
ResizeTopLeft | The top-left handle is enabled and can be used to resize the node.
ResizeTopRight | The top-right handle is enabled and can be used to resize the node.
ResizeBottomRight | The bottom-right handle is enabled and can be used to resize the node.
ResizeBottomLeft | The bottom-left handle is enabled and can be used to resize the node.
ResizeTopCenter | The top-center handle is enabled and can be used to resize the node vertically.
ResizeMiddleRight | The middle-right handle is enabled and can be used to resize the node horizontally.
ResizeBottomCenter | The bottom-center handle is enabled and can be used to resize the node vertically.
ResizeMiddleLeft | The middle-left handle is enabled and can be used to resize the node horizontally.
Move | The center selection handle is enabled and can be used to move the node.
All | All selection handles are enabled and canbe used to modify the node.

Remarks

A combination of these flags can be assigned to the EnabledHandles property of nodes.


HandlesStyle Enumeration

HandlesStyle members identify the possible ways to indicate selection state visually and specify how selected items can be modified. These values can be assigned to the HandlesStyle property of nodes:

Invisible | There is no visible difference between selected and unselected node.
SquareHandles | If selected, the node is drawn with square modification handles.
DashFrame | If selected, a node is drawn with dashed frame. The frame enables resizing the node. The center of the node allows moving it and the edge area enables creating links.
HatchFrame | If selected, the object is drawn with hatched frame. Modifications can be done as with DashFrame.
HatchHandles | If selected, a node is drawn with both hatched frame and modification handles. The frame enable moving the node, and the handles enable resizing. Links are created from any point of the interior.


Orientation Enumeration

Orientation members are used with the PrpStartOrientation property of arrows whose Style is set to Cascading. Enumeration members specify the orientation of the first segment of such arrows.

Auto | PocketChart determines automatically the initial direction of arrow’s segment.
Horizontal | The arrow’s segment is horizontal.
Vertical | The arrow’s segment is vertical.


RestrictToDoc Enumeration

RestrictToDoc members specify what happens when users try to draw outside the current drawing area, defined by DocExtents. These values can be assigned to the RestrObjsToDoc property:

NoRestriction | No restriction on the position of the object
Intersection | Objects must be located at least partially inside the document extents.
InsideOnly | Objects must be located entirely inside the document extents.


RulerUnit Enumeration

RulerUnit specifies what units are displayed in the Ruler scales:

Pixel | Ruler scales display pixels.
Percent | Ruler scales display percent of the FlowChart document size.


SelectionStyle Enumeration

SelectionStyle members specify how multiple-selection should be indicated visually. These values can be assigned to the Style property of Selection class.

SelectionHandles | Rectangular manipulation handles are painted over selected items.
Rectangle | A dashed rectangle is drawn around selected items.


ShadowsStyle Enumeration

ShadowsStyle members identify the possible ways to render item shadows. These values can be assigned to the ShadowsStyle property of FlowChart:

None | No shadows are drawn.
OneLevel | All shadows are drawn at the lowest Z- level, and appear to be on one level.
ZOrder | Every shadows is drawn just below its object, possibly covering other objects.


SnapToAnchor Enumeration

SnapToAnchor members specify when arrow end-points are snapped to an anchor points. These values can be assigned to the SnapToAnchor property of FlowChart class:

OnCreate | Snap to anchor point when creating a new link.
OnCreateOrModify | Snap to anchor point when creating or modifying a link.


TableLinkStyle Enumeration

This enumeration defines the possible values of the Table.LinkStyle property, which specifies whether relation ends are the rows of a table or the table as an integral entity.

Table | Users are allowed to create relations to a table an integral entity.
Rows | Users are allowed to create relations to the rows of a table.
Both | Users are allowed to create relations both to the rows of a table or the the table as a whole.


TextAlignment Enumeration

Specifies the alignment of a text string relative to its layout rectangle:

Near | Text is aligned near the origin of the layout rectangle.
Center | Text is aligned in the center of the layout rectangle.
Far | Text is aligned far from the origin of the layout rectangle.


Additional components


Ruler control

The Ruler control provides horizontal and vertical scales that helps users measure and align diagram items.

namespace MindFusion.Diagramming.Compact {

public class Ruler : System.Windows.Forms.Control

}

In order to use the Ruler control, customize the Visual Studio toolbox and add a reference to “PocketRulerDesigner.dll” in VS2003 or “PocketRuler.dll” in VS2005. To specify which FlowChart instance is shown in the ruler, set the Ruler.Document property. After adding a FlowChart or a Ruler to a form, you might need to close and reopen that form, in order to have the Document property drop-down list refreshed and populated with all flowcharts on the form.

The ruler tracks mouse movements and modifications being performed on an item, and displays markers over the scales indicating the current position in diagram’s coordinate system. The colors of these markers can be changed using the PointerColor and ProjectionColor properties.

If EnableGuides is set to true, the ruler allows aligning several items by tapping on a scale and dragging. That displays alignment guides which follow the stylus pointer and move all selected items on their way. If no diagram elements are selected, all items are moved.

The following table lists all properties exposed by the Ruler class:

Public Properties

ContextMenu | Gets or sets the context menu associated with the ruler.
Document | Gets or sets the FlowChart instance associated with the ruler.
EnableGuides | Enables or disables the alignment guides.
GuideColor | Specifies the color of the alignment guide lines.
HorizontalScaleAlignment | Specifies the alignment of the horizontal scale.
HorizontalScaleVisible | Specifies whether the horizontal scale is visible.
PointerColor | Gets or sets the color of the mouse pointer's projections.
ProjectionColor | Specifies the color of the projections of the active node on the ruler scales.
Text | Gets or sets the text displayed in the ruler’s corner button.
Unit | Specifies the measure units displayed in the ruler scales.
VerticalScaleAlignment | Specifies the alignment of the vertical scale.
VerticalScaleVisible | Specifies whether the vertical scale is visible.


Ruler.ContextMenu Property

Gets or sets the context menu associated with the ruler.

ContextMenu ContextMenu { get; set; }

Property Value

An instance of the .NET ContextMenu class. Default value is null / nothing.

Remarks

The context menu can be displayed by right-clicking anywhere on the ruler scales.


Ruler.Document Property

Gets or sets the FlowChart instance associated with the ruler.

FlowChart Document { get; set; }

Property Value

An instance of the FlowChart class contained within the ruler.

Remarks

This property can be set in design time by dragging a flowchart control into the ruler control, or by selecting a flowchart instance from the combo box displayed in the property grid for Document.


Ruler.EnableGuides Property

Enables or disables the alignment guides.

bool EnableGuides { get; set; }

Property Value

true to allow aligning diagram items using ruler guides, otherwise false. Default value is true.

Remarks

If alignment guides are enabled, users can start aligning items by pressing the left mouse button over a scale and dragging. The horizontal scale displays vertical guide lines that allow aligning the left or right sides of items. The vertical scale displays horizontal guide lines that allow aligning the top or bottom sides of items.

See also

GuideColor


Ruler.GuideColor Property

Specifies the color of the alignment guide lines.

Color GuideColor { get; set; }

Property Value

A Color instance specifying the color of the guide lines. Default value is SystemColors.ControlText

See also

EnableGuides


Ruler.HorizontalScaleAlignment Property

Specifies the alignment of the horizontal scale.

Alignment HorizontalScaleAlignment { get; set; }

Property Value

Near to place the horizontal scale at the top; Far to place it at the bottom. Default value is Near.


Ruler.HorizontalScaleVisible Property

Specifies whether the horizontal scale is visible.

bool HorizontalScaleVisible { get; set; }

Property Value

true to display the horizontal scale, otherwise false. Default value is true.


Ruler.PointerColor Property

Gets or sets the color of the mouse pointer's projections.

Color PointerColor { get; set; }

Property Value

A Color instance specifying the color of the pointer projection lines. Default value is Color.Red.


Ruler.ProjectionColor Property

Specifies the color of the projections of the active node on the ruler scales.

Color ProjectionColor { get; set; }

Property Value

A Color instance specifying the color of the selected node’s projection on the scales. Default value is Color.LightSteelBlue.

Remarks

The active node is a Node instance which is the current flowchart’s ActiveItem.


Ruler.Text Property

Gets or sets the text displayed in the ruler’s corner button.

string Text { get; set; }

Property Value

A string specifying the label of the ruler’s corner button.


Ruler.Unit Property

Specifies the measure units displayed in the ruler scales.

RulerUnit Unit { get; set; }

Property Value

A member of the RulerUnit enumeration specifying what units are displayed in the scales. Default value is Pixel.


Ruler.VerticalScaleAlignment Property

Specifies the alignment of the vertical scale.

Alignment VerticalScaleAlignment { get; set; }

Property Value

Near to place the vertical scale at the left side; Far to place it at the right side. Default value is Near.


Ruler.VerticalScaleVisible Property

Specifies whether the vertical scale is visible.

bool VerticalScaleVisible { get; set; }

Property Value

true to display the vertical scale, otherwise false. Default value is true.


Customer support

Detailed information about everything connected with software products offered by MindFusion, online documentation, demos, information about forthcoming products can be found at http://www.mindfusion.org/. The site is updated every day, so make sure you visit it regularly to catch up with the newest from us.

Apart of that, MindFusion’s official policy is to employ very strong support team. This guarantees that all your questions and inquiries will be answered in quick and professional manner. We would be very grateful for any suggestions and recommendations you might have regarding our products. We do take in account the opinion of everyone who has shown interest in our products.

Of course, MindFusion’s support team is for all to help you with products troubleshooting if any. They can be reached at support@mindfusion.org or at any time on (+359) 888 95 17 37.

Copyright (c) 2003-2006 MindFusion Ltd. Gibraltar


FlowChart.PolyTextLayout Property

Enables or disables formatting of text inside non-rectangular box outlines.

bool PolyTextLayout { get; set; }

Property Value

true to enable polygonal formatting; false to disable it. The default value is false.

Remarks

This property specifies the initial value of the PolyTextLayout property of boxes.