Changeset 1341
- Timestamp:
- 03/13/09 18:21:26 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Visualization
- Files:
-
- 1 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/ChartDataRowsModel.cs
r1285 r1341 6 6 using System.Text; 7 7 using HeuristicLab.Visualization.LabelProvider; 8 using HeuristicLab.Visualization.Options; 8 9 9 10 namespace HeuristicLab.Visualization{ … … 16 17 //private string xAxisLabel; 17 18 private ILabelProvider labelProvider = new ContinuousLabelProvider("0.##"); 19 20 private ViewSettings viewSettings = new ViewSettings(); 18 21 19 22 public ILabelProvider XAxisLabelProvider { … … 129 132 return max; 130 133 } 134 } 135 136 public ViewSettings ViewSettings { 137 get { return viewSettings; } 138 set { viewSettings = value; } 131 139 } 132 140 -
trunk/sources/HeuristicLab.Visualization/HeuristicLab.Visualization.csproj
r1337 r1341 100 100 <DependentUpon>OptionsDialog.cs</DependentUpon> 101 101 </Compile> 102 <Compile Include="Options\View PropertiesModel.cs" />102 <Compile Include="Options\ViewSettings.cs" /> 103 103 <Compile Include="PanListener.cs" /> 104 104 <Compile Include="LabelProvider\StringLabelProvider.cs" /> -
trunk/sources/HeuristicLab.Visualization/IChartDataRowsModel.cs
r1285 r1341 2 2 using HeuristicLab.Core; 3 3 using HeuristicLab.Visualization.LabelProvider; 4 using HeuristicLab.Visualization.Options; 4 5 5 6 namespace HeuristicLab.Visualization { … … 25 26 int MaxDataRowValues { get; } 26 27 28 ViewSettings ViewSettings { get; set; } 29 27 30 event ModelChangedHandler ModelChanged; 28 31 event DataRowAddedHandler DataRowAdded; -
trunk/sources/HeuristicLab.Visualization/LineChart.cs
r1337 r1341 19 19 private readonly Dictionary<IDataRow, RowEntry> rowToRowEntry = new Dictionary<IDataRow, RowEntry>(); 20 20 21 private readonly ViewSettings viewSettings; 22 21 23 // private readonly Stack<RectangleD> clippingAreaHistory = new Stack<RectangleD>(); 22 24 private readonly WorldShape userInteractionShape = new WorldShape(); … … 29 31 private bool zoomToFullView; 30 32 31 private readonly ViewPropertiesModel viewPropertiesModel;32 33 33 34 /// <summary> … … 50 51 51 52 this.model = model; 52 view PropertiesModel = new ViewPropertiesModel(titleShape.Font, titleShape.Color, legendShape.Font, legendShape.Color, xAxis.Font, xAxis.Color);53 view PropertiesModel.OnUpdateProperties += UpdateViewProperties;53 viewSettings = model.ViewSettings; 54 viewSettings.OnUpdateSettings += UpdateViewProperties; 54 55 55 56 Item = model; … … 62 63 63 64 private void UpdateViewProperties() { 64 titleShape.Font = view PropertiesModel.TitleFont;65 titleShape.Color = view PropertiesModel.TitleColor;66 67 legendShape.Font = view PropertiesModel.LegendFont;68 legendShape.Color = view PropertiesModel.LegendColor;69 70 xAxis.Font = view PropertiesModel.XAxisFont;71 xAxis.Color = view PropertiesModel.XAxisColor;65 titleShape.Font = viewSettings.TitleFont; 66 titleShape.Color = viewSettings.TitleColor; 67 68 legendShape.Font = viewSettings.LegendFont; 69 legendShape.Color = viewSettings.LegendColor; 70 71 xAxis.Font = viewSettings.XAxisFont; 72 xAxis.Color = viewSettings.XAxisColor; 72 73 73 74 canvasUI.Invalidate(); … … 145 146 146 147 private void optionsToolStripMenuItem_Click(object sender, EventArgs e) { 147 OptionsDialog optionsdlg = new OptionsDialog( this.model, viewPropertiesModel);148 OptionsDialog optionsdlg = new OptionsDialog(model); 148 149 optionsdlg.ShowDialog(this); 149 150 } -
trunk/sources/HeuristicLab.Visualization/Options/OptionsDialog.cs
r1337 r1341 6 6 public partial class OptionsDialog : Form { 7 7 private readonly IChartDataRowsModel model; 8 private readonly View PropertiesModel propertiesModel;8 private readonly ViewSettings viewSettings; 9 9 10 public OptionsDialog(IChartDataRowsModel model , ViewPropertiesModel propertiesModel) {10 public OptionsDialog(IChartDataRowsModel model) { 11 11 InitializeComponent(); 12 12 13 13 this.model = model; 14 this.propertiesModel = propertiesModel;14 viewSettings = model.ViewSettings; 15 15 } 16 16 … … 75 75 76 76 private void btnChangeTitleFont_Click(object sender, EventArgs e) { 77 fdFont.Font = propertiesModel.TitleFont;78 fdFont.Color = propertiesModel.TitleColor;77 fdFont.Font = viewSettings.TitleFont; 78 fdFont.Color = viewSettings.TitleColor; 79 79 80 80 DialogResult dr = fdFont.ShowDialog(); 81 81 82 82 if(dr == DialogResult.OK) { 83 propertiesModel.TitleFont = fdFont.Font;84 propertiesModel.TitleColor = fdFont.Color;83 viewSettings.TitleFont = fdFont.Font; 84 viewSettings.TitleColor = fdFont.Color; 85 85 86 propertiesModel.UpdateView();86 viewSettings.UpdateView(); 87 87 } 88 88 } 89 89 90 90 private void btnChangeLegendFont_Click(object sender, EventArgs e) { 91 fdFont.Font = propertiesModel.LegendFont;92 fdFont.Color = propertiesModel.LegendColor;91 fdFont.Font = viewSettings.LegendFont; 92 fdFont.Color = viewSettings.LegendColor; 93 93 94 94 DialogResult dr = fdFont.ShowDialog(); 95 95 96 96 if (dr == DialogResult.OK) { 97 propertiesModel.LegendFont = fdFont.Font;98 propertiesModel.LegendColor = fdFont.Color;97 viewSettings.LegendFont = fdFont.Font; 98 viewSettings.LegendColor = fdFont.Color; 99 99 100 propertiesModel.UpdateView();100 viewSettings.UpdateView(); 101 101 } 102 102 } 103 103 104 104 private void btnChangeXAxisFont_Click(object sender, EventArgs e) { 105 fdFont.Font = propertiesModel.XAxisFont;106 fdFont.Color = propertiesModel.XAxisColor;105 fdFont.Font = viewSettings.XAxisFont; 106 fdFont.Color = viewSettings.XAxisColor; 107 107 108 108 DialogResult dr = fdFont.ShowDialog(); 109 109 110 110 if (dr == DialogResult.OK) { 111 propertiesModel.XAxisFont = fdFont.Font;112 propertiesModel.XAxisColor = fdFont.Color;111 viewSettings.XAxisFont = fdFont.Font; 112 viewSettings.XAxisColor = fdFont.Color; 113 113 114 propertiesModel.UpdateView();114 viewSettings.UpdateView(); 115 115 } 116 116 }
Note: See TracChangeset
for help on using the changeset viewer.