Changeset 13135 for branches/OptimizationNetworks/HeuristicLab.Networks
- Timestamp:
- 11/11/15 13:53:10 (9 years ago)
- Location:
- branches/OptimizationNetworks/HeuristicLab.Networks/3.3
- Files:
-
- 1 added
- 6 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/INetworkItem.cs
r13077 r13135 23 23 24 24 namespace HeuristicLab.Core.Networks { 25 public interface INetworkItem : INamedItem {25 public interface INetworkItem : INamedItem, IVisualizable { 26 26 INetworkItem Parent { get; } 27 27 IEnumerable<INetworkItem> Children { get; } -
branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/IVisualProperties.cs
r13077 r13135 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 24 25 namespace HeuristicLab.Core.Networks { 25 public interface IVisualProperties {26 public interface IVisualProperties : IDeepCloneable { 26 27 event EventHandler Changed; 27 28 } -
branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/NetworkItem.cs
r13077 r13135 47 47 } 48 48 49 [Storable] 50 public IVisualProperties VisualProperties { get; set; } 51 49 52 [StorableConstructor] 50 53 protected NetworkItem(bool deserializing) : base(deserializing) { } 51 protected NetworkItem(NetworkItem original, Cloner cloner) : base(original, cloner) { } 54 protected NetworkItem(NetworkItem original, Cloner cloner) : base(original, cloner) { 55 VisualProperties = cloner.Clone(original.VisualProperties); 56 } 52 57 protected NetworkItem() : base("NetworkItem") { } 53 58 protected NetworkItem(string name) : base(name) { } -
branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/Node.cs
r13077 r13135 29 29 [Item("Node", "Abstract base class for nodes of a network.")] 30 30 [StorableClass] 31 public abstract class Node : NetworkItem, I VisualizableNode {31 public abstract class Node : NetworkItem, INode { 32 32 public static new Image StaticItemImage { 33 33 get { return HeuristicLab.Common.Resources.VSImageLibrary.RadialChart; } … … 55 55 if (readOnlyPorts == null) readOnlyPorts = ports.AsReadOnly(); 56 56 return readOnlyPorts; 57 }58 }59 60 public string VisualName { get { return Name; } }61 62 [Storable]63 private INodeVisualProperties visualProperties;64 public INodeVisualProperties VisualProperties {65 get {66 if (visualProperties == null)67 visualProperties = new NodeVisualProperties();68 return visualProperties;69 57 } 70 58 } -
branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/Port.cs
r13077 r13135 27 27 [Item("Port", "Abstract base class for ports of network nodes.")] 28 28 [StorableClass] 29 public abstract class Port : NetworkItem, I VisualizablePort {29 public abstract class Port : NetworkItem, IPort { 30 30 public static new Image StaticItemImage { 31 31 get { return HeuristicLab.Common.Resources.VSImageLibrary.Interface; } … … 40 40 } 41 41 42 [Storable]43 private IPortVisualProperties visualProperties;44 public IPortVisualProperties VisualProperties {45 get {46 if (visualProperties == null)47 visualProperties = new PortVisualProperties();48 return visualProperties;49 }50 }51 52 42 [StorableConstructor] 53 43 protected Port(bool deserializing) : base(deserializing) { } -
branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/VisualProperties.cs
r13077 r13135 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using HeuristicLab.Common; 3 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 5 26 namespace HeuristicLab.Core.Networks { 6 27 [StorableClass] 7 public class VisualProperties : DeepCloneable, IVisualProperties {28 public abstract class VisualProperties : DeepCloneable, IVisualProperties { 8 29 #region Constructors & Cloning 9 30 [StorableConstructor] 10 31 protected VisualProperties(bool deserializing) : base() { } 11 protected VisualProperties(VisualProperties original, Cloner cloner) 12 : base(original, cloner) { } 32 protected VisualProperties(VisualProperties original, Cloner cloner) : base(original, cloner) { } 13 33 14 public VisualProperties() { } 15 16 public override IDeepCloneable Clone(Cloner cloner) { 17 return new VisualProperties(this, cloner); 18 } 34 protected VisualProperties() { } 19 35 #endregion 20 36 -
branches/OptimizationNetworks/HeuristicLab.Networks/3.3/HeuristicLab.Networks-3.3.csproj
r13077 r13135 203 203 </Compile> 204 204 <Compile Include="ConfigurationPort.cs" /> 205 <Compile Include="Core\INodeVisualProperties.cs" /> 206 <Compile Include="Core\IPortVisualProperties.cs" /> 207 <Compile Include="Core\IVisualizableNode.cs" /> 208 <Compile Include="Core\IVisualizablePort.cs" /> 205 <Compile Include="Core\IVisualizable.cs" /> 209 206 <Compile Include="Core\IVisualProperties.cs" /> 210 <Compile Include="Core\NodeVisualProperties.cs" />211 <Compile Include="Core\PortVisualProperties.cs" />212 207 <Compile Include="Core\VisualProperties.cs" /> 213 208 <Compile Include="ExecutionPort.cs" /> -
branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Programmable/ProgrammableNetworkItem.cs
r13077 r13135 98 98 get { return CompiledNetworkItem.Children; } 99 99 } 100 101 [Storable] 102 public IVisualProperties VisualProperties { get; set; } 100 103 #endregion 101 104 … … 169 172 variableStore = cloner.Clone(original.variableStore); 170 173 CompiledNetworkItem = cloner.Clone(original.compiledNetworkItem); 174 VisualProperties = cloner.Clone(original.VisualProperties); 171 175 } 172 176 protected ProgrammableNetworkItem() … … 358 362 get { return Enumerable.Empty<INetworkItem>(); } 359 363 } 364 365 // TODO: no visual properties needed here 366 public IVisualProperties VisualProperties { 367 get { return Context.VisualProperties; } 368 set { Context.VisualProperties = value; } 369 } 360 370 #endregion 361 371 -
branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Programmable/ProgrammableNode.cs
r13077 r13135 32 32 [Item("ProgrammableNode", "Abstract base class for programmable nodes of a network.")] 33 33 [StorableClass] 34 public abstract class ProgrammableNode : ProgrammableNetworkItem, IProgrammableNode , IVisualizableNode{34 public abstract class ProgrammableNode : ProgrammableNetworkItem, IProgrammableNode { 35 35 public static new Image StaticItemImage { 36 36 get { return HeuristicLab.Common.Resources.VSImageLibrary.RadialChart; } … … 58 58 } 59 59 } 60 61 public string VisualName { get { return Name; } }62 63 [Storable]64 private INodeVisualProperties visualProperties;65 public INodeVisualProperties VisualProperties {66 get {67 if (visualProperties == null)68 visualProperties = new NodeVisualProperties();69 return visualProperties;70 }71 }72 60 #endregion 73 61 … … 127 115 IKeyedItemCollection<string, IPort> INode.Ports { 128 116 get { return Ports; } 129 }130 131 public string VisualName { get { return Context.VisualName; } }132 133 public INodeVisualProperties VisualProperties {134 get { return Context.VisualProperties; }135 117 } 136 118 #endregion
Note: See TracChangeset
for help on using the changeset viewer.