We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Need code to address Link,MakeOrthogonal

Thread ID:

Created:

Platform:

Replies:

69635 Nov 6,2007 05:02 AM Windows Forms 0
loading
Tags: FAQ
Priyatharcini
Asked On November 6, 2007 05:02 AM

We have developed an organisation chart using Syncfusion diagram in version 4. Now, that was migrated. Following codes needs to be change. Please let update the following code to support v5 '************************************************************************************* #Region "Imports" Imports Syncfusion.Windows.Forms.Diagram #End Region Public Class MyLink Inherits Link #Region "Methods" '***************************************************************************************** 'Function Name : New 'Desc : This will be called on creating an new instance of this class, where it takes the ' point of Parent and Child node to be linked 'Created on : 7th September 2007 '***************************************************************************************** Public Sub New(ByVal ParentPoint As PointF, ByVal ChildPoint As PointF) Try Me.CalculatePoints(ParentPoint, ChildPoint) Catch ex As Exception Throw ex End Try End Sub '****************************************************************************************** 'Function Name : CalculatePoints 'Desc : It calculates the points through whick the link has to pass through. It takes Parent ' and Child points to be linked as input parameter. Since link is orthogonal the other ' two point lie in Mid of parent and child which is calculated from Y axis. 'Created on : 7th September 2007 '****************************************************************************************** Private Function CalculatePoints(ByVal ptParentPoint As PointF, ByVal ptChildPoint As PointF) As Boolean Dim intMidPoint As Integer Dim intPoints(3) As PointF Dim ptParentMidPoint As PointF Dim ptChildMidPoint As PointF Try intMidPoint = (ptChildPoint.Y - ptParentPoint.Y) / 2 intMidPoint = (ptParentPoint.Y + intMidPoint) ptParentMidPoint = New PointF(ptParentPoint.X, intMidPoint) ptChildMidPoint = New PointF(ptChildPoint.X, intMidPoint) intPoints(0) = ptParentPoint intPoints(1) = ptParentMidPoint intPoints(2) = ptChildMidPoint intPoints(3) = ptChildPoint Me.AddLink(intPoints) Catch ex As Exception Throw ex End Try End Function '********************************************************************************************** 'Function Name : AddLink 'Desc : Used to create the Orthogonal Link, it takes the points through which link have to pass ' as input based on the points it will generate the link 'Created on : 7th September 2007 '********************************************************************************************** Private Function AddLink(ByVal Points() As PointF) As Boolean Dim objline As Object Dim linkPoints As IPoints Dim objShape As Shape Dim childNode As INode Dim objMakeOrthogonal As New OrthogonalLine Try objline = New OrthogonalLine(objMakeOrthogonal.MakeOrthogonal(Points)) objShape = objline objShape.SetPoints(Points) linkPoints = objShape childNode = CType(IIf(TypeOf linkPoints Is INode, linkPoints, Nothing), INode) If Not childNode Is Nothing Then Me.InsertChild(childNode, 0) End If Catch ex As Exception Throw ex End Try End Function #End Region End Class

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;