Browse Source

Refactoring - renames.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4363 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Martin Koníček 17 years ago
parent
commit
61a4278c9c
  1. 15
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.csproj
  2. 10
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Drawing/GraphDrawer.cs
  3. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Drawing/NodeControl.xaml.cs
  4. 7
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml
  5. 29
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml.cs
  6. 22
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/GraphDiff.cs
  7. 24
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/GraphMatcher.cs
  8. 20
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/NestedNodeViewModel.cs
  9. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedEdge.cs
  10. 8
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedGraph.cs
  11. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedGraphNode.cs
  12. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedNodeProperty.cs
  13. 20
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PropertyNodeViewModel.cs
  14. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/BoxDotFormatter.cs
  15. 8
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/DotFormatter.cs
  16. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/NeatoPositionTransform.cs
  17. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/RecordDotFormatter.cs
  18. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeEdge.cs
  19. 10
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeGraphNode.cs
  20. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeGraphNodeLR.cs
  21. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeGraphNodeTB.cs
  22. 16
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeLayouter.cs

15
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.csproj

@ -128,6 +128,12 @@ @@ -128,6 +128,12 @@
<Compile Include="Src\Visualizers\Common\VirtualizingCollection.cs" />
<Compile Include="Src\Visualizers\Common\VirtualizingObservableCollection.cs" />
<Compile Include="Src\Visualizers\Controls\DragScrollViewer.cs" />
<Compile Include="Src\Visualizers\Graph\Drawing\PositionedGraphNodeControl.xaml.cs">
<DependentUpon>PositionedGraphNodeControl.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\Visualizers\Graph\Layout\PropertyNodeViewModel.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\NestedNodeViewModel.cs" />
<Compile Include="Src\Visualizers\Graph\ObjectGraph\NamedEdge.cs" />
<Compile Include="Src\Visualizers\Graph\TreeModel\AbstractNode.cs" />
<Compile Include="Src\Visualizers\Graph\TreeModel\NestedNode.cs" />
@ -189,7 +195,7 @@ @@ -189,7 +195,7 @@
<Compile Include="Src\Visualizers\Graph\Layout\GraphMatcher.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\PositionedEdge.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\PositionedGraph.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\PositionedNode.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\PositionedGraphNode.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\PositionedNodeProperty.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\PositionedPropertyEventArgs.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\Tree\BoxDotFormatter.cs" />
@ -203,9 +209,9 @@ @@ -203,9 +209,9 @@
<Compile Include="Src\Visualizers\Graph\Layout\Tree\RecordDotFormatter.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\Tree\TreeEdge.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\Tree\TreeLayouter.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\Tree\TreeNode.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\Tree\TreeNodeLR.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\Tree\TreeNodeTB.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\Tree\TreeGraphNode.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\Tree\TreeGraphNodeLR.cs" />
<Compile Include="Src\Visualizers\Graph\Layout\Tree\TreeGraphNodeTB.cs" />
<Compile Include="Src\Visualizers\Graph\ObjectGraph\ObjectGraph.cs" />
<Compile Include="Src\Visualizers\Graph\ObjectGraph\ObjectGraphBuilder.cs" />
<Compile Include="Src\Visualizers\Graph\ObjectGraph\ObjectGraphNode.cs" />
@ -295,6 +301,7 @@ @@ -295,6 +301,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Src\Visualizers\Graph\Drawing\PositionedGraphNodeControl.xaml" />
<Page Include="Src\Visualizers\GridVisualizer\GridVisualizerWindow.xaml" />
<ProjectReference Include="..\..\..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>

10
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Drawing/GraphDrawer.cs

@ -68,18 +68,18 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -68,18 +68,18 @@ namespace Debugger.AddIn.Visualizers.Graph
addEdgeToCanvas(edge).BeginAnimation(UIElement.OpacityProperty, fadeInAnim);
}
foreach (PositionedNode removedNode in diff.RemovedNodes)
foreach (PositionedGraphNode removedNode in diff.RemovedNodes)
{
removedNode.NodeVisualControl.BeginAnimation(UIElement.OpacityProperty, fadeOutAnim);
}
foreach (PositionedNode addedNode in diff.AddedNodes)
foreach (PositionedGraphNode addedNode in diff.AddedNodes)
{
addNodeToCanvas(addedNode).BeginAnimation(UIElement.OpacityProperty, fadeInAnim);
}
bool first = true;
foreach (PositionedNode node in diff.ChangedNodes)
foreach (PositionedGraphNode node in diff.ChangedNodes)
{
var newNode = diff.GetMatchingNewNode(node);
@ -110,7 +110,7 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -110,7 +110,7 @@ namespace Debugger.AddIn.Visualizers.Graph
canvas.Children.Clear();
// draw nodes
foreach (PositionedNode node in posGraph.Nodes)
foreach (PositionedGraphNode node in posGraph.Nodes)
{
addNodeToCanvas(node);
}
@ -122,7 +122,7 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -122,7 +122,7 @@ namespace Debugger.AddIn.Visualizers.Graph
}
}
private NodeControl addNodeToCanvas(PositionedNode node)
private NodeControl addNodeToCanvas(PositionedGraphNode node)
{
canvas.Children.Add(node.NodeVisualControl);
Canvas.SetLeft(node.NodeVisualControl, node.Left);

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Drawing/NodeControl.xaml.cs

@ -30,7 +30,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing @@ -30,7 +30,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing
/// Creates new NodeControl displaying PositionedNode.
/// </summary>
/// <param name="graphNode">PositionedNode displayed by the control.</param>
public NodeControl(PositionedNode graphNode) : this()
public NodeControl(PositionedGraphNode graphNode) : this()
{
//this.initializeWithGraphNode(graphNode);
this.GraphNode = graphNode;
@ -44,11 +44,11 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing @@ -44,11 +44,11 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing
public event EventHandler<PositionedPropertyEventArgs> Expanded;
public event EventHandler<PositionedPropertyEventArgs> Collapsed;
private PositionedNode node;
private PositionedGraphNode node;
/// <summary>
/// ObjectNode that this control displays.
/// </summary>
public PositionedNode GraphNode
public PositionedGraphNode GraphNode
{
get
{

7
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
<UserControl x:Class="Debugger.AddIn.Visualizers.Graph.Drawing.PositionedGraphNodeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
</Grid>
</UserControl>

29
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Drawing/PositionedGraphNodeControl.xaml.cs

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
// <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.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
namespace Debugger.AddIn.Visualizers.Graph.Drawing
{
/// <summary>
/// Interaction logic for PositionedGraphNodeControl.xaml
/// </summary>
public partial class PositionedGraphNodeControl : UserControl
{
public PositionedGraphNodeControl()
{
InitializeComponent();
}
}
}

22
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/GraphDiff.cs

@ -16,15 +16,15 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -16,15 +16,15 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// </summary>
public class GraphDiff
{
private List<PositionedNode> addedNodes = new List<PositionedNode>();
private List<PositionedNode> deletedNodes = new List<PositionedNode>();
private List<PositionedNode> changedNodes = new List<PositionedNode>();
private Dictionary<PositionedNode, PositionedNode> matching = new Dictionary<PositionedNode, PositionedNode>();
private List<PositionedGraphNode> addedNodes = new List<PositionedGraphNode>();
private List<PositionedGraphNode> deletedNodes = new List<PositionedGraphNode>();
private List<PositionedGraphNode> changedNodes = new List<PositionedGraphNode>();
private Dictionary<PositionedGraphNode, PositionedGraphNode> matching = new Dictionary<PositionedGraphNode, PositionedGraphNode>();
/// <summary>
/// Nodes in the new graph that were added.
/// </summary>
public IList<PositionedNode> AddedNodes
public IList<PositionedGraphNode> AddedNodes
{
get { return addedNodes.AsReadOnly(); }
}
@ -32,7 +32,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -32,7 +32,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <summary>
/// Nodes in the old graph that were removed.
/// </summary>
public IList<PositionedNode> RemovedNodes
public IList<PositionedGraphNode> RemovedNodes
{
get { return deletedNodes.AsReadOnly(); }
}
@ -41,27 +41,27 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -41,27 +41,27 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// Nodes in the old graph that were chaged.
/// These have matching new nodes, which can be obtained by <see cref="GetMatchingNewNode"/>.
/// </summary>
public IList<PositionedNode> ChangedNodes
public IList<PositionedGraphNode> ChangedNodes
{
get { return changedNodes.AsReadOnly(); }
}
public PositionedNode GetMatchingNewNode(PositionedNode oldNode)
public PositionedGraphNode GetMatchingNewNode(PositionedGraphNode oldNode)
{
return matching.GetValue(oldNode);
}
internal void SetAdded(PositionedNode addedNode)
internal void SetAdded(PositionedGraphNode addedNode)
{
addedNodes.Add(addedNode);
}
internal void SetRemoved(PositionedNode removeddNode)
internal void SetRemoved(PositionedGraphNode removeddNode)
{
deletedNodes.Add(removeddNode);
}
internal void SetMatching(PositionedNode matchFrom, PositionedNode matchTo)
internal void SetMatching(PositionedGraphNode matchFrom, PositionedGraphNode matchTo)
{
matching[matchFrom] = matchTo;
changedNodes.Add(matchFrom);

24
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/GraphMatcher.cs

@ -31,7 +31,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -31,7 +31,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
else
{
GraphDiff addAllDiff = new GraphDiff();
foreach (PositionedNode newNode in newGraph.Nodes)
foreach (PositionedGraphNode newNode in newGraph.Nodes)
{
addAllDiff.SetAdded(newNode);
}
@ -42,12 +42,12 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -42,12 +42,12 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
// both graph are not null
GraphDiff diff = new GraphDiff();
Dictionary<int, PositionedNode> newNodeForHashCode = buildHashToNodeMap(newGraph);
Dictionary<PositionedNode, bool> newNodeMatched = new Dictionary<PositionedNode, bool>();
Dictionary<int, PositionedGraphNode> newNodeForHashCode = buildHashToNodeMap(newGraph);
Dictionary<PositionedGraphNode, bool> newNodeMatched = new Dictionary<PositionedGraphNode, bool>();
foreach (PositionedNode oldNode in oldGraph.Nodes)
foreach (PositionedGraphNode oldNode in oldGraph.Nodes)
{
PositionedNode matchingNode = matchNode(oldNode, newNodeForHashCode);
PositionedGraphNode matchingNode = matchNode(oldNode, newNodeForHashCode);
if (matchingNode != null)
{
diff.SetMatching(oldNode, matchingNode);
@ -58,7 +58,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -58,7 +58,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
diff.SetRemoved(oldNode);
}
}
foreach (PositionedNode newNode in newGraph.Nodes)
foreach (PositionedGraphNode newNode in newGraph.Nodes)
{
if (!newNodeMatched.ContainsKey(newNode))
{
@ -69,19 +69,19 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -69,19 +69,19 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
return diff;
}
private Dictionary<int, PositionedNode> buildHashToNodeMap(PositionedGraph graph)
private Dictionary<int, PositionedGraphNode> buildHashToNodeMap(PositionedGraph graph)
{
var hashToNodeMap = new Dictionary<int, PositionedNode>();
foreach (PositionedNode node in graph.Nodes)
var hashToNodeMap = new Dictionary<int, PositionedGraphNode>();
foreach (PositionedGraphNode node in graph.Nodes)
{
hashToNodeMap[node.ObjectNode.HashCode] = node;
}
return hashToNodeMap;
}
private PositionedNode matchNode(PositionedNode oldNode, Dictionary<int, PositionedNode> newNodeMap)
private PositionedGraphNode matchNode(PositionedGraphNode oldNode, Dictionary<int, PositionedGraphNode> newNodeMap)
{
PositionedNode newNodeFound = newNodeMap.GetValue(oldNode.ObjectNode.HashCode);
PositionedGraphNode newNodeFound = newNodeMap.GetValue(oldNode.ObjectNode.HashCode);
if ((newNodeFound != null) && isSameAddress(oldNode, newNodeFound))
{
return newNodeFound;
@ -92,7 +92,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -92,7 +92,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
}
}
private bool isSameAddress(PositionedNode node1, PositionedNode node2)
private bool isSameAddress(PositionedGraphNode node1, PositionedGraphNode node2)
{
return node1.ObjectNode.PermanentReference.GetObjectAddress() == node2.ObjectNode.PermanentReference.GetObjectAddress();
}

20
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/NestedNodeViewModel.cs

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
// <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>
/// Description of TreeNodeViewModel.
/// </summary>
public class NestedNodeViewModel
{
public NestedNodeViewModel()
{
}
}
}

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

@ -14,7 +14,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -14,7 +14,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <summary>
/// Edge with position information.
/// </summary>
public class PositionedEdge : NamedEdge<PositionedNodeProperty, PositionedNode>
public class PositionedEdge : NamedEdge<PositionedNodeProperty, PositionedGraphNode>
{
private IList<Point> splinePoints = new List<Point>();

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

@ -16,7 +16,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -16,7 +16,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// </summary>
public class PositionedGraph
{
private List<PositionedNode> nodes = new List<PositionedNode>();
private List<PositionedGraphNode> nodes = new List<PositionedGraphNode>();
public System.Windows.Rect BoundingRect
{
@ -34,12 +34,12 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -34,12 +34,12 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <summary>
/// All nodes in the graph.
/// </summary>
public IEnumerable<PositionedNode> Nodes
public IEnumerable<PositionedGraphNode> Nodes
{
get { return nodes; }
}
internal void AddNode(PositionedNode node)
internal void AddNode(PositionedGraphNode node)
{
this.nodes.Add(node);
}
@ -51,7 +51,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -51,7 +51,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
{
get
{
foreach (PositionedNode node in this.Nodes)
foreach (PositionedGraphNode node in this.Nodes)
{
foreach (PositionedEdge edge in node.Edges)
{

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedNode.cs → src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PositionedGraphNode.cs

@ -14,7 +14,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -14,7 +14,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <summary>
/// ObjectNode with added position information.
/// </summary>
public class PositionedNode
public class PositionedGraphNode
{
private ObjectGraphNode objectNode;
/// <summary>
@ -51,7 +51,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -51,7 +51,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// Creates new PositionedNode.
/// </summary>
/// <param name="objectNode">Underlying ObjectNode.</param>
public PositionedNode(ObjectGraphNode objectNode)
public PositionedGraphNode(ObjectGraphNode objectNode)
{
this.objectNode = objectNode;

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

@ -17,7 +17,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -17,7 +17,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// Creates new PositionedNodeProperty.
/// </summary>
/// <param name="objectProperty">Underlying <see cref="ObjectProperty"/></param>
public PositionedNodeProperty(ObjectGraphProperty objectProperty, PositionedNode containingNode)
public PositionedNodeProperty(ObjectGraphProperty objectProperty, PositionedGraphNode containingNode)
{
this.objectProperty = objectProperty;
this.containingNode = containingNode;
@ -40,11 +40,11 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -40,11 +40,11 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
get { return this.objectProperty; }
}
private PositionedNode containingNode;
private PositionedGraphNode containingNode;
/// <summary>
/// <see cref="PositionedNode"/> which contains this Property.
/// </summary>
public PositionedNode ContainingNode
public PositionedGraphNode ContainingNode
{
get { return this.containingNode; }
}

20
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/PropertyNodeViewModel.cs

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
// <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>
/// Description of PropertyNodeViewModel.
/// </summary>
public class PropertyNodeViewModel : NestedNodeViewModel
{
public PropertyNodeViewModel()
{
}
}
}

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

@ -19,7 +19,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -19,7 +19,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
{
}
protected override void appendPosNode(PositionedNode node, StringBuilder builder)
protected override void appendPosNode(PositionedGraphNode node, StringBuilder builder)
{
string nodeName = genId.GetNextId().ToString();
nodeNames[node] = nodeName;

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

@ -26,7 +26,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -26,7 +26,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
protected NeatoDoubleFormatter neatoDoubleFormatter = new NeatoDoubleFormatter();
// state (node and edge names) needed for parsing back
protected Dictionary<PositionedNode, string> nodeNames = new Dictionary<PositionedNode, string>();
protected Dictionary<PositionedGraphNode, string> nodeNames = new Dictionary<PositionedGraphNode, string>();
protected Dictionary<PositionedEdge, string> edgeNames = new Dictionary<PositionedEdge, string>();
/// <summary>
@ -44,7 +44,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -44,7 +44,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
this.transform = new NeatoPositionTransform(this.posGraph.BoundingRect);
}
protected abstract void appendPosNode(PositionedNode node, StringBuilder builder);
protected abstract void appendPosNode(PositionedGraphNode node, StringBuilder builder);
protected abstract void appendPosEdge(PositionedEdge edge, StringBuilder builder);
@ -65,7 +65,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -65,7 +65,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
{
StringBuilder dotStringBuilder = new StringBuilder(getGraphHeader());
foreach (PositionedNode posNode in this.posGraph.Nodes)
foreach (PositionedGraphNode posNode in this.posGraph.Nodes)
{
appendPosNode(posNode, dotStringBuilder);
}
@ -95,7 +95,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -95,7 +95,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
{
skipAfterPattern(reader, "node " + nodeNames[posGraph.Nodes.First()] + " ");
Point neatoFirstNodePos = readPoint(reader);
PositionedNode firstNode = posGraph.Nodes.First();
PositionedGraphNode firstNode = posGraph.Nodes.First();
Point firstNodePosOur = transform.AsNeato(firstNode.Center);
// determine how Neato shifted the nodes
transform.NeatoShiftX = neatoFirstNodePos.X - firstNodePosOur.X;

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

@ -61,7 +61,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -61,7 +61,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
return new Point(ourPoint.X * neatoOutputScale / ourInputScale, (graphBoundingRect.Bottom - ourPoint.Y) * neatoOutputScale / ourInputScale);
}
public Rect NodeToNeatoInput(PositionedNode node)
public Rect NodeToNeatoInput(PositionedGraphNode node)
{
// don't transform size
return new Rect(ToNeatoInput(node.Center),

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

@ -28,7 +28,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -28,7 +28,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
return "digraph G { rankdir=LR; node [shape = record];";
}
protected override void appendPosNode(PositionedNode node, StringBuilder builder)
protected override void appendPosNode(PositionedGraphNode node, StringBuilder builder)
{
string nodeName = genId.GetNextId().ToString();
nodeNames[node] = nodeName;

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

@ -14,7 +14,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -14,7 +14,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
public class TreeGraphEdge : PositionedEdge
{
/// <summary>
/// Is this a main edges making up the tree?
/// Is this an edges making up the main tree?
/// </summary>
public bool IsTreeEdge { get; set; }
}

10
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeNode.cs → src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/TreeGraphNode.cs

@ -17,9 +17,9 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -17,9 +17,9 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// 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.
/// </summary>
public abstract class TreeNode : PositionedNode
public abstract class TreeGraphNode : PositionedGraphNode
{
public static TreeNode Create(LayoutDirection direction, ObjectGraphNode objectNode)
public static TreeGraphNode Create(LayoutDirection direction, ObjectGraphNode objectNode)
{
switch (direction) {
case LayoutDirection.TopBottom: return new TreeNodeTB(objectNode);
@ -31,7 +31,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -31,7 +31,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
public double HorizontalMargin { get; set; }
public double VerticalMargin { get; set; }
protected TreeNode(ObjectGraphNode objectNode) : base(objectNode)
protected TreeGraphNode(ObjectGraphNode objectNode) : base(objectNode)
{
}
@ -66,12 +66,12 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -66,12 +66,12 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
}
}
public IEnumerable<TreeNode> Childs
public IEnumerable<TreeGraphNode> Childs
{
get
{
foreach (PositionedEdge outEdge in this.ChildEdges)
yield return (TreeNode)outEdge.Target;
yield return (TreeGraphNode)outEdge.Target;
}
}
}

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

@ -12,7 +12,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -12,7 +12,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <summary>
/// TreeNode used in LR layout mode.
/// </summary>
public class TreeNodeLR: TreeNode
public class TreeNodeLR: TreeGraphNode
{
public TreeNodeLR(ObjectGraphNode objectNode) : base(objectNode)
{

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

@ -12,7 +12,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -12,7 +12,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <summary>
/// TreeNode used in TB layout mode.
/// </summary>
public class TreeNodeTB : TreeNode
public class TreeNodeTB : TreeGraphNode
{
public TreeNodeTB(ObjectGraphNode objectNode) : base(objectNode)
{

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

@ -24,7 +24,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -24,7 +24,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
PositionedGraph resultGraph = null;
Dictionary<ObjectGraphNode, TreeNode> treeNodeFor = new Dictionary<ObjectGraphNode, TreeNode>();
Dictionary<ObjectGraphNode, TreeGraphNode> treeNodeFor = new Dictionary<ObjectGraphNode, TreeGraphNode>();
Dictionary<ObjectGraphNode, object> seenNodes = new Dictionary<ObjectGraphNode, object>();
public TreeLayouter()
@ -41,10 +41,10 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -41,10 +41,10 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
layoutDirection = direction;
resultGraph = new PositionedGraph();
treeNodeFor = new Dictionary<ObjectGraphNode, TreeNode>();
treeNodeFor = new Dictionary<ObjectGraphNode, TreeGraphNode>();
seenNodes = new Dictionary<ObjectGraphNode, object>();
TreeNode tree = buildTreeRecursive(objectGraph.Root, expandedNodes);
TreeGraphNode tree = buildTreeRecursive(objectGraph.Root, expandedNodes);
calculateNodePosRecursive(tree, 0, 0);
var neatoRouter = new NeatoEdgeRouter();
@ -53,11 +53,11 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -53,11 +53,11 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
return resultGraph;
}
private TreeNode buildTreeRecursive(ObjectGraphNode objectGraphNode, ExpandedNodes expandedNodes)
private TreeGraphNode buildTreeRecursive(ObjectGraphNode objectGraphNode, ExpandedNodes expandedNodes)
{
seenNodes.Add(objectGraphNode, null);
TreeNode newTreeNode = TreeNode.Create(this.layoutDirection, objectGraphNode);
TreeGraphNode newTreeNode = TreeGraphNode.Create(this.layoutDirection, objectGraphNode);
newTreeNode.HorizontalMargin = horizNodeMargin;
newTreeNode.VerticalMargin = vertNodeMargin;
resultGraph.AddNode(newTreeNode);
@ -71,7 +71,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -71,7 +71,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
if (property.TargetNode != null)
{
ObjectGraphNode neighbor = property.TargetNode;
TreeNode targetTreeNode = null;
TreeGraphNode targetTreeNode = null;
bool newEdgeIsTreeEdge = false;
if (seenNodes.ContainsKey(neighbor))
{
@ -106,7 +106,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -106,7 +106,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <param name="node"></param>
/// <param name="lateralStart"></param>
/// <param name="mainStart"></param>
private void calculateNodePosRecursive(TreeNode node, double lateralStart, double mainStart)
private void calculateNodePosRecursive(TreeGraphNode node, double lateralStart, double mainStart)
{
double childsSubtreeSize = node.Childs.Sum(child => child.SubtreeSize);
// center this node
@ -128,7 +128,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout @@ -128,7 +128,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
double childLateral = lateralStart;
double childsMainFixed = node.MainCoord + node.MainSizeWithMargin;
foreach (TreeNode child in node.Childs)
foreach (TreeGraphNode child in node.Childs)
{
calculateNodePosRecursive(child, childLateral, childsMainFixed);
childLateral += child.SubtreeSize;

Loading…
Cancel
Save