Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/29/09 17:23:18 (15 years ago)
Author:
cbahner
Message:

#636 first impl. of drawingStyle (DataRowSettings)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization.Test/3.2/LineChartTests.cs

    r1885 r1962  
    2222      IDataRow row3 = new DataRow();
    2323
    24       row1.Color = Color.Red;
    25       row2.Color = Color.Green;
    26       row3.Color = Color.Blue;
    27 
    28       row1.Thickness = 3;
    29       row2.Thickness = 4;
    30       row3.Thickness = 5;
    31 
    32       row1.Label = "Simon";
    33       row2.Label = "Gertschi";
    34       row3.Label = "Maxi";
     24      row1.RowSettings.Color = Color.Red;
     25      row2.RowSettings.Color = Color.Green;
     26      row3.RowSettings.Color = Color.Blue;
     27
     28      row1.RowSettings.Thickness = 3;
     29      row2.RowSettings.Thickness = 4;
     30      row3.RowSettings.Thickness = 5;
     31
     32      row1.RowSettings.Label = "Simon";
     33      row2.RowSettings.Label = "Gertschi";
     34      row3.RowSettings.Label = "Maxi";
    3535
    3636      row1.Style = DrawingStyle.Solid;
     
    9898      yaxis2.ShowGrid = false;
    9999
    100       row1.Color = Color.Red;
    101       row1.Thickness = 3;
     100      row1.RowSettings.Color = Color.Red;
     101      row1.RowSettings.Thickness = 3;
    102102      row1.Style = DrawingStyle.Solid;
    103       row1.Label = "Die Rote";
    104 
    105       row2.Color = Color.Green;
    106       row2.Thickness = 3;
     103      row1.RowSettings.Label = "Die Rote";
     104
     105      row2.RowSettings.Color = Color.Green;
     106      row2.RowSettings.Thickness = 3;
    107107      row2.Style = DrawingStyle.Solid;
    108       row2.Label = "Die Grüne";
    109 
    110       row3.Color = Color.Blue;
    111       row3.Thickness = 3;
     108      row2.RowSettings.Label = "Die Grüne";
     109
     110      row3.RowSettings.Color = Color.Blue;
     111      row3.RowSettings.Thickness = 3;
    112112      row3.Style = DrawingStyle.Solid;
    113       row3.Label = "Die Blaue";
     113      row3.RowSettings.Label = "Die Blaue";
    114114      row3.YAxis = yaxis2;
    115115
     
    139139      LineChartTestForm f = new LineChartTestForm(model);
    140140
    141       IDataRow row1 = new DataRow { Label = "row", Color = Color.Red, Thickness = 3, Style = DrawingStyle.Solid };
     141      IDataRow row1 = new DataRow();
     142      row1.RowSettings.Label = "row";
     143      row1.RowSettings.Color = Color.Red;
     144      row1.RowSettings.Thickness = 3;
     145      row1.Style = DrawingStyle.Solid;
    142146
    143147      model.AddDataRow(row1);
    144148
    145149
    146       MaxAggregator aggregator = new MaxAggregator {
    147         Label = "MinAggregator",
    148         Color = Color.Pink,
    149         Thickness = 5,
    150         Style = DrawingStyle.Solid,
    151         LineType = DataRowType.SingleValue
    152       };
     150      MaxAggregator aggregator = new MaxAggregator();
     151      aggregator.RowSettings.Label = "MinAggregator";
     152      aggregator.RowSettings.Color = Color.Pink;
     153      aggregator.RowSettings.Thickness = 5;
     154      aggregator.Style = DrawingStyle.Solid;
     155      aggregator.LineType = DataRowType.SingleValue;
    153156      aggregator.AddWatch(row1);
    154157
     
    175178
    176179      public void DoWorkMultiLine() {
    177         IDataRow row1 = new DataRow { Color = Color.Red, Thickness = 2, Label = "Sinus", Style = DrawingStyle.Solid, ShowMarkers = false };
     180        IDataRow row1 = new DataRow();
     181        row1.RowSettings.Color = Color.Red;
     182        row1.RowSettings.Thickness = 2;
     183        row1.RowSettings.Label = "Sinus";
     184        row1.Style = DrawingStyle.Solid;
     185        row1.ShowMarkers = false;
    178186        model.AddDataRow(row1);
    179187
    180         IDataRow row2 = new DataRow { Color = Color.Red, Thickness = 3, Label = "Growing", Style = DrawingStyle.Solid, ShowMarkers = false };
     188        IDataRow row2 = new DataRow();
     189        row2.RowSettings.Color = Color.Red;
     190        row2.RowSettings.Thickness = 3;
     191        row2.RowSettings.Label = "Growing";
     192        row2.Style = DrawingStyle.Solid;
     193        row2.ShowMarkers = false;
    181194        model.AddDataRow(row2);
    182195
    183         AvgAggregator multiAvgAggregator = new AvgAggregator {
    184           Label = "MultiAvgAggregator",
    185           Color = Color.DarkOliveGreen,
    186           Thickness = 3,
    187           Style = DrawingStyle.Solid,
    188           LineType = DataRowType.SingleValue,
    189           ShowMarkers = false
    190         };
     196        AvgAggregator multiAvgAggregator = new AvgAggregator();
     197        multiAvgAggregator.RowSettings.Label = "MultiAvgAggregator";
     198        multiAvgAggregator.RowSettings.Color = Color.DarkOliveGreen;
     199        multiAvgAggregator.RowSettings.Thickness = 3;
     200        multiAvgAggregator.Style = DrawingStyle.Solid;
     201        multiAvgAggregator.LineType = DataRowType.SingleValue;
     202        multiAvgAggregator.ShowMarkers = false;
    191203        multiAvgAggregator.AddWatch(row1);
    192204        multiAvgAggregator.AddWatch(row2);
    193205        model.AddDataRow(multiAvgAggregator);
    194206
    195         MaxAggregator multiMaxAggregator = new MaxAggregator {
    196           Label = "MultiMaxAggregator",
    197           Color = Color.DarkKhaki,
    198           Thickness = 3,
    199           Style = DrawingStyle.Solid,
    200           LineType = DataRowType.SingleValue,
    201           ShowMarkers = false
    202         };
     207        MaxAggregator multiMaxAggregator = new MaxAggregator();
     208        multiMaxAggregator.RowSettings.Label = "MultiMaxAggregator";
     209        multiMaxAggregator.RowSettings.Color = Color.DarkKhaki;
     210        multiMaxAggregator.RowSettings.Thickness = 3;
     211        multiMaxAggregator.Style = DrawingStyle.Solid;
     212        multiMaxAggregator.LineType = DataRowType.SingleValue;
     213        multiMaxAggregator.ShowMarkers = false;
    203214        multiMaxAggregator.AddWatch(row1);
    204215        multiMaxAggregator.AddWatch(row2);
    205216        model.AddDataRow(multiMaxAggregator);
    206217
    207         MinAggregator multiMinAggregator = new MinAggregator {
    208           Label = "MultiMinAggregator",
    209           Color = Color.DarkRed,
    210           Thickness = 3,
    211           Style = DrawingStyle.Solid,
    212           LineType = DataRowType.SingleValue,
    213           ShowMarkers = false
    214         };
     218        MinAggregator multiMinAggregator = new MinAggregator();
     219        multiMinAggregator.RowSettings.Label = "MultiMinAggregator";
     220        multiMinAggregator.RowSettings.Color = Color.DarkRed;
     221        multiMinAggregator.RowSettings.Thickness = 3;
     222        multiMinAggregator.Style = DrawingStyle.Solid;
     223        multiMinAggregator.LineType = DataRowType.SingleValue;
     224        multiMinAggregator.ShowMarkers = false;
    215225        multiMinAggregator.AddWatch(row1);
    216226        multiMinAggregator.AddWatch(row2);
     
    246256
    247257      public void DoWorkSingleLine() {
    248         IDataRow row1 = new DataRow {
    249           Color = Color.Red,
    250           Thickness = 2,
    251           Label = "Sinus",
    252           Style = DrawingStyle.Solid,
    253           ShowMarkers = false
    254         };
     258        IDataRow row1 = new DataRow();
     259        row1.RowSettings.Color = Color.Red;
     260        row1.RowSettings.Thickness = 2;
     261        row1.RowSettings.Label = "Sinus";
     262        row1.Style = DrawingStyle.Solid;
     263        row1.ShowMarkers = false;
    255264        model.AddDataRow(row1);
    256265
    257         IDataRow row2 = new DataRow {
    258           Color = Color.Red,
    259           Thickness = 3,
    260           Label = "Growing",
    261           Style = DrawingStyle.Solid,
    262           ShowMarkers = false
    263         };
     266        IDataRow row2 = new DataRow();
     267        row2.RowSettings.Color = Color.Red;
     268        row2.RowSettings.Thickness = 3;
     269        row2.RowSettings.Label = "Growing";
     270        row2.Style = DrawingStyle.Solid;
     271        row2.ShowMarkers = false;
    264272        model.AddDataRow(row2);
    265273
    266         MinAggregator aggregator = new MinAggregator {
    267           Label = "MinAggregator",
    268           Color = Color.Pink,
    269           Thickness = 3,
    270           Style = DrawingStyle.Solid,
    271           LineType = DataRowType.SingleValue
    272         };
     274        MinAggregator aggregator = new MinAggregator();
     275        aggregator.RowSettings.Label = "MinAggregator";
     276        aggregator.RowSettings.Color = Color.Pink;
     277        aggregator.RowSettings.Thickness = 3;
     278        aggregator.Style = DrawingStyle.Solid;
     279        aggregator.LineType = DataRowType.SingleValue;
    273280        aggregator.AddWatch(row1);
    274281        model.AddDataRow(aggregator);
    275282
    276         MaxAggregator maxAggregator = new MaxAggregator {
    277           Label = "MaxAggregator",
    278           Color = Color.DeepSkyBlue,
    279           Thickness = 3,
    280           Style = DrawingStyle.Solid,
    281           LineType = DataRowType.SingleValue
    282         };
     283        MaxAggregator maxAggregator = new MaxAggregator();
     284        maxAggregator.RowSettings.Label = "MaxAggregator";
     285        maxAggregator.RowSettings.Color = Color.DeepSkyBlue;
     286        maxAggregator.RowSettings.Thickness = 3;
     287        maxAggregator.Style = DrawingStyle.Solid;
     288        maxAggregator.LineType = DataRowType.SingleValue;
    283289        maxAggregator.AddWatch(row1);
    284290        model.AddDataRow(maxAggregator);
    285291
    286         AvgAggregator avgAggregator = new AvgAggregator {
    287           Label = "AvgAggregator",
    288           Color = Color.Violet,
    289           Thickness = 3,
    290           Style = DrawingStyle.Solid,
    291           LineType = DataRowType.SingleValue
    292         };
     292        AvgAggregator avgAggregator = new AvgAggregator();
     293        avgAggregator.RowSettings.Label = "AvgAggregator";
     294        avgAggregator.RowSettings.Color = Color.Violet;
     295        avgAggregator.RowSettings.Thickness = 3;
     296        avgAggregator.Style = DrawingStyle.Solid;
     297        avgAggregator.LineType = DataRowType.SingleValue;
    293298        avgAggregator.AddWatch(row1);
    294299        model.AddDataRow(avgAggregator);
     
    310315
    311316      public void DoWorkAvgLine() {
    312         IDataRow row1 = new DataRow {
    313           Color = Color.Red,
    314           Thickness = 2,
    315           Label = "Sinus",
    316           Style = DrawingStyle.Solid,
    317           ShowMarkers = false
    318         };
     317        IDataRow row1 = new DataRow();
     318        row1.RowSettings.Color = Color.Red;
     319        row1.RowSettings.Thickness = 2;
     320        row1.RowSettings.Label = "Sinus";
     321        row1.Style = DrawingStyle.Solid;
     322        row1.ShowMarkers = false;
    319323        model.AddDataRow(row1);
    320324
    321         IDataRow row2 = new DataRow {
    322           Color = Color.Red,
    323           Thickness = 3,
    324           Label = "Growing",
    325           Style = DrawingStyle.Solid,
    326           ShowMarkers = false
    327         };
     325        IDataRow row2 = new DataRow();
     326        row2.RowSettings.Color = Color.Red;
     327        row2.RowSettings.Thickness = 3;
     328        row2.RowSettings.Label = "Growing";
     329        row2.Style = DrawingStyle.Solid;
     330        row2.ShowMarkers = false;
    328331        model.AddDataRow(row2);
    329332
    330         AvgLineAggregator avgLineAggregator = new AvgLineAggregator {
    331           Label = "AvgLineAggregator",
    332           Color = Color.Violet,
    333           Thickness = 3,
    334           Style = DrawingStyle.Solid,
    335           LineType = DataRowType.Normal,
    336           ShowMarkers = false
    337         };
     333        AvgLineAggregator avgLineAggregator = new AvgLineAggregator();
     334        avgLineAggregator.RowSettings.Label = "AvgLineAggregator";
     335        avgLineAggregator.RowSettings.Color = Color.Violet;
     336        avgLineAggregator.RowSettings.Thickness = 3;
     337        avgLineAggregator.Style = DrawingStyle.Solid;
     338        avgLineAggregator.LineType = DataRowType.Normal;
     339        avgLineAggregator.ShowMarkers = false;
    338340        avgLineAggregator.AddWatch(row1);
    339341        avgLineAggregator.AddWatch(row2);
     
    355357
    356358      public void DoWorkFloatingAvg() {
    357         IDataRow row1 = new DataRow {
    358           Color = Color.Red,
    359           Thickness = 2,
    360           Label = "SinusHacked",
    361           Style = DrawingStyle.Solid,
    362           ShowMarkers = false
    363         };
     359        IDataRow row1 = new DataRow();
     360        row1.RowSettings.Color = Color.Red;
     361        row1.RowSettings.Thickness = 2;
     362        row1.RowSettings.Label = "SinusHacked";
     363        row1.Style = DrawingStyle.Solid;
     364        row1.ShowMarkers = false;
    364365        model.AddDataRow(row1);
    365366
    366         IDataRow row2 = new DataRow {
    367           Color = Color.Red,
    368           Thickness = 3,
    369           Label = "GrowingHacked",
    370           Style = DrawingStyle.Solid,
    371           ShowMarkers = false
    372         };
     367        IDataRow row2 = new DataRow();
     368        row2.RowSettings.Color = Color.Red;
     369        row2.RowSettings.Thickness = 3;
     370        row2.RowSettings.Label = "GrowingHacked";
     371        row2.Style = DrawingStyle.Solid;
     372        row2.ShowMarkers = false;
    373373        model.AddDataRow(row2);
    374374
    375         FloatingAvgAggregator avgAggregator = new FloatingAvgAggregator {
    376                                                                           Thickness = 2,
    377                                                                           Label = "floatingAvg",
    378                                                                           Color = Color.Peru,
    379                                                                           ShowMarkers = false,
    380                                                                           Style = DrawingStyle.Solid
    381                                                                         };
     375        FloatingAvgAggregator avgAggregator = new FloatingAvgAggregator();
     376        avgAggregator.RowSettings.Thickness = 2;
     377        avgAggregator.RowSettings.Label = "floatingAvg";
     378        avgAggregator.RowSettings.Color = Color.Peru;
     379        avgAggregator.ShowMarkers = false;
     380        avgAggregator.Style = DrawingStyle.Solid;
    382381
    383382        avgAggregator.AddWatch(row1);
    384383        model.AddDataRow(avgAggregator);
    385384
    386         FloatingAvgAggregator avgAggregator2 = new FloatingAvgAggregator {
    387           Thickness = 2,
    388           Label = "floatingAvg",
    389           Color = Color.Aqua,
    390           ShowMarkers = false,
    391           Style = DrawingStyle.Solid
    392         };
     385        FloatingAvgAggregator avgAggregator2 = new FloatingAvgAggregator();
     386        avgAggregator2.RowSettings.Thickness = 2;
     387        avgAggregator2.RowSettings.Label = "floatingAvg";
     388        avgAggregator2.RowSettings.Color = Color.Aqua;
     389        avgAggregator2.ShowMarkers = false;
     390        avgAggregator2.Style = DrawingStyle.Solid;
    393391
    394392        avgAggregator2.AddWatch(row2);
     
    490488    [Test]
    491489    public void TestAutoZoomInConstructor() {
    492       IDataRow row1 = new DataRow { Color = Color.Red, Thickness = 3, Style = DrawingStyle.Solid };
     490      IDataRow row1 = new DataRow();
     491      row1.RowSettings.Color = Color.Red;
     492      row1.RowSettings.Thickness = 3;
     493      row1.Style = DrawingStyle.Solid;
    493494
    494495      model.AddDataRow(row1);
     
    518519      IDataRow row6 = new DataRow();
    519520
    520       row1.Color = Color.Red;
    521       row2.Color = Color.Green;
    522       row3.Color = Color.Blue;
    523 
    524       row4.Color = Color.DeepPink;
    525       row5.Color = Color.Firebrick;
    526       row6.Color = Color.DarkSlateGray;
    527 
    528       row1.Thickness = 3;
    529       row2.Thickness = 4;
    530       row3.Thickness = 5;
    531 
    532       row4.Thickness = 3;
    533       row5.Thickness = 4;
    534       row6.Thickness = 5;
    535 
    536       row1.Label = "SingleValue";
    537       row2.Label = "Gertschi";
    538       row3.Label = "Maxi";
    539 
    540       row4.Label = "Simon";
    541       row5.Label = "klausmuellerwesternhagenunddierasperies";
    542       row6.Label = "anyways";
     521      row1.RowSettings.Color = Color.Red;
     522      row2.RowSettings.Color = Color.Green;
     523      row3.RowSettings.Color = Color.Blue;
     524
     525      row4.RowSettings.Color = Color.DeepPink;
     526      row5.RowSettings.Color = Color.Firebrick;
     527      row6.RowSettings.Color = Color.DarkSlateGray;
     528
     529      row1.RowSettings.Thickness = 3;
     530      row2.RowSettings.Thickness = 4;
     531      row3.RowSettings.Thickness = 5;
     532
     533      row4.RowSettings.Thickness = 3;
     534      row5.RowSettings.Thickness = 4;
     535      row6.RowSettings.Thickness = 5;
     536
     537      row1.RowSettings.Label = "SingleValue";
     538      row2.RowSettings.Label = "Gertschi";
     539      row3.RowSettings.Label = "Maxi";
     540
     541      row4.RowSettings.Label = "Simon";
     542      row5.RowSettings.Label = "klausmuellerwesternhagenunddierasperies";
     543      row6.RowSettings.Label = "anyways";
    543544
    544545      row1.Style = DrawingStyle.Solid;
     
    587588    [Test]
    588589    public void TestPointLines() {
    589       IDataRow row1 = new DataRow { Color = Color.Red, Thickness = 3, Style = DrawingStyle.Dashed };
     590      IDataRow row1 = new DataRow();
     591      row1.RowSettings.Color = Color.Red;
     592      row1.RowSettings.Thickness = 3;
     593      row1.Style = DrawingStyle.Dashed;
    590594
    591595      row1.LineType = DataRowType.Points;
Note: See TracChangeset for help on using the changeset viewer.