Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/02/10 21:34:31 (14 years ago)
Author:
abeham
Message:

#1029

  • Added Bounds to SingleObjectiveTestFunctionSolution
  • This would break persistence, so I added a CompatibilityMethod (which can be removed again once moving to 3.4)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TestFunctions.Views/3.3/SingleObjectiveTestFunctionSolutionView.cs

    r3668 r3894  
    5555      Content.QualityChanged -= new EventHandler(Content_QualityChanged);
    5656      Content.PopulationChanged -= new EventHandler(Content_PopulationChanged);
     57      Content.BoundsChanged -= new EventHandler(Content_BoundsChanged);
    5758      base.DeregisterContentEvents();
    5859    }
     
    6364      Content.QualityChanged += new EventHandler(Content_QualityChanged);
    6465      Content.PopulationChanged += new EventHandler(Content_PopulationChanged);
     66      Content.BoundsChanged += new EventHandler(Content_BoundsChanged);
    6567    }
    6668
     
    99101        GenerateImage();
    100102      }
     103    }
     104
     105    private void Content_BoundsChanged(object sender, EventArgs e) {
     106      if (InvokeRequired)
     107        Invoke(new EventHandler(Content_BoundsChanged), sender, e);
     108      else
     109        GenerateImage();
    101110    }
    102111
     
    139148          }
    140149          pictureBox.Refresh();
    141           DoubleMatrix bounds = Content.Evaluator.Bounds;
     150          DoubleMatrix bounds = Content.Bounds;
     151          if (bounds == null) bounds = Content.Evaluator.Bounds;
    142152          double xMin = bounds[0, 0], xMax = bounds[0, 1], yMin = bounds[1 % bounds.Rows, 0], yMax = bounds[1 % bounds.Rows, 1];
    143153          double xStep = backgroundImage.Width / (xMax - xMin), yStep = backgroundImage.Height / (yMax - yMin);
     
    164174        backgroundImage.Dispose();
    165175      backgroundImage = new Bitmap(pictureBox.Width, pictureBox.Height);
    166       DoubleMatrix bounds = Content.Evaluator.Bounds;
     176      DoubleMatrix bounds = Content.Bounds;
     177      if (bounds == null) bounds = Content.Evaluator.Bounds;
    167178      double xMin = bounds[0, 0], xMax = bounds[0, 1], yMin = bounds[1 % bounds.Rows, 0], yMax = bounds[1 % bounds.Rows, 1];
    168179      double xStep = (xMax - xMin) / backgroundImage.Width, yStep = (yMax - yMin) / backgroundImage.Height;
Note: See TracChangeset for help on using the changeset viewer.