Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1194


Ignore:
Timestamp:
01/30/09 17:03:15 (16 years ago)
Author:
mstoeger
Message:

Implemented a continuous-, discrete- and string- label provider for the X/Y axis labels. (#433)

Location:
trunk/sources/HeuristicLab.Visualization
Files:
3 added
7 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/ChartDataRowsModel.cs

    r1191 r1194  
    55using HeuristicLab.Core;
    66using System.Text;
     7using HeuristicLab.Visualization.LabelProvider;
    78
    89namespace HeuristicLab.Visualization{
     
    1415    private string title = "Title";
    1516    //private string xAxisLabel;
    16     private ILabelProvider labelProvider = new DefaultLabelProvider("0.##");
     17    private ILabelProvider labelProvider = new ContinuousLabelProvider("0.##");
    1718
    1819    public ILabelProvider XAxisLabelProvider {
     
    144145      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    145146
    146       foreach (var row in rows) {
     147      foreach (IDataRow row in rows) {
    147148        XmlNode columnElement = document.CreateNode(XmlNodeType.Element, "row", null);
    148149
    149150        XmlAttribute idAttr = document.CreateAttribute("label");
    150         idAttr.Value = row.Label.ToString();
     151        idAttr.Value = row.Label;
    151152        columnElement.Attributes.Append(idAttr);
    152153
  • trunk/sources/HeuristicLab.Visualization/DataRow.cs

    r1193 r1194  
    22using System.Drawing;
    33using System.Collections.Generic;
     4using HeuristicLab.Visualization.LabelProvider;
    45
    56namespace HeuristicLab.Visualization {
     
    2223    private List<double> dataRow = new List<double>();
    2324
    24     private ILabelProvider labelProvider = new DefaultLabelProvider("0.##");
     25    private ILabelProvider labelProvider = new ContinuousLabelProvider("0.##");
    2526
    2627    public DataRowType LineType{
  • trunk/sources/HeuristicLab.Visualization/HeuristicLab.Visualization.csproj

    r1187 r1194  
    8181    <Compile Include="CompositeShape.cs" />
    8282    <Compile Include="ChartDataRowsModelDataCollector.cs" />
    83     <Compile Include="DefaultLabelProvider.cs" />
     83    <Compile Include="LabelProvider\ContinuousLabelProvider.cs" />
     84    <Compile Include="LabelProvider\DiscreteLabelProvider.cs" />
    8485    <Compile Include="Grid.cs" />
    8586    <Compile Include="HorizontalLineShape.cs" />
    86     <Compile Include="ILabelProvider.cs" />
     87    <Compile Include="LabelProvider\ILabelProvider.cs" />
    8788    <Compile Include="IMouseEventListener.cs" />
    8889    <Compile Include="OptionsDialog.cs">
     
    9394    </Compile>
    9495    <Compile Include="PanListener.cs" />
     96    <Compile Include="LabelProvider\StringLabelProvider.cs" />
    9597    <Compile Include="TextShape.cs" />
    9698    <Compile Include="LegendShape.cs" />
  • trunk/sources/HeuristicLab.Visualization/IChartDataRowsModel.cs

    r1190 r1194  
    11using System.Collections.Generic;
    22using HeuristicLab.Core;
     3using HeuristicLab.Visualization.LabelProvider;
    34
    45namespace HeuristicLab.Visualization {
  • trunk/sources/HeuristicLab.Visualization/IDataRow.cs

    r1193 r1194  
    11using System.Drawing;
     2using HeuristicLab.Visualization.LabelProvider;
    23
    34namespace HeuristicLab.Visualization {
  • trunk/sources/HeuristicLab.Visualization/LabelProvider/ContinuousLabelProvider.cs

    r1192 r1194  
    11using System.Globalization;
    22
    3 namespace HeuristicLab.Visualization {
    4   public class DefaultLabelProvider : ILabelProvider {
     3namespace HeuristicLab.Visualization.LabelProvider {
     4  public class ContinuousLabelProvider : ILabelProvider {
    55    private readonly string format;
    66
    7     public DefaultLabelProvider() {}
     7    public ContinuousLabelProvider() {}
    88
    9     public DefaultLabelProvider(string format) {
     9    public ContinuousLabelProvider(string format) {
    1010      this.format = format;
    1111    }
  • trunk/sources/HeuristicLab.Visualization/LabelProvider/ILabelProvider.cs

    r1192 r1194  
    1 namespace HeuristicLab.Visualization {
     1namespace HeuristicLab.Visualization.LabelProvider {
    22  public interface ILabelProvider {
    33    string GetLabel(double value);
  • trunk/sources/HeuristicLab.Visualization/XAxis.cs

    r1182 r1194  
    22using System.Collections.Generic;
    33using System.Drawing;
     4using HeuristicLab.Visualization.LabelProvider;
    45
    56namespace HeuristicLab.Visualization {
    67  public class XAxis : WorldShape {
    78    public const int PixelsPerInterval = 100;
    8     private ILabelProvider labelProvider = new DefaultLabelProvider("0.##");
     9    private ILabelProvider labelProvider = new ContinuousLabelProvider("0.####");
    910
    1011    public ILabelProvider LabelProvider {
  • trunk/sources/HeuristicLab.Visualization/YAxis.cs

    r1182 r1194  
    11using System.Drawing;
     2using HeuristicLab.Visualization.LabelProvider;
    23
    34namespace HeuristicLab.Visualization {
     
    56    public const int PixelsPerInterval = 75;
    67
    7     private ILabelProvider labelProvider = new DefaultLabelProvider("e");
     8    private ILabelProvider labelProvider = new ContinuousLabelProvider("e4");
    89
    910    public ILabelProvider LabelProvider {
Note: See TracChangeset for help on using the changeset viewer.