Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

QuickGraph: A 100% C# graph library with Graphviz Support.

, 23 Apr 2007
A generic directed graph library with a Graphviz Web Control Bonus!
quickgraph_demo.zip
Release
QuickGraph.dll
QuickGraph.Algorithms.Graphviz.dll
QuickGraph.Representations.dll
QuickGraph.Algorithms.dll
QuickGraphTest.exe
QuickGraph.Web.dll
QuickGraph_doc_v2.1.chm
QuickGraph.Concepts.dll
QuickGraph.Collections.dll
QuickGraph.Predicates.dll
QuickGraph.Exceptions.dll
quickgraph_src.zip
QuickGraph
QuickGraph
Providers
QuickGraph.csproj.user
Untitled.ndoc
QuickGraph.Algorithms
QuickGraph.Algorithms.csproj.user
Search
ShortestPath
Visitors
MaximumFlow
QuickGraph.Algorithms.Graphviz
QuickGraph.Algorithms.Graphviz.csproj.user
Collections
QuickGraph.Collections
QuickGraph.Collections.csproj.user
Collections
QuickGraph.Concepts
QuickGraph.Concepts.csproj.user
Traversals
Modifications
Predicates
Algorithms
Visitors
Providers
QuickGraph.Exceptions
QuickGraph.Exceptions.csproj.user
QuickGraph.Predicates
QuickGraph.Predicates.csproj.user
QuickGraph.Representations
QuickGraph.Representations.csproj.user
QuickGraph.Web
QuickGraph.Web.csproj.user
Controls
Design
bin
Debug
QuickGraph.Web
QuickGraph.Web
QuickGraphNUnit
App.ico
QuickGraphNUnit.csproj.user
GraphConcepts
Generators
Algorithms
Search
QuickGraphTest
App.ico
QuickGraphTest.csproj.user
bin
Debug
filedependency_127157114549330692.dot
fd_noname.PNG
filedependency_127157123413136692.dot
filedependency_127157123413136692.png
filedependency_127157123415941060.dot
filedependency_127157123415941060.png
fd_withnames.PNG
/// QuickGraph Library 
/// 
/// Copyright (c) 2003 Jonathan de Halleux
///
/// This software is provided 'as-is', without any express or implied warranty. 
/// 
/// In no event will the authors be held liable for any damages arising from 
/// the use of this software.
/// Permission is granted to anyone to use this software for any purpose, 
/// including commercial applications, and to alter it and redistribute it 
/// freely, subject to the following restrictions:
///
///		1. The origin of this software must not be misrepresented; 
///		you must not claim that you wrote the original software. 
///		If you use this software in a product, an acknowledgment in the product 
///		documentation would be appreciated but is not required.
///
///		2. Altered source versions must be plainly marked as such, and must 
///		not be misrepresented as being the original software.
///
///		3. This notice may not be removed or altered from any source 
///		distribution.
///		
///		QuickGraph Library HomePage: http://www.dotnetwiki.org
///		Author: Jonathan de Halleux


namespace QuickGraph.Algorithms.Graphviz
{
	using System;
	using System.Drawing;
	using System.Collections;

	/// <summary>
	/// An edge label
	/// </summary>
	public class GraphvizEdgeLabel
	{
		private double m_Angle;
		private double m_Distance;
		private bool m_Float;
		private Color m_FontColor;
		private Font m_Font;
		private String m_Value;

		/// <summary>
		/// Default constructor
		/// </summary>
		public GraphvizEdgeLabel()
		{
			m_Angle = -25.0;
			m_Distance = 1.0;
			m_Float = true;
			m_FontColor = Color.Black;
			m_Font = null;
			m_Value = null;
		}

		/// <summary>
		/// Adds parameters to the list
		/// </summary>
		/// <param name="dic">name-value map</param>
		public void AddParameters(IDictionary dic)
		{
			if (Value == null)
				return;
			dic["label"]=Value;

			if (Angle != -25)
				dic["labelangle"] = Angle;
			if (Distance != 1)
				dic["labeldistance"]=Distance;
			if (!Float)
				dic["labelfloat"]=Float;
			if (Font != null)
			{
				dic["labelfontname"]=Font.Name;
				dic["labelfontsize"]=Font.SizeInPoints;
			}
		}

		#region Properties

		/// <summary>
		/// Label angle
		/// </summary>
		public double Angle
		{
			get
			{
				return m_Angle;
			}
			set
			{
				m_Angle = value;
			}
		}

		/// <summary>
		/// Lable distance
		/// </summary>
		public double Distance
		{
			get
			{
				return m_Distance;
			}
			set
			{
				m_Distance = value;
			}
		}

		/// <summary>
		/// If true, label is floating
		/// </summary>
		public bool Float
		{
			get
			{
				return m_Float;
			}
			set
			{
				m_Float = value;
			}
		}

		/// <summary>
		/// Label font color
		/// </summary>
		public Color FontColor
		{
			get
			{
				return m_FontColor;
			}
			set
			{
				m_FontColor = value;
			}
		}

		/// <summary>
		/// Label font
		/// </summary>
		public Font Font
		{
			get
			{
				return m_Font;
			}
			set
			{
				m_Font=value;
			}
		}

		/// <summary>
		/// Label text
		/// </summary>
		public String Value
		{
			get
			{
				return m_Value;
			}
			set
			{
				m_Value = value;
			}
		}

		#endregion

	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Jonathan de Halleux
Engineer
United States United States
Jonathan de Halleux is Civil Engineer in Applied Mathematics. He finished his PhD in 2004 in the rainy country of Belgium. After 2 years in the Common Language Runtime (i.e. .net), he is now working at Microsoft Research on Pex (http://research.microsoft.com/pex).

| Advertise | Privacy | Mobile
Web03 | 2.8.141022.2 | Last Updated 23 Apr 2007
Article Copyright 2003 by Jonathan de Halleux
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid