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

#2205: worked on optimization networks

  • added layout algorithm prototype
  • fixed bug in LoadVisualProperties methods
File:
1 edited

Legend:

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

    r13799 r13833  
    3939    public MessagePortRectangle(IChart chart, IMessagePort port, INode node)
    4040      : base(chart, port, node) {
    41       IdleBrush = new SolidBrush(VisualProperties.BrushColor);
    42       port.MessageSent += (sender, args) => Highlight(MessageSentBrush);
    43       port.MessageReceived += (sender, args) => Highlight(MessageReceivedBrush);
     41      IdleBrush = Brush;
     42    }
     43
     44    protected override void RegisterNetworkItemEvents() {
     45      base.RegisterNetworkItemEvents();
     46      NetworkItem.MessageSent += NetworkItem_MessageSent;
     47      NetworkItem.MessageReceived += Port_MessageReceived;
     48    }
     49
     50    protected override void DeregisterNetworkItemEvents() {
     51      NetworkItem.MessageReceived -= Port_MessageReceived;
     52      NetworkItem.MessageSent -= NetworkItem_MessageSent;
     53      base.DeregisterNetworkItemEvents();
     54    }
     55
     56    private void Port_MessageReceived(object sender, Common.EventArgs<IMessage, System.Threading.CancellationToken> e) {
     57      Highlight(MessageReceivedBrush);
     58    }
     59
     60
     61    private void NetworkItem_MessageSent(object sender, Common.EventArgs<IMessage, System.Threading.CancellationToken> e) {
     62      Highlight(MessageSentBrush);
    4463    }
    4564
Note: See TracChangeset for help on using the changeset viewer.