Index: Core/Components/src/Core.Components.OxyPlot/Data/AreaData.cs
===================================================================
diff -u -r545fb5e9c0105fe824abde45b452145c6659d343 -r5a98830aee77b1ee0158c11ba5cccffc656226e0
--- Core/Components/src/Core.Components.OxyPlot/Data/AreaData.cs (.../AreaData.cs) (revision 545fb5e9c0105fe824abde45b452145c6659d343)
+++ Core/Components/src/Core.Components.OxyPlot/Data/AreaData.cs (.../AreaData.cs) (revision 5a98830aee77b1ee0158c11ba5cccffc656226e0)
@@ -9,10 +9,8 @@
///
/// This class represents data which is represented as an area on .
///
- public class AreaData : IChartData
+ public class AreaData : AreaSeries, IChartData
{
- private AreaSeries series;
-
///
/// Creates a new instance of .
///
@@ -25,14 +23,13 @@
{
throw new ArgumentNullException("points", "A point collection is required when creating ChartData.");
}
- series = new AreaSeries();
foreach (var p in points)
{
- series.Points.Add(TupleToDataPoint(p));
+ Points.Add(TupleToDataPoint(p));
}
if (points.Count > 0)
{
- series.Points2.Add(TupleToDataPoint(points.First()));
+ Points2.Add(TupleToDataPoint(points.First()));
}
}
@@ -52,7 +49,7 @@
{
throw new ArgumentNullException("model", "A model is required to add points to.");
}
- model.Series.Add(series);
+ model.Series.Add(this);
}
}
}
\ No newline at end of file
Index: Core/Components/src/Core.Components.OxyPlot/Data/LineData.cs
===================================================================
diff -u -r545fb5e9c0105fe824abde45b452145c6659d343 -r5a98830aee77b1ee0158c11ba5cccffc656226e0
--- Core/Components/src/Core.Components.OxyPlot/Data/LineData.cs (.../LineData.cs) (revision 545fb5e9c0105fe824abde45b452145c6659d343)
+++ Core/Components/src/Core.Components.OxyPlot/Data/LineData.cs (.../LineData.cs) (revision 5a98830aee77b1ee0158c11ba5cccffc656226e0)
@@ -8,9 +8,8 @@
///
/// This class represents data which is represented as a line on .
///
- public class LineData : IChartData
+ public class LineData : LineSeries, IChartData
{
- private readonly LineSeries series;
///
/// Creates a new instance of .
@@ -24,11 +23,8 @@
{
throw new ArgumentNullException("points", "A point collection is required when creating ChartData.");
}
- series = new LineSeries
- {
- ItemsSource = points,
- Mapping = TupleToDataPoint
- };
+ ItemsSource = points;
+ Mapping = TupleToDataPoint;
}
private DataPoint TupleToDataPoint(object obj)
@@ -48,7 +44,7 @@
{
throw new ArgumentNullException("model", "A model is required to add points to.");
}
- model.Series.Add(series);
+ model.Series.Add(this);
}
}
}
\ No newline at end of file
Index: Core/Components/src/Core.Components.OxyPlot/Data/PointData.cs
===================================================================
diff -u -r545fb5e9c0105fe824abde45b452145c6659d343 -r5a98830aee77b1ee0158c11ba5cccffc656226e0
--- Core/Components/src/Core.Components.OxyPlot/Data/PointData.cs (.../PointData.cs) (revision 545fb5e9c0105fe824abde45b452145c6659d343)
+++ Core/Components/src/Core.Components.OxyPlot/Data/PointData.cs (.../PointData.cs) (revision 5a98830aee77b1ee0158c11ba5cccffc656226e0)
@@ -8,10 +8,8 @@
///
/// This class represents data which is represented as points on .
///
- public class PointData : IChartData
+ public class PointData : LineSeries, IChartData
{
- private readonly LineSeries series;
-
///
/// Creates a new instance of .
///
@@ -23,13 +21,10 @@
{
throw new ArgumentNullException("points", "A point collection is required when creating ChartData.");
}
- series = new LineSeries
- {
- ItemsSource = points,
- Mapping = TupleToDataPoint,
- LineStyle = LineStyle.None,
- MarkerType = MarkerType.Circle
- };
+ ItemsSource = points;
+ Mapping = TupleToDataPoint;
+ LineStyle = LineStyle.None;
+ MarkerType = MarkerType.Circle;
}
private DataPoint TupleToDataPoint(object obj)
@@ -49,7 +44,7 @@
{
throw new ArgumentNullException("model", "A model is required to add points to.");
}
- model.Series.Add(series);
+ model.Series.Add(this);
}
}
}
\ No newline at end of file
Index: Core/Plugins/src/Core.Plugins.OxyPlot/Core.Plugins.OxyPlot.csproj
===================================================================
diff -u -r0a601445097c12310c8fb1bff0c43f45a75c9e11 -r5a98830aee77b1ee0158c11ba5cccffc656226e0
--- Core/Plugins/src/Core.Plugins.OxyPlot/Core.Plugins.OxyPlot.csproj (.../Core.Plugins.OxyPlot.csproj) (revision 0a601445097c12310c8fb1bff0c43f45a75c9e11)
+++ Core/Plugins/src/Core.Plugins.OxyPlot/Core.Plugins.OxyPlot.csproj (.../Core.Plugins.OxyPlot.csproj) (revision 5a98830aee77b1ee0158c11ba5cccffc656226e0)
@@ -153,7 +153,10 @@
+
+
+
Index: Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendTreeView.cs
===================================================================
diff -u -r0a601445097c12310c8fb1bff0c43f45a75c9e11 -r5a98830aee77b1ee0158c11ba5cccffc656226e0
--- Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendTreeView.cs (.../LegendTreeView.cs) (revision 0a601445097c12310c8fb1bff0c43f45a75c9e11)
+++ Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendTreeView.cs (.../LegendTreeView.cs) (revision 5a98830aee77b1ee0158c11ba5cccffc656226e0)
@@ -1,7 +1,8 @@
using System.Collections;
using Core.Common.Controls.TreeView;
+using Core.Common.Gui.Properties;
using Core.Components.OxyPlot;
-using OxyPlot.Series;
+using Core.Components.OxyPlot.Data;
namespace Core.Plugins.OxyPlot.Legend
{
@@ -19,6 +20,7 @@
public override void UpdateNode(TreeNode parentNode, TreeNode node, BaseChart nodeData)
{
node.Text = "Grafiek";
+ node.Image = Resources.folder;
}
public override IEnumerable GetChildNodeObjects(BaseChart parentNodeData)
@@ -27,11 +29,23 @@
}
}
- public class ChartDataNodePresenter : TreeViewNodePresenterBase
+ public class ChartDataNodePresenter : TreeViewNodePresenterBase
{
- public override void UpdateNode(TreeNode parentNode, TreeNode node, ItemsSeries nodeData)
+ public override void UpdateNode(TreeNode parentNode, TreeNode node, IChartData nodeData)
{
node.Text = nodeData.GetType().Name;
+ if (nodeData is AreaData)
+ {
+ node.Image = Properties.Resources.AreaIcon;
+ }
+ if (nodeData is LineData)
+ {
+ node.Image = Properties.Resources.LineIcon;
+ }
+ if (nodeData is PointData)
+ {
+ node.Image = Properties.Resources.PointsIcon;
+ }
}
}
}
\ No newline at end of file
Index: Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.Designer.cs
===================================================================
diff -u -r0a601445097c12310c8fb1bff0c43f45a75c9e11 -r5a98830aee77b1ee0158c11ba5cccffc656226e0
--- Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.Designer.cs (.../LegendView.Designer.cs) (revision 0a601445097c12310c8fb1bff0c43f45a75c9e11)
+++ Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.Designer.cs (.../LegendView.Designer.cs) (revision 5a98830aee77b1ee0158c11ba5cccffc656226e0)
@@ -32,16 +32,9 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LegendView));
- this.toolBar = new System.Windows.Forms.ToolStrip();
this.seriesTree = new Core.Plugins.OxyPlot.Legend.LegendTreeView();
this.SuspendLayout();
//
- // toolBar
- //
- this.toolBar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
- resources.ApplyResources(this.toolBar, "toolBar");
- this.toolBar.Name = "toolBar";
- //
// seriesTree
//
this.seriesTree.AllowDrop = true;
@@ -57,16 +50,13 @@
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.seriesTree);
- this.Controls.Add(this.toolBar);
this.Name = "LegendView";
this.ResumeLayout(false);
- this.PerformLayout();
}
#endregion
- private System.Windows.Forms.ToolStrip toolBar;
private LegendTreeView seriesTree;
}
}
\ No newline at end of file
Index: Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.resx
===================================================================
diff -u -r3ee80d5d797653a6eac5c4a46c4900ad4fbe8380 -r5a98830aee77b1ee0158c11ba5cccffc656226e0
--- Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.resx (.../LegendView.resx) (revision 3ee80d5d797653a6eac5c4a46c4900ad4fbe8380)
+++ Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.resx (.../LegendView.resx) (revision 5a98830aee77b1ee0158c11ba5cccffc656226e0)
@@ -117,50 +117,23 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 17, 17
-
-
-
- 0, 0
-
-
- 228, 25
-
-
-
- 1
-
-
- toolStrip1
-
-
- toolBar
-
-
- System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 1
-
Fill
+
0
+
- 0, 25
+ 0, 0
0
- 228, 387
+ 228, 412
2
Index: Core/Plugins/src/Core.Plugins.OxyPlot/Properties/Resources.Designer.cs
===================================================================
diff -u -r03d5df1364557b6f4a184908affb7754e58b3fa4 -r5a98830aee77b1ee0158c11ba5cccffc656226e0
--- Core/Plugins/src/Core.Plugins.OxyPlot/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 03d5df1364557b6f4a184908affb7754e58b3fa4)
+++ Core/Plugins/src/Core.Plugins.OxyPlot/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5a98830aee77b1ee0158c11ba5cccffc656226e0)
@@ -63,6 +63,16 @@
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
+ public static System.Drawing.Bitmap AreaIcon {
+ get {
+ object obj = ResourceManager.GetObject("AreaIcon", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
public static System.Drawing.Bitmap ChartIcon {
get {
object obj = ResourceManager.GetObject("ChartIcon", resourceCulture);
@@ -81,6 +91,16 @@
}
///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ public static System.Drawing.Bitmap LineIcon {
+ get {
+ object obj = ResourceManager.GetObject("LineIcon", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Open een documentvenster met een diagram..
///
public static string OpenChartView_ToolTip {
@@ -90,6 +110,16 @@
}
///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ public static System.Drawing.Bitmap PointsIcon {
+ get {
+ object obj = ResourceManager.GetObject("PointsIcon", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Grafiek.
///
public static string Ribbon_Chart {
Index: Core/Plugins/src/Core.Plugins.OxyPlot/Properties/Resources.resx
===================================================================
diff -u -r03d5df1364557b6f4a184908affb7754e58b3fa4 -r5a98830aee77b1ee0158c11ba5cccffc656226e0
--- Core/Plugins/src/Core.Plugins.OxyPlot/Properties/Resources.resx (.../Resources.resx) (revision 03d5df1364557b6f4a184908affb7754e58b3fa4)
+++ Core/Plugins/src/Core.Plugins.OxyPlot/Properties/Resources.resx (.../Resources.resx) (revision 5a98830aee77b1ee0158c11ba5cccffc656226e0)
@@ -118,15 +118,24 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ ..\resources\area.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\resources\chart.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\resources\document.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\resources\line.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
Open een documentvenster met een diagram.
+
+ ..\resources\points.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
Grafiek
Index: Core/Plugins/src/Core.Plugins.OxyPlot/Resources/area.png
===================================================================
diff -u
Binary files differ
Index: Core/Plugins/src/Core.Plugins.OxyPlot/Resources/line.png
===================================================================
diff -u
Binary files differ
Index: Core/Plugins/src/Core.Plugins.OxyPlot/Resources/points.png
===================================================================
diff -u
Binary files differ
Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs
===================================================================
diff -u -r3ee80d5d797653a6eac5c4a46c4900ad4fbe8380 -r5a98830aee77b1ee0158c11ba5cccffc656226e0
--- Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs (.../OxyPlotGuiPluginTest.cs) (revision 3ee80d5d797653a6eac5c4a46c4900ad4fbe8380)
+++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs (.../OxyPlotGuiPluginTest.cs) (revision 5a98830aee77b1ee0158c11ba5cccffc656226e0)
@@ -48,7 +48,7 @@
[Test]
[RequiresSTA]
- public void Activate_WithGui_SetsRibbonCommandHandlerAndBindsActiveViewChanged()
+ public void Activate_WithGui_InitializesComponentsAndBindsActiveViewChanged()
{
// Setup
using (var plugin = new OxyPlotGuiPlugin())
@@ -57,10 +57,12 @@
var gui = mocks.StrictMock();
var dockingManger = mocks.Stub();
var toolWindows = new ViewList(dockingManger, null);
+ var view = mocks.StrictMock();
gui.Expect(g => g.ActiveViewChanged += null).IgnoreArguments();
- gui.Expect(g => g.ToolWindowViews).Return(toolWindows);
+ gui.Expect(g => g.ToolWindowViews).Return(toolWindows).Repeat.Twice();
gui.Expect(g => g.OpenToolView(Arg.Matches(c => true)));
+ gui.Expect(g => g.ActiveView).Return(view);
mocks.ReplayAll();