- Timestamp:
- 05/04/16 15:15:10 (9 years ago)
- Location:
- branches/OptimizationNetworks/HeuristicLab.Networks.Views.NetworkVisualization/3.3
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Networks.Views.NetworkVisualization/3.3/HeuristicLab.Networks.Views.NetworkVisualization-3.3.csproj
r13799 r13833 113 113 <Compile Include="INodeVisualProperties.cs" /> 114 114 <Compile Include="IPortVisualProperties.cs" /> 115 <Compile Include="Layout.cs" /> 115 116 <Compile Include="NodeVisualProperties.cs" /> 116 117 <Compile Include="Orientation.cs" /> -
branches/OptimizationNetworks/HeuristicLab.Networks.Views.NetworkVisualization/3.3/Primitives/AlgorithmNodeRectangle.cs
r13799 r13833 30 30 protected readonly Brush ActiveBrush = new SolidBrush(Color.FromArgb(255, 100, 200, 100)); 31 31 32 public new IAlgorithmNode NetworkItem { 33 get { return (IAlgorithmNode)base.NetworkItem; } 34 set { base.NetworkItem = value; } 35 } 36 32 37 public AlgorithmNodeRectangle(IChart chart, IAlgorithmNode node) 33 38 : base(chart, node) { 34 39 Brush = InactiveBrush; 35 node.Algorithm.Started += (sender, args) => Brush = ActiveBrush;36 node.Algorithm.Stopped += (sender, args) => Brush = InactiveBrush;37 node.StartedAlgorithmsChanged += (sender, args) => Brush = ((IAlgorithmNode)sender).StartedAlgorithms.Any() ? ActiveBrush : InactiveBrush;38 40 } 41 42 protected override void RegisterNetworkItemEvents() { 43 base.RegisterNetworkItemEvents(); 44 NetworkItem.StartedAlgorithmsChanged += NetworkItem_StartedAlgorithmsChanged; 45 if (NetworkItem.Algorithm != null) { 46 NetworkItem.Algorithm.Started += Algorithm_Started; ; 47 NetworkItem.Algorithm.Stopped += Algorithm_Stopped; ; 48 } 49 } 50 51 protected override void DeregisterNetworkItemEvents() { 52 if (NetworkItem.Algorithm != null) { 53 NetworkItem.Algorithm.Stopped -= Algorithm_Stopped; ; 54 NetworkItem.Algorithm.Started -= Algorithm_Started; ; 55 } 56 NetworkItem.StartedAlgorithmsChanged -= NetworkItem_StartedAlgorithmsChanged; 57 base.DeregisterNetworkItemEvents(); 58 } 59 60 private void NetworkItem_StartedAlgorithmsChanged(object sender, System.EventArgs e) { 61 Brush = ((IAlgorithmNode)sender).StartedAlgorithms.Any() ? ActiveBrush : InactiveBrush; 62 } 63 private void Algorithm_Started(object sender, System.EventArgs e) { Brush = ActiveBrush; } 64 private void Algorithm_Stopped(object sender, System.EventArgs e) { Brush = InactiveBrush; } 39 65 } 40 66 } -
branches/OptimizationNetworks/HeuristicLab.Networks.Views.NetworkVisualization/3.3/Primitives/MessagePortRectangle.cs
r13799 r13833 39 39 public MessagePortRectangle(IChart chart, IMessagePort port, INode node) 40 40 : 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); 44 63 } 45 64 -
branches/OptimizationNetworks/HeuristicLab.Networks.Views.NetworkVisualization/3.3/Primitives/NodeRectangle.cs
r13799 r13833 255 255 #region Helpers 256 256 private void LoadVisualProperties() { 257 if (VisualProperties == null) 258 VisualProperties = new NodeVisualProperties(); 259 260 var vp = VisualProperties; 257 INodeVisualProperties vp = new NodeVisualProperties(); 258 259 if (networkItem != null) 260 if (VisualProperties == null) VisualProperties = vp; 261 else vp = VisualProperties; 262 261 263 IgnoreVisualPropertiesChanges = true; 262 264 try { -
branches/OptimizationNetworks/HeuristicLab.Networks.Views.NetworkVisualization/3.3/Primitives/PortRectangle.cs
r13799 r13833 205 205 #region Helpers 206 206 private void LoadVisualProperties() { 207 if (VisualProperties == null) 208 VisualProperties = new PortVisualProperties(); 209 210 var vp = VisualProperties; 207 IPortVisualProperties vp = new PortVisualProperties(); 208 209 if (networkItem != null) 210 if (VisualProperties == null) VisualProperties = vp; 211 else vp = VisualProperties; 212 211 213 IgnoreVisualPropertiesChanges = true; 212 214 try {
Note: See TracChangeset
for help on using the changeset viewer.