Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/11/15 13:53:10 (9 years ago)
Author:
jkarder
Message:

#2205: worked on optimization networks

  • refactored network visualization
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  
    2323
    2424namespace HeuristicLab.Core.Networks {
    25   public interface INetworkItem : INamedItem {
     25  public interface INetworkItem : INamedItem, IVisualizable {
    2626    INetworkItem Parent { get; }
    2727    IEnumerable<INetworkItem> Children { get; }
  • branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/IVisualProperties.cs

    r13077 r13135  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324
    2425namespace HeuristicLab.Core.Networks {
    25   public interface IVisualProperties {
     26  public interface IVisualProperties : IDeepCloneable {
    2627    event EventHandler Changed;
    2728  }
  • branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/NetworkItem.cs

    r13077 r13135  
    4747    }
    4848
     49    [Storable]
     50    public IVisualProperties VisualProperties { get; set; }
     51
    4952    [StorableConstructor]
    5053    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    }
    5257    protected NetworkItem() : base("NetworkItem") { }
    5358    protected NetworkItem(string name) : base(name) { }
  • branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/Node.cs

    r13077 r13135  
    2929  [Item("Node", "Abstract base class for nodes of a network.")]
    3030  [StorableClass]
    31   public abstract class Node : NetworkItem, IVisualizableNode {
     31  public abstract class Node : NetworkItem, INode {
    3232    public static new Image StaticItemImage {
    3333      get { return HeuristicLab.Common.Resources.VSImageLibrary.RadialChart; }
     
    5555        if (readOnlyPorts == null) readOnlyPorts = ports.AsReadOnly();
    5656        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;
    6957      }
    7058    }
  • branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/Port.cs

    r13077 r13135  
    2727  [Item("Port", "Abstract base class for ports of network nodes.")]
    2828  [StorableClass]
    29   public abstract class Port : NetworkItem, IVisualizablePort {
     29  public abstract class Port : NetworkItem, IPort {
    3030    public static new Image StaticItemImage {
    3131      get { return HeuristicLab.Common.Resources.VSImageLibrary.Interface; }
     
    4040    }
    4141
    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 
    5242    [StorableConstructor]
    5343    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
     22using System;
    223using HeuristicLab.Common;
    324using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    526namespace HeuristicLab.Core.Networks {
    627  [StorableClass]
    7   public class VisualProperties : DeepCloneable, IVisualProperties {
     28  public abstract class VisualProperties : DeepCloneable, IVisualProperties {
    829    #region Constructors & Cloning
    930    [StorableConstructor]
    1031    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) { }
    1333
    14     public VisualProperties() { }
    15 
    16     public override IDeepCloneable Clone(Cloner cloner) {
    17       return new VisualProperties(this, cloner);
    18     }
     34    protected VisualProperties() { }
    1935    #endregion
    2036
  • branches/OptimizationNetworks/HeuristicLab.Networks/3.3/HeuristicLab.Networks-3.3.csproj

    r13077 r13135  
    203203    </Compile>
    204204    <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" />
    209206    <Compile Include="Core\IVisualProperties.cs" />
    210     <Compile Include="Core\NodeVisualProperties.cs" />
    211     <Compile Include="Core\PortVisualProperties.cs" />
    212207    <Compile Include="Core\VisualProperties.cs" />
    213208    <Compile Include="ExecutionPort.cs" />
  • branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Programmable/ProgrammableNetworkItem.cs

    r13077 r13135  
    9898      get { return CompiledNetworkItem.Children; }
    9999    }
     100
     101    [Storable]
     102    public IVisualProperties VisualProperties { get; set; }
    100103    #endregion
    101104
     
    169172      variableStore = cloner.Clone(original.variableStore);
    170173      CompiledNetworkItem = cloner.Clone(original.compiledNetworkItem);
     174      VisualProperties = cloner.Clone(original.VisualProperties);
    171175    }
    172176    protected ProgrammableNetworkItem()
     
    358362        get { return Enumerable.Empty<INetworkItem>(); }
    359363      }
     364
     365      // TODO: no visual properties needed here
     366      public IVisualProperties VisualProperties {
     367        get { return Context.VisualProperties; }
     368        set { Context.VisualProperties = value; }
     369      }
    360370      #endregion
    361371
  • branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Programmable/ProgrammableNode.cs

    r13077 r13135  
    3232  [Item("ProgrammableNode", "Abstract base class for programmable nodes of a network.")]
    3333  [StorableClass]
    34   public abstract class ProgrammableNode : ProgrammableNetworkItem, IProgrammableNode, IVisualizableNode {
     34  public abstract class ProgrammableNode : ProgrammableNetworkItem, IProgrammableNode {
    3535    public static new Image StaticItemImage {
    3636      get { return HeuristicLab.Common.Resources.VSImageLibrary.RadialChart; }
     
    5858      }
    5959    }
    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     }
    7260    #endregion
    7361
     
    127115      IKeyedItemCollection<string, IPort> INode.Ports {
    128116        get { return Ports; }
    129       }
    130 
    131       public string VisualName { get { return Context.VisualName; } }
    132 
    133       public INodeVisualProperties VisualProperties {
    134         get { return Context.VisualProperties; }
    135117      }
    136118      #endregion
Note: See TracChangeset for help on using the changeset viewer.