Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/23/15 16:22:22 (9 years ago)
Author:
bburlacu
Message:

#1772: Adapted visualization code according to the changes in the HeuristicLab.Visualization branch.

Location:
branches/HeuristicLab.EvolutionTracking
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs

    r10884 r13061  
    109109
    110110    new private void Clear() {
    111       Group.Clear();
     111      base.Clear();
    112112      primitivesToNodes.Clear();
    113113      nodesToPrimitives.Clear();
     
    129129      PreferredNodeWidth = 80;
    130130      PreferredNodeHeight = 40;
    131       Group = new Group(chart);
     131      //      Group = new Group(chart);
    132132
    133133      defaultBrush = new SolidBrush(Color.Transparent);
     
    160160        if (node.SubtreeCount == 0) {
    161161          rectangularPrimitive = new Rectangle(Chart, lowerLeft, upperRight) {
    162             Font = defaultFont, Text = shortenedLabel, Brush = defaultBrush, Pen = defaultPen, MaximumFontSize = 12f
     162            //            Font = defaultFont, Text = shortenedLabel, Brush = defaultBrush, Pen = defaultPen, MaximumFontSize = 12f
    163163          };
    164164        } else {
    165165          rectangularPrimitive = new Ellipse(Chart, lowerLeft, upperRight) {
    166             Font = defaultFont, Text = shortenedLabel, Brush = defaultBrush, Pen = defaultPen, MaximumFontSize = 12f
     166            //            Font = defaultFont, Text = shortenedLabel, Brush = defaultBrush, Pen = defaultPen, MaximumFontSize = 12f
    167167          };
    168168        }
     
    200200        Pen = defaultPen,
    201201        Brush = defaultBrush,
    202         Text = Label,
    203         Font = defaultFont
     202        //        Text = Label,
     203        //        Font = defaultFont
    204204      };
    205205      this.Add(labelRect);
     
    218218        var rpb = primitive as RectangularPrimitiveBase;
    219219        if (rpb != null) {
    220           rpb.SetPosition(rpb.LowerLeft.X, Size.Height - rpb.UpperRight.Y, rpb.UpperRight.X, Size.Height - rpb.LowerLeft.Y);
     220          var lowerLeft = new PointD(rpb.LowerLeft.X, Size.Height - rpb.UpperRight.Y);
     221          var upperRight = new PointD(rpb.UpperRight.X, Size.Height - rpb.LowerLeft.Y);
     222          rpb.SetPosition(lowerLeft, upperRight);
    221223
    222224        } else {
    223225          var line = primitive as LinearPrimitiveBase;
    224226          if (line != null) {
    225             line.SetPosition(line.Start.X, Size.Height - line.Start.Y, line.End.X, Size.Height - line.End.Y);
     227            var lowerLeft = new PointD(line.Start.X, Size.Height - line.Start.Y);
     228            var upperRight = new PointD(line.End.X, Size.Height - line.End.Y);
     229            line.SetPosition(lowerLeft, upperRight);
    226230          }
    227231        }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs

    r12208 r13061  
    8080    }
    8181
    82     public bool UpdateEnabled {
    83       get { return Chart.UpdateEnabled; }
    84       set { Chart.UpdateEnabled = value; }
    85     }
    86 
    87     public void EnforceUpdate() {
    88       Chart.EnforceUpdate();
    89     }
     82    //    public bool UpdateEnabled {
     83    //      get { return Chart.UpdateEnabled; }
     84    //      set { Chart.UpdateEnabled = value; }
     85    //    }
     86
     87    //    public void EnforceUpdate() {
     88    //      Chart.EnforceUpdate();
     89    //    }
    9090
    9191    private Visualization.Rectangle TargetRectangle { get; set; }
     
    118118
    119119    protected virtual void DrawGraph(double xIncrement, double yIncrement, double diameter) {
    120       Chart.UpdateEnabled = false;
     120      this.SuspendRendering();
    121121      DrawInProgress = true;
    122122
     
    160160          var pen = Pens.Transparent;
    161161          var visualArc = AddArc(Chart, visualParent, visualNode, pen);
    162           visualArc.OneLayerDown(); // send it behind the visual nodes
     162          Chart.OneLayerDown(visualArc); // send it behind the visual nodes
    163163          if (!arcMap.ContainsKey(Tuple.Create(visualParent, visualNode))) {
    164164            arcMap.Add(Tuple.Create(visualParent, visualNode), visualArc);
     
    167167      }
    168168
    169       Chart.UpdateEnabled = true;
    170       Chart.EnforceUpdate();
    171 
     169      ResumeRendering();
    172170      DrawInProgress = false;
    173171    }
     
    187185    #region event handlers
    188186
    189     protected override void pictureBox_MouseMove(object sender, MouseEventArgs e) {
     187    protected override void PictureBoxOnMouseMove(object sender, MouseEventArgs e) {
    190188      if (!DrawInProgress) {
    191189        switch (e.Button) {
    192190          case MouseButtons.Left:
    193             Chart.Mode = ChartMode.Select;
     191            Mode = ChartMode.Select;
    194192            Cursor = Cursors.Default;
    195193            break;
    196194          case MouseButtons.Middle:
    197             Chart.Mode = ChartMode.Move;
     195            Mode = ChartMode.Move;
    198196            Cursor = Cursors.Hand;
    199197            break;
    200198        }
    201199      }
    202       base.pictureBox_MouseMove(sender, e);
    203     }
    204 
    205     protected override void pictureBox_MouseUp(object sender, MouseEventArgs e) {
     200      base.PictureBoxOnMouseMove(sender, e);
     201    }
     202
     203    protected override void PictureBoxOnMouseUp(object sender, MouseEventArgs e) {
    206204      Cursor = Cursors.Default;
    207       if (Chart.Mode == ChartMode.Move) {
    208         Chart.Mode = ChartMode.Select;
     205      if (Mode == ChartMode.Move) {
     206        Mode = ChartMode.Select;
    209207        return;
    210208      }
    211       if (Chart.Mode != ChartMode.Select) {
    212         base.pictureBox_MouseUp(sender, e);
     209      if (Mode != ChartMode.Select) {
     210        base.PictureBoxOnMouseUp(sender, e);
    213211        return;
    214212      }
     
    224222      UpdateSelectedVisualNode(); // redraw ancestries, mark node etc.
    225223
    226       base.pictureBox_MouseUp(sender, e);
     224      base.PictureBoxOnMouseUp(sender, e);
    227225    }
    228226
     
    230228      if (!LockGenealogy) {
    231229        // new node has been selected, clean up
    232         Chart.UpdateEnabled = false;
     230        SuspendRendering();
    233231        if (ModifierKeys != Keys.Shift) {
    234232          // clear colors
     
    247245
    248246      // update
    249       UpdateEnabled = true;
    250       EnforceUpdate();
     247      ResumeRendering();
    251248
    252249      if (SelectedVisualNode != null)
     
    281278      double y2 = y1 + size.Height;
    282279      if (TargetRectangle == null) {
    283         TargetRectangle = new Visualization.Rectangle(Chart, x1, y1, x2, y2, new Pen(Color.Black), null);
     280        var lowerLeft = new PointD(x1, y1);
     281        var upperRight = new PointD(x2, y2);
     282        TargetRectangle = new Visualization.Rectangle(Chart, lowerLeft, upperRight, new Pen(Color.Black), null);
    284283        Chart.Group.Add(TargetRectangle);
    285284      } else {
    286         TargetRectangle.SetPosition(x1, y1, x2, y2);
     285        var lowerLeft = new PointD(x1, y1);
     286        var upperRight = new PointD(x2, y2);
     287        TargetRectangle.SetPosition(lowerLeft, upperRight);
    287288      }
    288289    }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.Designer.cs

    r12208 r13061  
    4242      // splitContainer
    4343      //
    44       this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    45             | System.Windows.Forms.AnchorStyles.Left) 
     44      this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     45            | System.Windows.Forms.AnchorStyles.Left)
    4646            | System.Windows.Forms.AnchorStyles.Right)));
    4747      this.splitContainer.Location = new System.Drawing.Point(3, 55);
     
    6161      // viewHost
    6262      //
    63       this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    64             | System.Windows.Forms.AnchorStyles.Left) 
     63      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     64            | System.Windows.Forms.AnchorStyles.Left)
    6565            | System.Windows.Forms.AnchorStyles.Right)));
    6666      this.viewHost.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     
    137137      // genealogyGraphChart
    138138      //
    139       this.genealogyGraphChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    140             | System.Windows.Forms.AnchorStyles.Left) 
     139      this.genealogyGraphChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     140            | System.Windows.Forms.AnchorStyles.Left)
    141141            | System.Windows.Forms.AnchorStyles.Right)));
    142142      this.genealogyGraphChart.BackColor = System.Drawing.SystemColors.Control;
     
    151151      this.genealogyGraphChart.TabIndex = 0;
    152152      this.genealogyGraphChart.TraceFragments = false;
    153       this.genealogyGraphChart.UpdateEnabled = true;
    154153      //
    155154      // GenealogyGraphView
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs

    r12406 r13061  
    139139        var subtreeIndex = graphNode.Data.IterateNodesPrefix().ToList().IndexOf(node);
    140140        var traceGraph = TraceCalculator.TraceSubtree(graphNode, subtreeIndex, updateVertexWeights: false, updateSubtreeWeights: false, cacheTraceNodes: true);
    141         genealogyGraphChart.UpdateEnabled = false;
     141        genealogyGraphChart.SuspendRendering();
    142142        genealogyGraphChart.ClearPrimitives(); // clear everything
    143143        var rankMaximums = new Dictionary<double, double>();
     
    177177          }
    178178        }
    179         genealogyGraphChart.UpdateEnabled = true;
    180         genealogyGraphChart.EnforceUpdate();
     179        genealogyGraphChart.ResumeRendering();
    181180      } else {
    182181        // perform matching like it was done before
     
    218217
    219218      switch (args.Button) {
    220         case MouseButtons.Left: {
     219        case MouseButtons.Left:
     220          {
    221221            OnTreeNodeLeftClicked(subtree);
    222222            break;
    223223          }
    224         case MouseButtons.Middle: {
     224        case MouseButtons.Middle:
     225          {
    225226            OnTreeNodeMiddleClicked(subtree);
    226227            break;
     
    243244
    244245    private void graphChart_HighlightMatchingVertices(IEnumerable<IGenealogyGraphNode> vertices) {
    245       genealogyGraphChart.Chart.UpdateEnabled = false;
     246      genealogyGraphChart.SuspendRendering();
    246247      genealogyGraphChart.ClearPrimitives();
    247248      genealogyGraphChart.HighlightNodes(vertices);
    248       genealogyGraphChart.Chart.UpdateEnabled = true;
    249       genealogyGraphChart.Chart.EnforceUpdate();
     249      genealogyGraphChart.ResumeRendering();
    250250    }
    251251
Note: See TracChangeset for help on using the changeset viewer.