Browse Source

Formatting.

newNRvisualizers
Martin Konicek 13 years ago
parent
commit
5bbbc94e6e
  1. 14
      src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj
  2. 4
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/GraphEdgeRouter.cs
  3. 3
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/PositionedNode.cs
  4. 7
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/PositionedNodeProperty.cs
  5. 3
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/Box.cs
  6. 4
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/Edge.cs
  7. 4
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/EdgeRouter.cs
  8. 9
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/GeomUtils.cs
  9. 2
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/IRect.cs
  10. 3
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/RouteGraph/EdgeStartEnd.cs
  11. 6
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/RouteGraph/RouteGraph.cs
  12. 3
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/ShortestPath/DijkstraShortestPathFinder.cs
  13. 10
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/TreeModel/ContentNode.cs
  14. 0
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/BoolToBoldConverter.cs
  15. 0
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/CanvasLocationAdapter.cs
  16. 0
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/GraphDrawer.cs
  17. 0
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/NodeControlResources.xaml
  18. 0
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/PositionedGraphNodeControl.xaml
  19. 17
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/PositionedGraphNodeControl.xaml.cs

14
src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj

@ -158,10 +158,10 @@
<Compile Include="Visualizers\Common\ObjectPropertyComparer.cs" /> <Compile Include="Visualizers\Common\ObjectPropertyComparer.cs" />
<Compile Include="Visualizers\Common\VirtualizingCollection.cs" /> <Compile Include="Visualizers\Common\VirtualizingCollection.cs" />
<Compile Include="Visualizers\Common\VirtualizingObservableCollection.cs" /> <Compile Include="Visualizers\Common\VirtualizingObservableCollection.cs" />
<Compile Include="Visualizers\GraphVisualizer\Drawing\BoolToBoldConverter.cs" /> <Compile Include="Visualizers\GraphVisualizer\Presentation\BoolToBoldConverter.cs" />
<Compile Include="Visualizers\GraphVisualizer\Drawing\CanvasLocationAdapter.cs" /> <Compile Include="Visualizers\GraphVisualizer\Presentation\CanvasLocationAdapter.cs" />
<Compile Include="Visualizers\GraphVisualizer\Drawing\GraphDrawer.cs" /> <Compile Include="Visualizers\GraphVisualizer\Presentation\GraphDrawer.cs" />
<Compile Include="Visualizers\GraphVisualizer\Drawing\PositionedGraphNodeControl.xaml.cs" /> <Compile Include="Visualizers\GraphVisualizer\Presentation\PositionedGraphNodeControl.xaml.cs" />
<Compile Include="Visualizers\GraphVisualizer\ExpandedPaths\Expanded.cs" /> <Compile Include="Visualizers\GraphVisualizer\ExpandedPaths\Expanded.cs" />
<Compile Include="Visualizers\GraphVisualizer\ExpandedPaths\ExpandedContentNodes.cs" /> <Compile Include="Visualizers\GraphVisualizer\ExpandedPaths\ExpandedContentNodes.cs" />
<Compile Include="Visualizers\GraphVisualizer\ExpandedPaths\ExpandedExpressions.cs" /> <Compile Include="Visualizers\GraphVisualizer\ExpandedPaths\ExpandedExpressions.cs" />
@ -294,7 +294,7 @@
<Folder Include="Visualizers\Commands" /> <Folder Include="Visualizers\Commands" />
<Folder Include="Visualizers\Common" /> <Folder Include="Visualizers\Common" />
<Folder Include="Visualizers\GraphVisualizer" /> <Folder Include="Visualizers\GraphVisualizer" />
<Folder Include="Visualizers\GraphVisualizer\Drawing" /> <Folder Include="Visualizers\GraphVisualizer\Presentation" />
<Folder Include="Visualizers\GraphVisualizer\ExpandedPaths" /> <Folder Include="Visualizers\GraphVisualizer\ExpandedPaths" />
<Folder Include="Visualizers\GraphVisualizer\Layout" /> <Folder Include="Visualizers\GraphVisualizer\Layout" />
<Folder Include="Visualizers\GraphVisualizer\Layout\SplineRouting" /> <Folder Include="Visualizers\GraphVisualizer\Layout\SplineRouting" />
@ -314,8 +314,8 @@
<Page Include="Service\EditBreakpointScriptWindow.xaml" /> <Page Include="Service\EditBreakpointScriptWindow.xaml" />
<Page Include="Tooltips\DebuggerTooltipControl.xaml" /> <Page Include="Tooltips\DebuggerTooltipControl.xaml" />
<Page Include="Tooltips\VisualizerPicker.xaml" /> <Page Include="Tooltips\VisualizerPicker.xaml" />
<Page Include="Visualizers\GraphVisualizer\Drawing\NodeControlResources.xaml" /> <Page Include="Visualizers\GraphVisualizer\Presentation\NodeControlResources.xaml" />
<Page Include="Visualizers\GraphVisualizer\Drawing\PositionedGraphNodeControl.xaml" /> <Page Include="Visualizers\GraphVisualizer\Presentation\PositionedGraphNodeControl.xaml" />
<Page Include="Visualizers\GraphVisualizer\ObjectGraphControl.xaml" /> <Page Include="Visualizers\GraphVisualizer\ObjectGraphControl.xaml" />
<Page Include="Visualizers\GraphVisualizer\ObjectGraphWindow.xaml" /> <Page Include="Visualizers\GraphVisualizer\ObjectGraphWindow.xaml" />
<Page Include="Visualizers\GridVisualizer\ColumnPicker.xaml" /> <Page Include="Visualizers\GridVisualizer\ColumnPicker.xaml" />

4
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/GraphEdgeRouter.cs

@ -17,10 +17,6 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
{ {
EdgeRouter router = new EdgeRouter(); EdgeRouter router = new EdgeRouter();
public GraphEdgeRouter()
{
}
public void RouteEdges(PositionedGraph posGraph) public void RouteEdges(PositionedGraph posGraph)
{ {
Dictionary<PositionedEdge, RoutedEdge> routedEdges = router.RouteEdges(posGraph.Nodes, posGraph.Edges); Dictionary<PositionedEdge, RoutedEdge> routedEdges = router.RouteEdges(posGraph.Nodes, posGraph.Edges);

3
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/PositionedNode.cs

@ -145,8 +145,9 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
SplineRouting.Box box; SplineRouting.Box box;
public SplineRouting.IRect Inflated(double padding) public SplineRouting.IRect Inflated(double padding)
{ {
if (box == null) if (box == null) {
box = new SplineRouting.Box(this); box = new SplineRouting.Box(this);
}
return box.Inflated(padding); return box.Inflated(padding);
} }

7
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/PositionedNodeProperty.cs

@ -18,11 +18,8 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
/// <param name="objectProperty">Underlying <see cref="ObjectProperty"/></param> /// <param name="objectProperty">Underlying <see cref="ObjectProperty"/></param>
public PositionedNodeProperty(ObjectGraphProperty objectProperty, PositionedNode containingNode, bool isPropertyExpanded) public PositionedNodeProperty(ObjectGraphProperty objectProperty, PositionedNode containingNode, bool isPropertyExpanded)
{ {
if (containingNode == null) if (containingNode == null) throw new ArgumentNullException("containingNode");
throw new ArgumentNullException("containingNode"); if (objectProperty == null) throw new ArgumentNullException("objectProperty");
if (objectProperty == null)
throw new ArgumentNullException("objectProperty");
this.objectGraphProperty = objectProperty; this.objectGraphProperty = objectProperty;
this.containingNode = containingNode; this.containingNode = containingNode;
this.IsPropertyExpanded = isPropertyExpanded; this.IsPropertyExpanded = isPropertyExpanded;

3
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/Box.cs

@ -44,8 +44,7 @@ namespace Debugger.AddIn.Visualizers.Graph.SplineRouting
public IRect Inflated(double padding) public IRect Inflated(double padding)
{ {
//if (inflatedCache.ContainsKey(padding)) //if (inflatedCache.ContainsKey(padding))
if (inflatedCache == null) if (inflatedCache == null) {
{
inflatedCache = GeomUtils.InflateRect(this, padding); inflatedCache = GeomUtils.InflateRect(this, padding);
} }
return inflatedCache; return inflatedCache;

4
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/Edge.cs

@ -13,10 +13,6 @@ namespace Debugger.AddIn.Visualizers.Graph.SplineRouting
/// </summary> /// </summary>
public class Edge : IEdge public class Edge : IEdge
{ {
public Edge()
{
}
public IRect From { get; set; } public IRect From { get; set; }
public IRect To { get; set; } public IRect To { get; set; }
public IPoint StartPoint { get; set; } public IPoint StartPoint { get; set; }

4
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/EdgeRouter.cs

@ -12,10 +12,6 @@ namespace Debugger.AddIn.Visualizers.Graph.SplineRouting
/// </summary> /// </summary>
public class EdgeRouter public class EdgeRouter
{ {
public EdgeRouter()
{
}
/// <summary> /// <summary>
/// Calculates routes for edges in a graph, so that they avoid nodes. /// Calculates routes for edges in a graph, so that they avoid nodes.
/// </summary> /// </summary>

9
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/GeomUtils.cs

@ -8,17 +8,10 @@ using System.Windows;
namespace Debugger.AddIn.Visualizers.Graph.SplineRouting namespace Debugger.AddIn.Visualizers.Graph.SplineRouting
{ {
/// <summary> public static class GeomUtils
/// Description of GeomUtils.
/// </summary>
public class GeomUtils
{ {
static readonly double eps = 1e-8; static readonly double eps = 1e-8;
public GeomUtils()
{
}
public static IPoint RectCenter(IRect rect) public static IPoint RectCenter(IRect rect)
{ {
return new Point2D(rect.Left + rect.Width / 2, rect.Top + rect.Height / 2); return new Point2D(rect.Left + rect.Width / 2, rect.Top + rect.Height / 2);

2
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/IRect.cs

@ -9,7 +9,7 @@ namespace Debugger.AddIn.Visualizers.Graph.SplineRouting
{ {
/// <summary> /// <summary>
/// The node in a graph. /// The node in a graph.
/// Enables passing generic graphs <see cref="EdgeRouter />. /// Enables passing generic graphs to <see cref="EdgeRouter />.
/// </summary> /// </summary>
public interface IRect public interface IRect
{ {

3
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/RouteGraph/EdgeStartEnd.cs

@ -18,8 +18,7 @@ namespace Debugger.AddIn.Visualizers.Graph.SplineRouting
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
var other = obj as EdgeStartEnd; var other = obj as EdgeStartEnd;
if (other == null) if (other == null) return false;
return false;
return (this.From == other.From && this.To == other.To) || (this.From == other.To && this.To == other.From); return (this.From == other.From && this.To == other.To) || (this.From == other.To && this.To == other.From);
} }

6
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/RouteGraph/RouteGraph.cs

@ -145,8 +145,7 @@ namespace Debugger.AddIn.Visualizers.Graph.SplineRouting
for (int j = i + 1; j < this.Vertices.Count; j++) { for (int j = i + 1; j < this.Vertices.Count; j++) {
var vertex = this.Vertices[i]; var vertex = this.Vertices[i];
var vertex2 = this.Vertices[j]; var vertex2 = this.Vertices[j];
if (Visible(vertex, vertex2)) if (Visible(vertex, vertex2)) {
{
// bidirectional edge // bidirectional edge
vertex.AddNeighbor(vertex2); vertex.AddNeighbor(vertex2);
vertex2.AddNeighbor(vertex); vertex2.AddNeighbor(vertex);
@ -159,8 +158,7 @@ namespace Debugger.AddIn.Visualizers.Graph.SplineRouting
{ {
// test for intersection with every box // test for intersection with every box
foreach (var rect in this.Boxes) { foreach (var rect in this.Boxes) {
if (GeomUtils.LineRectIntersection(vertex, vertex2, rect) != null) if (GeomUtils.LineRectIntersection(vertex, vertex2, rect) != null) return false;
return false;
} }
return true; return true;
} }

3
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/SplineRouting/ShortestPath/DijkstraShortestPathFinder.cs

@ -28,8 +28,7 @@ namespace Debugger.AddIn.Visualizers.Graph.SplineRouting
} }
start.Distance = 0; start.Distance = 0;
bool reached = false; bool reached = false;
while (!reached) while (!reached) {
{
RouteVertex minVertex = null; RouteVertex minVertex = null;
foreach (var minCandidate in graph.Vertices.Where(v => !v.IsPermanent && v.IsAvailable)) { foreach (var minCandidate in graph.Vertices.Where(v => !v.IsPermanent && v.IsAvailable)) {
if (minVertex == null || minCandidate.Distance < minVertex.Distance) { if (minVertex == null || minCandidate.Distance < minVertex.Distance) {

10
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Layout/TreeModel/ContentNode.cs

@ -21,7 +21,6 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
{ {
if (containingNode == null) if (containingNode == null)
throw new ArgumentNullException("containingNode"); throw new ArgumentNullException("containingNode");
this.containingNode = containingNode; this.containingNode = containingNode;
this.parent = parent; this.parent = parent;
} }
@ -163,12 +162,9 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
this.IsExpanded = (source is ThisNode) || expanded.ContentNodes.IsExpanded(this); this.IsExpanded = (source is ThisNode) || expanded.ContentNodes.IsExpanded(this);
foreach (AbstractNode child in source.Children) { foreach (AbstractNode child in source.Children) {
ContentNode newChild = null; ContentNode newChild = child is PropertyNode ?
if (child is PropertyNode) { new ContentPropertyNode(this.ContainingNode, this) :
newChild = new ContentPropertyNode(this.ContainingNode, this); new ContentNode(this.ContainingNode, this);
} else {
newChild = new ContentNode(this.ContainingNode, this);
}
newChild.InitOverride(child, expanded); newChild.InitOverride(child, expanded);
this.Children.Add(newChild); this.Children.Add(newChild);
} }

0
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Drawing/BoolToBoldConverter.cs → src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/BoolToBoldConverter.cs

0
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Drawing/CanvasLocationAdapter.cs → src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/CanvasLocationAdapter.cs

0
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Drawing/GraphDrawer.cs → src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/GraphDrawer.cs

0
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Drawing/NodeControlResources.xaml → src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/NodeControlResources.xaml

0
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Drawing/PositionedGraphNodeControl.xaml → src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/PositionedGraphNodeControl.xaml

17
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Drawing/PositionedGraphNodeControl.xaml.cs → src/AddIns/Debugger/Debugger.AddIn/Visualizers/GraphVisualizer/Presentation/PositionedGraphNodeControl.xaml.cs

@ -93,7 +93,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing
} }
PositionedNodeProperty property = clickedNode.Property; PositionedNodeProperty property = clickedNode.Property;
clickedButton.Content = property.IsPropertyExpanded ? "-" : "+"; // could be done with a converter clickedButton.Content = property.IsPropertyExpanded ? "-" : "+"; // could be done using a converter
if (property.IsPropertyExpanded) { if (property.IsPropertyExpanded) {
OnPropertyExpanded(property); OnPropertyExpanded(property);
@ -108,25 +108,20 @@ namespace Debugger.AddIn.Visualizers.Graph.Drawing
var clickedNode = clickedButton.DataContext as ContentNode; var clickedNode = clickedButton.DataContext as ContentNode;
if (clickedNode == null) return; if (clickedNode == null) return;
int clickedIndex = this.items.IndexOf(clickedNode); int clickedIndex = this.items.IndexOf(clickedNode);
clickedButton.Content = clickedNode.IsExpanded ? "-" : "+"; // could be done by a converter clickedButton.Content = clickedNode.IsExpanded ? "-" : "+"; // could be done using a converter
if (clickedNode.IsExpanded) if (clickedNode.IsExpanded) {
{
// insert children // insert children
int i = 1; int i = 1;
foreach (var childNode in clickedNode.Children) foreach (var childNode in clickedNode.Children) {
{
this.items.Insert(clickedIndex + i, childNode); this.items.Insert(clickedIndex + i, childNode);
i++; i++;
} }
OnContentNodeExpanded(clickedNode); OnContentNodeExpanded(clickedNode);
} } else {
else
{
// remove whole subtree // remove whole subtree
int size = SubtreeSize(clickedNode) - 1; int size = SubtreeSize(clickedNode) - 1;
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++) {
{
this.items.RemoveAt(clickedIndex + 1); this.items.RemoveAt(clickedIndex + 1);
} }
OnContentNodeCollapsed(clickedNode); OnContentNodeCollapsed(clickedNode);
Loading…
Cancel
Save