Browse Source

ObjecObject graph visualizer - refactored PositionedGraph, preparation for arrows starting at properties, preparation for expanding nodes.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4234 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Martin Koníček 17 years ago
parent
commit
62ad4d6840
  1. 30
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedNode.cs
  2. 39
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedNodeProperty.cs
  3. 44
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/BoxDotFormatter.cs
  4. 74
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/DotFormatter.cs
  5. 13
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/NeatoEdgeRouter.cs
  6. 55
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/RecordDotFormatter.cs
  7. 8
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeEdge.cs
  8. 21
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeLayouter.cs
  9. 50
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeNode.cs
  10. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeNodeLR.cs
  11. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeNodeTB.cs
  12. 5
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectGraph.cs
  13. 10
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectNode.cs

30
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedNode.cs

@ -12,20 +12,39 @@ using System.Windows;
namespace Debugger.AddIn.Visualizers.Graph.Layout namespace Debugger.AddIn.Visualizers.Graph.Layout
{ {
/// <summary> /// <summary>
/// Node with added position information. /// ObjectNode with added position information.
/// </summary> /// </summary>
public class PositionedNode public class PositionedNode
{ {
private ObjectNode objectNode; private ObjectNode objectNode;
/// <summary>
/// Underlying ObjectNode.
/// </summary>
public ObjectNode ObjectNode public ObjectNode ObjectNode
{ {
get { return objectNode; } get { return objectNode; }
} }
public PositionedNode(NodeControl nodeVisualControl, ObjectNode objectNode) private List<PositionedNodeProperty> properties = new List<PositionedNodeProperty>();
public List<PositionedNodeProperty> Properties
{
get
{
return this.properties;
}
}
/// <summary>
/// Creates new PositionedNode.
/// </summary>
/// <param name="objectNode">Underlying ObjectNode.</param>
public PositionedNode(ObjectNode objectNode)
{ {
this.nodeVisualControl = nodeVisualControl;
this.objectNode = objectNode; this.objectNode = objectNode;
this.nodeVisualControl = new NodeControl();
this.nodeVisualControl.GraphNode = this.objectNode; // display
this.nodeVisualControl.Measure(new Size(500, 500));
} }
public double Left { get; set; } public double Left { get; set; }
@ -67,7 +86,10 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
{ {
get get
{ {
return new PositionedEdge[]{}; foreach (PositionedNodeProperty property in this.Properties)
{
yield return property.Edge;
}
} }
} }
} }

39
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedNodeProperty.cs

@ -0,0 +1,39 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// <see cref="ObjectProperty"/> with outgoing <see cref="PositionedEdge"/>.
/// </summary>
public class PositionedNodeProperty
{
/// <summary>
/// Creates new PositionedNodeProperty.
/// </summary>
/// <param name="objectProperty">Underlying <see cref="ObjectProperty"/></param>
public PositionedNodeProperty(ObjectProperty objectProperty)
{
this.objectProperty = objectProperty;
}
private ObjectProperty objectProperty;
/// <summary>
/// Underlying <see cref="ObjectProperty"/>.
/// </summary>
public ObjectProperty ObjectProperty
{
get { return objectProperty; }
}
/// <summary>
/// Edge outgoing from this property to another <see cref="PositionedNode"/>.
/// </summary>
public PositionedEdge Edge { get; set; }
}
}

44
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/BoxDotFormatter.cs

@ -0,0 +1,44 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Text;
using System.Windows;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// <see cref="DotFormatter"/> that treats node as a atomic "box". Edges go from box to box.
/// </summary>
public class BoxDotFormatter : DotFormatter
{
public BoxDotFormatter(PositionedGraph posGraph) : base(posGraph)
{
}
protected override void appendPosNode(PositionedNode node, StringBuilder builder)
{
string nodeName = genId.GetNextId().ToString();
nodeNames[node] = nodeName;
Rect neatoInput = transform.NodeToNeatoInput(node);
string dotFormatNode =
string.Format(formatCulture,
"{0} [pos=\"{1},{2}!\" width=\"{3}\" height=\"{4}\"];",
nodeName, neatoInput.Location.X, neatoInput.Location.Y, neatoInput.Width, neatoInput.Height);
builder.AppendLine(dotFormatNode);
}
protected override void appendPosEdge(PositionedEdge edge, StringBuilder builder)
{
string sourceNodeName = nodeNames[edge.SourceNode];
string targetNodeName = nodeNames[edge.TargetNode];
builder.AppendLine(string.Format("{0} -> {1}", sourceNodeName, targetNodeName));
}
}
}

74
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/DotGraph.cs → src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/DotFormatter.cs

@ -17,24 +17,24 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <summary> /// <summary>
/// Converts <see cref="PositionedGraph/> to Graphviz's string (dot format) and back (from plain format). /// Converts <see cref="PositionedGraph/> to Graphviz's string (dot format) and back (from plain format).
/// </summary> /// </summary>
public class DotGraph public abstract class DotFormatter
{ {
private PositionedGraph posGraph; protected PositionedGraph posGraph;
NeatoPositionTransform transform; protected NeatoPositionTransform transform;
// state (node and edge names) needed for converting back // state (node and edge names) needed for parsing back
private Dictionary<PositionedNode, string> nodeNames = new Dictionary<PositionedNode, string>(); protected Dictionary<PositionedNode, string> nodeNames = new Dictionary<PositionedNode, string>();
private Dictionary<PositionedEdge, string> edgeNames = new Dictionary<PositionedEdge, string>(); protected Dictionary<PositionedEdge, string> edgeNames = new Dictionary<PositionedEdge, string>();
private CultureInfo formatCulture = CultureInfo.GetCultureInfo("en-US"); protected CultureInfo formatCulture = CultureInfo.GetCultureInfo("en-US");
/// <summary> /// <summary>
/// Used for generating node and edge names. /// Used for generating node and edge names.
/// </summary> /// </summary>
private IdGenerator genId = new IdGenerator(); protected IdGenerator genId = new IdGenerator();
public DotGraph(PositionedGraph posGraph) public DotFormatter(PositionedGraph posGraph)
{ {
if (posGraph.Nodes.Count() == 0) if (posGraph.Nodes.Count() == 0)
{ {
@ -44,54 +44,33 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
this.transform = new NeatoPositionTransform(this.posGraph.BoundingRect); this.transform = new NeatoPositionTransform(this.posGraph.BoundingRect);
} }
protected abstract void appendPosNode(PositionedNode node, StringBuilder builder);
protected abstract void appendPosEdge(PositionedEdge edge, StringBuilder builder);
/// <summary> /// <summary>
/// Gets Graphviz's dot format string for the positioned graph. /// Gets Graphviz's dot format string for wrapped positioned graph.
/// </summary> /// </summary>
public string DotGraphString public string OutputGraphInDotFormat()
{ {
get StringBuilder dotStringBuilder = new StringBuilder("digraph G { node [shape = box];");
foreach (PositionedNode posNode in this.posGraph.Nodes)
{ {
StringBuilder dotStringBuilder = new StringBuilder("digraph G { node [shape = box];"); appendPosNode(posNode, dotStringBuilder);
}
foreach (PositionedNode posNode in this.posGraph.Nodes) foreach (PositionedEdge posEdge in this.posGraph.Edges)
{ {
appendPosNode(posNode, dotStringBuilder); appendPosEdge(posEdge, dotStringBuilder);
}
foreach (PositionedEdge posEdge in this.posGraph.Edges)
{
appendPosEdge(posEdge, dotStringBuilder);
}
dotStringBuilder.AppendLine("}");
return dotStringBuilder.ToString();
} }
}
private void appendPosNode(PositionedNode node, StringBuilder builder)
{
string nodeName = genId.GetNextId().ToString();
nodeNames[node] = nodeName;
Rect neatoInput = transform.NodeToNeatoInput(node);
string dotFormatNode =
string.Format(formatCulture,
"{0} [pos=\"{1},{2}!\" width=\"{3}\" height=\"{4}\"];",
nodeName, neatoInput.Location.X, neatoInput.Location.Y, neatoInput.Width, neatoInput.Height);
builder.AppendLine(dotFormatNode);
}
private void appendPosEdge(PositionedEdge edge, StringBuilder builder)
{
string sourceNodeName = nodeNames[edge.SourceNode];
string targetNodeName = nodeNames[edge.TargetNode];
builder.AppendLine(string.Format("{0} -> {1}", sourceNodeName, targetNodeName)); dotStringBuilder.AppendLine("}");
return dotStringBuilder.ToString();
} }
private bool validateSplinePoints(PositionedEdge edge) private bool validateSplinePoints(PositionedEdge edge)
{ {
// must have correct number of points: one start point and 3 points for every bezier segment // must have correct number of points: one start point and 3 points per bezier segment
return ((edge.SplinePoints.Count - 1) % 3) == 0; return ((edge.SplinePoints.Count - 1) % 3) == 0;
} }
@ -112,6 +91,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
transform.NeatoShiftX = neatoFirstNodePos.X - firstNodePosOur.X; transform.NeatoShiftX = neatoFirstNodePos.X - firstNodePosOur.X;
transform.NeatoShiftY = neatoFirstNodePos.Y - firstNodePosOur.Y; transform.NeatoShiftY = neatoFirstNodePos.Y - firstNodePosOur.Y;
// assume that edges on output are in the same order as posGraph.Edges (!)
foreach (PositionedEdge posEdge in posGraph.Edges) foreach (PositionedEdge posEdge in posGraph.Edges)
{ {
skipAfterPattern(reader, "edge "); skipAfterPattern(reader, "edge ");

13
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/NeatoEdgeRouter.cs

@ -30,14 +30,19 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <returns><see cref="PositionedGraph" /> with preserved node positions and calculated edge positions.</returns> /// <returns><see cref="PositionedGraph" /> with preserved node positions and calculated edge positions.</returns>
public PositionedGraph CalculateEdges(PositionedGraph graphWithNodesPositioned) public PositionedGraph CalculateEdges(PositionedGraph graphWithNodesPositioned)
{ {
DotGraph dotGraph = new DotGraph(graphWithNodesPositioned); DotFormatter dotFormatter = new RecordDotFormatter(graphWithNodesPositioned);
// start Neato.exe
NeatoProcess neatoProcess = NeatoProcess.Start(); NeatoProcess neatoProcess = NeatoProcess.Start();
// convert PosGraph to .dot string, pass to neato.exe
string dotGraphStringWithPositions = neatoProcess.CalculatePositions(dotGraph.DotGraphString); // convert PosGraph to .dot string
string dotGraphString = dotFormatter.OutputGraphInDotFormat();
// pass to neato.exe
string dotGraphStringWithPositions = neatoProcess.CalculatePositions(dotGraphString);
// parse edge positions from neato's plain output format // parse edge positions from neato's plain output format
PositionedGraph result = dotGraph.ParseEdgePositions(dotGraphStringWithPositions); PositionedGraph result = dotFormatter.ParseEdgePositions(dotGraphStringWithPositions);
return result; return result;
} }

55
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/RecordDotFormatter.cs

@ -0,0 +1,55 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Text;
using System.Windows;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// <see cref="DotFormatter"/> that treats nodes as records of properties.
/// Edges start at property, end at node.
/// </summary>
public class RecordDotFormatter : DotFormatter
{
public RecordDotFormatter(PositionedGraph posGraph) : base(posGraph)
{
}
protected override void appendPosNode(PositionedNode node, StringBuilder builder)
{
string nodeName = genId.GetNextId().ToString();
nodeNames[node] = nodeName;
Rect neatoInput = transform.NodeToNeatoInput(node);
/*LEFT [
pos="0,0!"
width="1", height="1"
label = "<f0> a| <f1> b| <f2> c|<f3>d"];*/
StringBuilder recordLabel = new StringBuilder();
string dotFormatNode =
string.Format(formatCulture,
"{0} [pos=\"{1},{2}!\" width=\"{3}\" height=\"{4}\" label=\"{5}\"];",
nodeName,
neatoInput.Location.X, neatoInput.Location.Y, neatoInput.Width, neatoInput.Height,
recordLabel.ToString());
builder.AppendLine(dotFormatNode);
}
protected override void appendPosEdge(PositionedEdge edge, StringBuilder builder)
{
string sourceNodeName = nodeNames[edge.SourceNode];
string targetNodeName = nodeNames[edge.TargetNode];
builder.AppendLine(string.Format("{0} -> {1}", sourceNodeName, targetNodeName));
}
}
}

8
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeEdge.cs

@ -9,9 +9,13 @@ using System;
namespace Debugger.AddIn.Visualizers.Graph.Layout namespace Debugger.AddIn.Visualizers.Graph.Layout
{ {
/// <summary> /// <summary>
/// Description of TreeEdge. /// Edge in the tree-layouted <see cref="PositionedGraph"/>.
/// </summary> /// </summary>
public class TreeEdge : PositionedEdge public class TreeGraphEdge : PositionedEdge
{ {
/// <summary>
/// Is this a main edges making up the tree?
/// </summary>
public bool IsTreeEdge { get; set; }
} }
} }

21
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeLayouter.cs

@ -57,11 +57,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
{ {
seenNodes.Add(objectGraphNode, null); seenNodes.Add(objectGraphNode, null);
NodeControl nodeVisualControl = new NodeControl(); TreeNode newTreeNode = TreeNode.Create(this.layoutDirection, objectGraphNode);
nodeVisualControl.GraphNode = objectGraphNode;
nodeVisualControl.Measure(new Size(500, 500));
TreeNode newTreeNode = TreeNode.Create(this.layoutDirection, nodeVisualControl, objectGraphNode);
newTreeNode.HorizontalMargin = horizNodeMargin; newTreeNode.HorizontalMargin = horizNodeMargin;
newTreeNode.VerticalMargin = vertNodeMargin; newTreeNode.VerticalMargin = vertNodeMargin;
resultGraph.nodes.Add(newTreeNode); resultGraph.nodes.Add(newTreeNode);
@ -73,17 +69,22 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
if (property.TargetNode != null) if (property.TargetNode != null)
{ {
ObjectNode neighbor = property.TargetNode; ObjectNode neighbor = property.TargetNode;
TreeNode targetTreeNode = null;
bool newEdgeIsTreeEdge = false;
if (seenNodes.ContainsKey(neighbor)) if (seenNodes.ContainsKey(neighbor))
{ {
newTreeNode.AdditionalNeighbors.Add(new TreeEdge { Name = property.Name, SourceNode = newTreeNode, TargetNode = treeNodeFor[neighbor]}); targetTreeNode = treeNodeFor[neighbor];
newEdgeIsTreeEdge = false;
} }
else else
{ {
TreeNode newChild = buildTreeRecursive(neighbor); targetTreeNode = buildTreeRecursive(neighbor);
newTreeNode.ChildEdges.Add(new TreeEdge { Name = property.Name, SourceNode = newTreeNode, TargetNode = newChild}); newEdgeIsTreeEdge = true;
subtreeSize += targetTreeNode.SubtreeSize;
subtreeSize += newChild.SubtreeSize;
} }
var posNodeProperty = new PositionedNodeProperty(property);
posNodeProperty.Edge = new TreeGraphEdge { IsTreeEdge = newEdgeIsTreeEdge, Name = property.Name, SourceNode = newTreeNode, TargetNode = targetTreeNode };
newTreeNode.Properties.Add(posNodeProperty);
} }
} }
subtreeSize = Math.Max(newTreeNode.LateralSizeWithMargin, subtreeSize); subtreeSize = Math.Max(newTreeNode.LateralSizeWithMargin, subtreeSize);

50
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeNode.cs

@ -11,18 +11,19 @@ using Debugger.AddIn.Visualizers.Graph.Drawing;
namespace Debugger.AddIn.Visualizers.Graph.Layout namespace Debugger.AddIn.Visualizers.Graph.Layout
{ {
/// <summary> /// <summary>
/// Abstract ancestor of TreeNodeLR and TreeNodeTB. /// Node in tree-layouted <see cref="PositionedGraph"/>.
/// This is the abstract ancestor of TreeNodeLR and TreeNodeTB.
/// There are 2 dimensions - "main" and "lateral". /// There are 2 dimensions - "main" and "lateral".
/// Main dimension is the dimension in which the graph depth grows (vertical when TB, horizontal when LR). /// Main dimension is the dimension in which the graph depth grows (vertical when TB, horizontal when LR).
/// Lateral dimension is the other dimension. Siblings are placed next to each other in Lateral dimension. /// Lateral dimension is the other dimension. Siblings are placed next to each other in Lateral dimension.
/// </summary> /// </summary>
public abstract class TreeNode : PositionedNode public abstract class TreeNode : PositionedNode
{ {
public static TreeNode Create(LayoutDirection direction, NodeControl nodeVisualControl, ObjectNode objectNode) public static TreeNode Create(LayoutDirection direction, ObjectNode objectNode)
{ {
switch (direction) { switch (direction) {
case LayoutDirection.TopBottom: return new TreeNodeTB(nodeVisualControl, objectNode); case LayoutDirection.TopBottom: return new TreeNodeTB(objectNode);
case LayoutDirection.LeftRight: return new TreeNodeLR(nodeVisualControl, objectNode); case LayoutDirection.LeftRight: return new TreeNodeLR(objectNode);
default: throw new DebuggerVisualizerException("Unsupported layout direction: " + direction.ToString()); default: throw new DebuggerVisualizerException("Unsupported layout direction: " + direction.ToString());
} }
} }
@ -30,7 +31,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
public double HorizontalMargin { get; set; } public double HorizontalMargin { get; set; }
public double VerticalMargin { get; set; } public double VerticalMargin { get; set; }
protected TreeNode(NodeControl nodeVisualControl, ObjectNode objectNode) : base(nodeVisualControl, objectNode) protected TreeNode(ObjectNode objectNode) : base(objectNode)
{ {
} }
@ -51,12 +52,17 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
public abstract double MainMargin { get; } public abstract double MainMargin { get; }
public abstract double LateralMargin { get; } public abstract double LateralMargin { get; }
private List<TreeEdge> childs = new List<TreeEdge>(); public IEnumerable<PositionedEdge> ChildEdges
public List<TreeEdge> ChildEdges
{ {
get get
{ {
return childs; foreach (TreeGraphEdge childEdge in Edges)
{
if (childEdge.IsTreeEdge)
{
yield return childEdge;
}
}
} }
} }
@ -64,28 +70,8 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
{ {
get get
{ {
foreach (TreeEdge childEdge in ChildEdges) foreach (PositionedEdge outEdge in this.ChildEdges)
yield return (TreeNode)childEdge.TargetNode; yield return (TreeNode)outEdge.TargetNode;
}
}
private List<TreeEdge> additionalNeighbors = new List<TreeEdge>();
public List<TreeEdge> AdditionalNeighbors
{
get
{
return additionalNeighbors;
}
}
public override IEnumerable<PositionedEdge> Edges
{
get
{
foreach (TreeEdge childEdge in ChildEdges)
yield return childEdge;
foreach (TreeEdge neighborEdge in AdditionalNeighbors)
yield return neighborEdge;
} }
} }
} }

2
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeNodeLR.cs

@ -14,7 +14,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// </summary> /// </summary>
public class TreeNodeLR: TreeNode public class TreeNodeLR: TreeNode
{ {
public TreeNodeLR(NodeControl nodeControl, ObjectNode objectNode) : base(nodeControl, objectNode) public TreeNodeLR(ObjectNode objectNode) : base(objectNode)
{ {
} }

2
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeNodeTB.cs

@ -14,7 +14,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// </summary> /// </summary>
public class TreeNodeTB : TreeNode public class TreeNodeTB : TreeNode
{ {
public TreeNodeTB(NodeControl nodeControl, ObjectNode objectNode) : base(nodeControl, objectNode) public TreeNodeTB(ObjectNode objectNode) : base(objectNode)
{ {
} }

5
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectGraph.cs

@ -37,11 +37,12 @@ namespace Debugger.AddIn.Visualizers.Graph
{ {
get { return _nodes; } get { return _nodes; }
} }
/*
/// <summary> /// <summary>
/// All edges in the graph. /// All edges in the graph.
/// </summary> /// </summary>
/*public IEnumerable<ObjectEdge> Edges public IEnumerable<ObjectEdge> Edges
{ {
get get
{ {

10
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/ObjectGraph/ObjectNode.cs

@ -51,7 +51,7 @@ namespace Debugger.AddIn.Visualizers.Graph
private bool sorted = false; private bool sorted = false;
private List<ObjectProperty> _properties = new List<ObjectProperty>(); private List<ObjectProperty> properties = new List<ObjectProperty>();
/// <summary> /// <summary>
/// Properties (either atomic or complex) of the object this node represents. /// Properties (either atomic or complex) of the object this node represents.
/// </summary> /// </summary>
@ -61,10 +61,10 @@ namespace Debugger.AddIn.Visualizers.Graph
{ {
if (!sorted) if (!sorted)
{ {
_properties.Sort(propertySortComparer); properties.Sort(propertySortComparer);
sorted = true; sorted = true;
} }
return _properties; return properties;
} }
} }
/// <summary> /// <summary>
@ -87,7 +87,7 @@ namespace Debugger.AddIn.Visualizers.Graph
/// </summary> /// </summary>
internal void AddAtomicProperty(string name, string value, Expression expression) internal void AddAtomicProperty(string name, string value, Expression expression)
{ {
_properties.Add(new ObjectProperty properties.Add(new ObjectProperty
{ Name = name, Value = value, Expression = expression, IsAtomic = true, TargetNode = null }); { Name = name, Value = value, Expression = expression, IsAtomic = true, TargetNode = null });
} }
@ -96,7 +96,7 @@ namespace Debugger.AddIn.Visualizers.Graph
/// </summary> /// </summary>
internal void AddComplexProperty(string name, string value, Expression expression, ObjectNode targetNode) internal void AddComplexProperty(string name, string value, Expression expression, ObjectNode targetNode)
{ {
_properties.Add(new ObjectProperty properties.Add(new ObjectProperty
{ Name = name, Value = value, Expression = expression, IsAtomic = false, TargetNode = targetNode }); { Name = name, Value = value, Expression = expression, IsAtomic = false, TargetNode = targetNode });
} }
} }

Loading…
Cancel
Save