Gorilla.UI.FlowChart
Unit Gorilla.UI.FlowChart.pasClasses
- EFlowChartException = class ( Exception )
- TFlowChartLine = class ( TPath )
- TFlowChartPatternAnchor = class ( TCollectionItem )
- TFlowChartPatternAnchors = class ( TCollection )
- TFlowChartPattern = class ( TControl )
- TFlowChartCirclePattern = class ( TFlowChartPattern )
- TFlowChartRectanglePattern = class ( TFlowChartPattern )
- TFlowChartItemPattern = class ( TFlowChartRectanglePattern )
- TFlowChartContainerPattern = class ( TFlowChartItemPattern )
- TFlowChartTemplate = class ( TCollectionItem )
- TFlowChartTemplates = class ( TCollection )
- TFlowChartFrame = class ( TPanel )
Records
- record TLinePair
Enumerations
- enum TFlowChartPatternAnchorKind = ( LeftAnchor, TopAnchor, RightAnchor, BottomAnchor ) ;
Constants
- const FLOWCHART_SIZE_DEFAULT : Integer = $20;
- const FLOWCHART_SIZE_TWICE_DEFAULT : Integer = $40;
- const FLOWCHART_SPACE_DEFAULT : Integer = $30;
Mics. types
- type PLinePair = pointer to TLinePair;
TFlowChartLine
Custom flow chart pattern-connection line with a reference to the parent pattern, where the line pair was registered.
Ancestors
Members
Fields
- protected FAnchorPosFrom :
TPointF
- protected FAnchorPosTo :
TPointF
- protected FAnchorKindFrom :
TFlowChartPatternAnchorKind
- protected FAnchorKindTo :
TFlowChartPatternAnchorKind
- protected FPattern :
TFlowChartPattern
- protected FLinePair :
PLinePair
- protected FUnlinker :
TCircle
Methods
- public constructor Create ( AOwner : TComponent ) ;
- protected procedure DoOnUnlinkQuery ( ASender : TObject ) ; virtual;
- protected procedure DoOnUnlinkerEnter ( ASender : TObject ) ; virtual;
- protected procedure DoOnUnlinkerLeave ( ASender : TObject ) ; virtual;
- public procedure UpdateLine
(
)
;
overload virtual;
Updates the path data of the cubic bezier line.
- public procedure UpdateLine
(
const
AFrom :
TFlowChartPattern; const
ATo :
TFlowChartPattern; const
AColor :
TAlphaColor
)
;
overload virtual;
Updates the path data of a specific line between AFrom and ATo pattern. The submitted color will be set for the line. This method will call the UpdateLine() method.
Properties
TFlowChartPatternAnchor
Custom flow chart pattern anchor. An anchor is the line attachment point of a specific pattern. Default anchors are handled automatically by the GetLineAnchor() method. Add this to the anchors collection to handle individual anchors.
Ancestors
Members
Fields
Properties
TFlowChartPatternAnchors
Custom flow chart pattern anchor collection, where all anchors for each pattern are stored.
Ancestors
TFlowChartPattern
Is the flow chart representation for a specific instance of a class template (TFlowChartTemplate). This is the visual representation of a template instance.
Ancestors
Members
Fields
- protected INDEX_COUNT :
Integer
- private FLineOwners :
TFlowChartPatternList
- protected FIndex :
Integer
- protected FTemplate :
TFlowChartTemplate
- protected FInstance :
TObject
- protected FAttached :
TFlowChartPatternList
- protected FContained :
TFlowChartPatternList
- protected FIsMoveable :
Boolean
- protected FIsDraggable :
Boolean
- protected FCanPostLink :
Boolean
- protected FIsRoot :
Boolean
- protected FLineOwner :
TFlowChartPatternList
- protected FLines :
TLinePairList
- protected FMultipleOwners :
Boolean
- protected FMultipleAttachments :
Boolean
- protected FAttachmentsAllowed :
Boolean
- protected FMultipleContainments :
Boolean
- protected FContainmentsAllowed :
Boolean
- protected FMinContainerHeight :
Single
- protected FUseDefaultAnchors :
Boolean
- protected FAnchors :
TFlowChartPatternAnchors
- protected FShadow :
TShadowEffect
- protected FOnMoved :
TOnFlowChartPatternNotifyEvent
- protected FOnCanCreate :
TOnFlowChartPatternCanCreate
- protected FOnCanLink :
TOnFlowChartPatternAllowed
- protected FOnAttached :
TOnFlowChartPatternLinkEvent
- protected FOnContained :
TOnFlowChartPatternLinkEvent
- protected FOnUnattached :
TOnFlowChartPatternLinkEvent
- protected FOnUncontained :
TOnFlowChartPatternLinkEvent
- protected FOnBuilt :
TOnFlowChartPatternLinkEvent
- protected FOnCanUnlink :
TOnFlowChartPatternAllowed
- protected FOnAdjustHeight :
TOnFlowChartPatternNotifyEvent
- protected FOnGetDisplayName :
TOnFlowChartPatternGetDisplayName
Methods
- public constructor Create
(
AOwner :
TComponent
)
;
Default pattern constructor. In design time it will execute the Setup() method. On instanciating a component of this type at runtime you have to call Setup() on your own to initialize sub-components.
- public destructor Destroy ( ) ;
- protected function GetTagIndex ( ) : Integer ; virtual;
- protected function GetFlowChart ( ) : TFlowChartFrame ; virtual;
- protected function GetLines ( ) : TLinePairList ; virtual;
- protected function GetAttached ( ) : TFlowChartPatternList ; virtual;
- protected function GetContained ( ) : TFlowChartPatternList ; virtual;
- protected function GetIsMoveable ( ) : Boolean ; virtual;
- protected procedure SetIsMoveable ( AValue : Boolean ) ; virtual;
- protected function GetIsDraggable ( ) : Boolean ; virtual;
- protected procedure SetIsDraggable ( AValue : Boolean ) ; virtual;
- protected function GetCanPostLink ( ) : Boolean ; virtual;
- protected procedure SetCanPostLink ( AValue : Boolean ) ; virtual;
- protected function GetIsRoot ( ) : Boolean ; virtual;
- protected procedure SetIsRoot ( AValue : Boolean ) ; virtual;
- protected function GetMultipleOwners ( ) : Boolean ; virtual;
- protected procedure SetMultipleOwners ( AValue : Boolean ) ; virtual;
- protected function GetMultipleAttachments ( ) : Boolean ; virtual;
- protected procedure SetMultipleAttachments ( AValue : Boolean ) ; virtual;
- protected function GetAttachmentsAllowed ( ) : Boolean ; virtual;
- protected procedure SetAttachmentsAllowed ( AValue : Boolean ) ; virtual;
- protected function GetMultipleContainments ( ) : Boolean ; virtual;
- protected procedure SetMultipleContainments ( AValue : Boolean ) ; virtual;
- protected function GetContainmentsAllowed ( ) : Boolean ; virtual;
- protected procedure SetContainmentsAllowed ( AValue : Boolean ) ; virtual;
- protected function GetMinContainerHeight ( ) : Single ; virtual;
- protected procedure SetMinContainerHeight ( AValue : Single ) ; virtual;
- protected function GetLineColor ( ) : TAlphaColor ; virtual;
- protected procedure DoOnSetup ( ) ; virtual;
- protected function FindComponentByClassAndTag ( const AClass : TClass; const ATag : Integer = $0 ) : TComponent ;
- protected procedure DoOnLinePairNotify ( ASender : TObject; const AItem : PLinePair; AAction : TCollectionNotification ) ;
- protected procedure DoOnDragDrop ( ASender : TObject; const AData : TDragObject; const APoint : TPointF ) ; virtual;
- protected procedure DoOnDragOver ( ASender : TObject; const AData : TDragObject; const APoint : TPointF; var AOperation : TDragOperation ) ; virtual;
- protected procedure DoOnMoveChildPatterns ( const AOfs : TPointF ) ; virtual;
- protected procedure DoOnTranslatePosition ( const AOffset : TPointF ) ; virtual;
- protected procedure DoOnSetAbsolutePosition ( const APoint : TPointF ) ; virtual;
- protected procedure DoOnUpdateLines ( ) ; virtual;
- protected procedure DoOnAdjustHeight ( ) ; virtual;
- protected procedure DoOnSetContainedParent ( const ASource : TFlowChartPattern ) ; virtual;
- protected function AddLineToParent
(
const
AParent :
TControl; const
AColor :
TAlphaColor
)
: PLinePair
;
virtual;
Adds and returns a new line pair from a pattern to a parent pattern.
- protected function GetLinePairIndex
(
const
AChild :
TFlowChartPattern
)
: Integer
;
virtual;
Returns the index of a specific line pair, where the from-value is Self and the to-value is AChild. The method returns -1, if no line pair could be found.
- protected procedure RemoveLinePair
(
const
AChild :
TFlowChartPattern
)
;
virtual;
Removes a specific line pair and the visual line component from this pattern.
- protected procedure UpdateLine
(
const
ALine :
TFlowChartLine; const
AFrom :
TFlowChartPattern; const
ATo :
TFlowChartPattern; const
AColor :
TAlphaColor
)
;
virtual;
Takes a specific line and adjusts the length and rotation of it.
- protected procedure UpdateLineOwners
(
)
;
virtual;
Updates all registered line owners and their lines, because it is possible, that multiple connections exist
- protected procedure UpdateChildLines
(
)
;
virtual;
Updates all lines to child rectangles
- protected function GetAbsolutePosition ( ) : TPointF ; virtual;
- protected function GetDisplayName ( ) : string ; virtual;
- public procedure SetPatternOwner
(
const
AValue :
TComponent
)
;
virtual;
Reset the owner of this component. This method will remove the pattern form the previous pattern and adds it to the submitted component.
- public procedure TranslatePosition
(
const
AOffset :
TPointF
)
;
Updates position of this pattern by a offset. To change the behaviour of this function override the protected method "DoOnTranslatePosition"
- public procedure UpdateAbsolutePosition
(
const
APoint :
TPointF
)
;
Updates the absolute position of this pattern.
- public procedure AdjustHeight
(
)
;
Adjusts the height of a pattern. To overwrite the functionality, override the protected method DoOnAdjustHeight.
- public procedure UpdateLines
(
)
;
Update all connected lines. To change the behaviour of this function override the protected method "DoOnUpdateLines"
- public function GetLinePair
(
const
AChild :
TFlowChartPattern
)
: PLinePair
;
virtual;
Try to find the specific line pair to another pattern.
- public function HasMultipleOwners
(
)
: Boolean
;
virtual;
Checks if more than owner is set in the LineOwners list
- public function CountLineOwners
(
)
: Integer
;
virtual;
Counts the LineOwners and returns the number
- public procedure Setup
(
)
;
Overwrite the DoOnSetup method to initialize your individual extended pattern. Execute Setup() after construction to initialize sub-components. Do not use the constructor for creating sub-components, because on pattern cloning, you will have all components twice.
- public function IsTemplatePattern
(
)
: Boolean
;
virtual;
Checks if a TFlowChartPattern is the template pattern, which will be cloned when a new instance is created.
- public function IsAttachable
(
const
ATemplate :
TFlowChartTemplate
)
: Boolean
;
overload;
Checks if a template is attachable to this pattern.
- public function IsAttachable
(
const
APattern :
TFlowChartPattern
)
: Boolean
;
overload;
Checks if a pattern is attachable to this pattern.
- public function IsAttached
(
const
APattern :
TFlowChartPattern
)
: Boolean
;
Checks if a pattern is already attached to this pattern.
- public function GetAttachedByInstance
(
const
AInst :
TObject
)
: TFlowChartPattern
;
Returns an attached flowchart pattern, where the instance is equal to the submitted instance
- public function IsContainable
(
const
ATemplate :
TFlowChartTemplate
)
: Boolean
;
overload;
Checks if a template can be container child of this pattern.
- public function IsContainable
(
const
APattern :
TFlowChartPattern
)
: Boolean
;
overload;
Checks if a pattern can be container child of this pattern.
- public function IsContained
(
const
APattern :
TFlowChartPattern
)
: Boolean
;
Checks if a pattern is already contained.
- public function GetContainedByInstance
(
const
AInst :
TObject
)
: TFlowChartPattern
;
Returns an contained flowchart pattern, where the instance is equal to the submitted instance
- public procedure AttachPattern
(
const
ASource :
TFlowChartPattern
)
;
virtual;
Attaches a pattern to another pattern.
- public procedure RemoveAttached
(
const
ASource :
TFlowChartPattern
)
;
virtual;
Removes a pattern from another pattern.
- public procedure Detach
(
const
ASource :
TFlowChartPattern
)
;
virtual;
Will remove the pattern from another patterns attach list. Will also remove the line pair and the drawn line.
- public procedure RemoveFromLineOwners
(
)
;
virtual;
Removes this pattern from all owners
- public procedure ClearAttached
(
)
;
virtual;
Will detach all attached patterns.
- public procedure ClearContained
(
)
;
virtual;
Will remove all contained patterns.
- public function CountAttached
(
)
: Integer
;
virtual;
Returns the number of attached patterns.
- public procedure ContainPattern
(
const
ASource :
TFlowChartPattern
)
;
virtual;
Puts a pattern into another pattern.
- public procedure RemoveContained
(
const
ASource :
TFlowChartPattern
)
;
virtual;
Removes a pattern from the container of another pattern.
- public function CountContained
(
)
: Integer
;
virtual;
Returns the number of contained patterns.
- public procedure AddLineOwner
(
const
APattern :
TFlowChartPattern
)
;
virtual;
Add a pattern as owner of a line to this pattern.
- public procedure RemoveLineOwner
(
const
APattern :
TFlowChartPattern
)
;
virtual;
Remove a pattern as owner of a line to this pattern from LineOwners list.
- public function IsLineOwner
(
const
APattern :
TFlowChartPattern
)
: Boolean
;
virtual;
Checks if a pattern already exists in LineOwners list.
- public function GetLineAnchor
(
const
AKind :
TFlowChartPatternAnchorKind
)
: TPointF
;
Request the default anchor for line attachment. If "UseDefaultAnchors" is set to TRUE, the method will use the default anchor positions. If "UseDefaultAnchors" is set to FALSE and the "Anchors" collection is not empty, the method will search for a matching anchor to this side. If no anchor could be found, the method will return the default anchor for this side.
Properties
- public Index : Integer
- public FlowChart : TFlowChartFrame
Request the owning flow chart. This method is searches upwards for the TFlowChartFrame component. Do not use this property multiple times in your methods, instead store the result as temporary variable.
read GetFlowChart - public Instance : TObject
- public Template : TFlowChartTemplate
- public TagIndex : Integer
- public LineOwners : TObjectList<Gorilla.UI.FlowChart.TFlowChartPattern>
- public Lines : TList<Gorilla.UI.FlowChart.PLinePair>
- public LineColor : TAlphaColor
Returns the line color for this pattern. By default the color comes from the DefaultLineColor of the parent flow chart component.
read GetLineColor - public Attached : TObjectList<Gorilla.UI.FlowChart.TFlowChartPattern>
- public Contained : TObjectList<Gorilla.UI.FlowChart.TFlowChartPattern>
- public DisplayName : string
Represents a name which can be used to identify a pattern visually, f.e. in a treeview
read GetDisplayName - public AbsolutePosition : TPointF
- published UseDefaultAnchors : Boolean
Defines if to use default anchors (left, top, right, bottom). By deactivating this feature, you need to have anchors added!
read FUseDefaultAnchors
write FUseDefaultAnchors - published Anchors : TFlowChartPatternAnchors
- published IsMoveable : Boolean
- published IsDraggable : Boolean
Defines if a pattern is generally draggable for containment or attachments.
read GetIsDraggable
write SetIsDraggable - published CanPostLink : Boolean
- published IsRoot : Boolean
- published MultipleOwners : Boolean
Defines if this pattern can have multiple owners. This property will be checked before attaching and before the OnCanLink and OnCanCreate event is thrown.
read GetMultipleOwners
write SetMultipleOwners - published MultipleAttachments : Boolean
Defines if this pattern allows multiple attached patterns.
read GetMultipleAttachments
write SetMultipleAttachments - published AttachmentsAllowed : Boolean
Defines if this pattern allows attaching patterns in general
read GetAttachmentsAllowed
write SetAttachmentsAllowed - published MultipleContainments : Boolean
Defines if this pattern allows multiple sub patterns.
read GetMultipleContainments
write SetMultipleContainments - published ContainmentsAllowed : Boolean
Defines if this pattern allows sub patterns in general
read GetContainmentsAllowed
write SetContainmentsAllowed - published MinContainerHeight : Single
Defines the minimum height for a container pattern. When the height of the pattern is adjusted this size is set as minimum if contained patterns exist
read GetMinContainerHeight
write SetMinContainerHeight - published Shadow : TShadowEffect
TFlowChartCirclePattern
Custom flow chart pattern containing a rectangle by default.
Ancestors
Members
TFlowChartRectanglePattern
Custom flow chart pattern containing a rectangle by default.
Ancestors
Members
TFlowChartItemPattern
Custom flow chart item pattern containing a header inside of a body section. The header section contains a checkbox, icon and a caption. The body section is extended from custom rectangle pattern.
Ancestors
Members
Fields
- protected FHeader :
TRectangle
- protected FCaption :
TLabel
- protected FCheckBox :
TCheckBox
- protected FIcon :
TImage
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure DoOnSetup ( ) ; override;
- protected function GetHeader ( ) : TRectangle ;
- protected function GetCaption ( ) : TLabel ;
- protected function GetCheckBox ( ) : TCheckBox ;
- protected function GetIcon ( ) : TImage ;
- public procedure SetIconImage
(
const
AImages :
TImageList; const
AIndex :
Integer
)
;
virtual;
Use this method to apply a specific image from the imagelist AImages by an index.
Properties
- public Header : TRectangle
The header rectangle aligned on top of the pattern. This component contains by default a checkbox, icon-image and a label.
read GetHeader - public Caption : TLabel
- public Icon : TImage
- public CheckBox : TCheckBox
TFlowChartContainerPattern
Custom flow chart container pattern containing a header rectangle with a checkbox, icon and label, and in the parent rectangle (extended from TFlowChartRectanglePattern) it contains a label by default.
Ancestors
Members
TFlowChartTemplate
Represents a template for a pattern used inside of the flow chart. This is the logical representation of a class template.
Ancestors
Members
Fields
- protected FOwnerClass :
TClass
- protected FPattern :
TFlowChartPattern
- protected FAttachables :
TFlowChartTemplateList
- protected FContainables :
TFlowChartTemplateList
Methods
- public constructor Create ( ACollection : TCollection ) ;
- public destructor Destroy ( ) ;
- protected function GetAttachables ( ) : TFlowChartTemplateList ;
- protected function GetContainables ( ) : TFlowChartTemplateList ;
- public function IsAttachable
(
const
ATemplate :
TFlowChartTemplate
)
: Boolean
;
Checks if a specific template is attachable to an instance of the specfific template.
- public function IsContainable
(
const
ATemplate :
TFlowChartTemplate
)
: Boolean
;
Checks if a specific template can be put inside of an instance of this pattern.
- public procedure AddContainable
(
const
ATemplate :
TFlowChartTemplate
)
;
Add a template as containable template to this. The added template will be displayed as pattern inside of another pattern. Only if the template is not registered yet in the attachables or containables list yet, it will be added. Otherwise it will throw an exception.
- public procedure RemoveContainable
(
const
ATemplate :
TFlowChartTemplate
)
;
Remove a specific class template from this template.
- public function IsInContainables
(
const
ATemplate :
TFlowChartTemplate
)
: Boolean
;
Checks if a template is already in the containables-list.
- public procedure AddAttachable
(
const
ATemplate :
TFlowChartTemplate
)
;
Add a template as attachable template to this. The added template will be displayed as child pattern of another pattern linked by a line. Only if the template is not registered yet in the attachables or containables list yet, it will be added. Otherwise it will throw an exception.
- public procedure RemoveAttachable
(
const
ATemplate :
TFlowChartTemplate
)
;
Remove an attachable class template.
- public function IsInAttachables
(
const
ATemplate :
TFlowChartTemplate
)
: Boolean
;
Checks if a template is already in the attachables-list.
Properties
- published OwnerClass : TClass
- published Pattern : TFlowChartPattern
- published Attachables : TObjectList<Gorilla.UI.FlowChart.TFlowChartTemplate>
Attachable templates linked to this template. Those templates are displayed as pattern inside of another pattern.
read GetAttachables - published Containables : TObjectList<Gorilla.UI.FlowChart.TFlowChartTemplate>
Containable templates linked to this template. Those templates are displayed as child pattern of another pattern linked by a line.
read GetContainables
TFlowChartTemplates
Represents the list of all available pattern templates.
Ancestors
Members
TFlowChartFrame
Custom flow chart frame, which holds a number of template pattern and is able to build new patterns by those templates.
Ancestors
Members
Fields
- private FFlowChartDocBack :
TRectangle
- private FFlowChartGrid :
TPlotGrid
- private FFlowChartBox :
TScrollBox
- private FFlowChartLogo :
TImage
- private FTemplates :
TFlowChartTemplates
- protected FIsDragging :
Boolean
- protected FMouseDownPos :
TPointF
- protected FDefaultLineColor :
TAlphaColor
- protected FManager :
TComponent
- protected FImageList :
TImageList
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- private function GetTemplates ( ) : TFlowChartTemplates ;
- private procedure SetManager ( const AValue : TComponent ) ;
- protected function DoBuildPattern
(
const
AParent :
TComponent; const
ATemplate :
TFlowChartTemplate; const
AInstance :
TObject
)
: TFlowChartPattern
;
virtual;
Internal method to build a specific pattern by its template object. The method will link the instance and template to this pattern.
- protected procedure DoOnFrameResize
(
ASender :
TObject
)
;
virtual;
Callback function to handle frame resizing.
- protected procedure DoOnFlowChartBoxDragOver
(
ASender :
TObject; const
AData :
TDragObject; const
APoint :
TPointF; var
AOperation :
TDragOperation
)
;
virtual;
Callback function when a template pattern is dragged onto an empty space in the flow chart, or when an existing pattern is dragged on an empty space in the flow chart (to move the pattern).
- protected procedure DoOnFlowChartBoxDragDrop
(
ASender :
TObject; const
AData :
TDragObject; const
APoint :
TPointF
)
;
virtual;
Callback function when a template pattern was dragged onto an empty space in the flow chart, or when an existing pattern was dragged on the flow chart (to a new position).
- public function AddTemplate
(
const
AID :
string; const
APatternTemplate :
TFlowChartPattern; const
AOwnerClass :
TClass
)
: TFlowChartTemplate
;
Add a rectangle as template for a specific class.
- public function BuildPattern
(
const
AParent :
TComponent; const
AInstance :
TObject
)
: TFlowChartPattern
;
overload;
Building a pattern for a specific instance by the instance itself. This method will search the template by the instance class.
- public function BuildPattern
(
const
AParent :
TComponent; const
AID :
string; const
AInstance :
TObject
)
: TFlowChartPattern
;
overload;
Building a pattern for a specific instance by a template id.
- public function BuildPattern
(
const
AParent :
TComponent; const
AOwnerClass :
TClass; const
AInstance :
TObject
)
: TFlowChartPattern
;
overload;
Building a pattern for a specific instance by template class.
- public function BuildPattern
(
const
AParent :
TComponent; const
ATemplate :
TFlowChartTemplate; const
AInstance :
TObject
)
: TFlowChartPattern
;
overload;
Building a pattern for a specific instance by template.
- public procedure Clear
(
)
;
virtual;
Destroys all patterns inside of the flow chart box.
- public function FindPattern
(
const
AInstance :
TObject
)
: TFlowChartPattern
;
virtual;
Tries to find a specific pattern defined by its instance. If the method cannot find any suitable pattern, it returns nil.
- public function GetScrollOffset
(
)
: TPointF
;
virtual;
Returns a point with the x and y offset of the flow chart box scrollbars
Properties
- public FlowChartDocBack : TRectangleread FFlowChartDocBack
- public FlowChartGrid : TPlotGridread FFlowChartGrid
- public FlowChartBox : TScrollBoxread FFlowChartBox
- public FlowChartLogo : TImageread FFlowChartLogo
- public IsDragging : Boolean
- public MouseDownPos : TPointF
- published Templates : TFlowChartTemplatesread GetTemplates
- published DefaultLineColor : TAlphaColor
Default line color used for connection lines between patterns.
read FDefaultLineColor
write FDefaultLineColor - published Manager : TComponent
- published Images : TImageList