Ignore:
Timestamp:
04/26/16 15:05:28 (3 years ago)
Author:
jkarder
Message:

#2205: worked on optimization networks

  • improved network visualization
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Networks.Views.NetworkVisualization.Views/3.3/NetworkVisualizationView.cs

    r13135 r13799  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    4647      InitializeComponent();
    4748
    48       var initialMode = new SelectChartMode(chartControl);
     49      var selectMode = new SelectChartMode(chartControl);
     50      selectMode.SelectedPrimitivesChanged += SelectMode_SelectedPrimitivesChanged;
    4951      chartControl.AddChartModes(
    50         initialMode,
     52        selectMode,
    5153        new PanChartMode(chartControl),
    5254        new RulerChartMode(chartControl),
     
    5759        new ConnectPortsChartMode(chartControl)
    5860      );
    59       chartControl.Mode = initialMode;
     61      chartControl.Mode = selectMode;
    6062    }
    6163
     
    8789
    8890    #region Event Handlers
     91    private void SelectMode_SelectedPrimitivesChanged(object sender, EventArgs e) {
     92      var selectedPrimitives = chartControl.Chart.Group.SelectedPrimitives;
     93      var nodePrimitive = selectedPrimitives.OfType<NodeRectangle>().SingleOrDefault();
     94      viewHost.Content = nodePrimitive != null ? nodePrimitive.NetworkItem : null;
     95    }
     96
    8997    #region Nodes Event Handlers
    9098    private void Nodes_ItemsAdded(object sender, CollectionItemsChangedEventArgs<INode> e) {
     
    111119    private void Ports_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IPort> e) { }
    112120    #endregion
     121
     122    private void detailsToggleButton_Click(object sender, EventArgs e) {
     123      splitContainer.Panel2Collapsed = !splitContainer.Panel2Collapsed;
     124      detailsToggleButton.Text = splitContainer.Panel2Collapsed ? "<" : ">";
     125    }
    113126    #endregion
    114127
Note: See TracChangeset for help on using the changeset viewer.