Changeset 2747


Ignore:
Timestamp:
Feb 19, 2011, 8:09:38 PM (11 years ago)
Author:
kopal
Message:

some changes on the "new" model for the editor which is excluded from the workspace manager:

  • set most constructors to internal because these classes should not be instantiated by external
Location:
trunk/WorkspaceManagerModel
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WorkspaceManagerModel/Execution/ExecutionEngine.cs

    r2693 r2747  
    11/*                             
    2    Copyright 2010 Nils Kopal, Viktor M.
     2   Copyright 2010 Nils Kopal
    33
    44   Licensed under the Apache License, Version 2.0 (the "License");
     
    204204    /// Message send to scheduler for a Plugin to trigger the Execution
    205205    /// </summary>
    206     public class MessageExecution : MessageBase
     206    internal class MessageExecution : MessageBase
    207207    {
    208208        public PluginModel PluginModel;
     
    212212    /// A Protocol for updating the GUI in time intervals
    213213    /// </summary>
    214     public class UpdateGuiProtocol : ProtocolBase
     214    internal class UpdateGuiProtocol : ProtocolBase
    215215    {
    216216        private WorkspaceModel workspaceModel;
     
    282282    /// A Protocol for benchmarking
    283283    /// </summary>
    284     public class BenchmarkProtocol : ProtocolBase
     284    internal class BenchmarkProtocol : ProtocolBase
    285285    {
    286286        private WorkspaceModel workspaceModel;
     
    329329    /// A Protocol for a PluginModel
    330330    /// </summary>
    331     public class PluginProtocol : ProtocolBase
     331    internal class PluginProtocol : ProtocolBase
    332332    {       
    333333        public PluginModel PluginModel;
     
    535535    /// Gears4Net Scheduler
    536536    /// </summary>
    537     public class WorkspaceManagerScheduler : Scheduler
     537    internal class WorkspaceManagerScheduler : Scheduler
    538538    {
    539539        private System.Threading.AutoResetEvent wakeup = new System.Threading.AutoResetEvent(false);
  • trunk/WorkspaceManagerModel/Model/Elements/ConnectionModel.cs

    r2693 r2747  
    11/*                             
    2    Copyright 2010 Nils Kopal, Viktor M.
     2   Copyright 2010 Nils Kopal
    33
    44   Licensed under the Apache License, Version 2.0 (the "License");
     
    2929    public class ConnectionModel : VisualElementModel
    3030    {
     31        internal ConnectionModel()
     32        {
     33
     34        }     
    3135
    3236        #region private members
  • trunk/WorkspaceManagerModel/Model/Elements/ConnectorModel.cs

    r2693 r2747  
    11/*                             
    2    Copyright 2010 Nils Kopal, Viktor M.
    3 
     2   Copyright 2010 Nils Kopal
     3 
    44   Licensed under the Apache License, Version 2.0 (the "License");
    55   you may not use this file except in compliance with the License.
     
    3333    public class ConnectorModel : VisualElementModel
    3434    {
     35
     36        internal ConnectorModel(){
     37            this.InputConnections = new List<ConnectionModel>();
     38            this.OutputConnections = new List<ConnectionModel>();   
     39        }
     40
    3541        #region private members
    3642
     
    6874        internal PropertyInfo property = null;
    6975
    70 
    7176        /// <summary>
    7277        /// The PluginModel this Connector belongs to
     
    131136        /// The Orientation of this ConnectorModel
    132137        /// </summary>
    133         public ConnectorOrientation Orientation = ConnectorOrientation.Unset;
    134 
    135         /// <summary>
    136         /// Creates a new ConnectorModel
    137         /// </summary>
    138         public ConnectorModel()
    139         {
    140             this.InputConnections = new List<ConnectionModel>();
    141             this.OutputConnections = new List<ConnectionModel>();
    142         }
     138        public ConnectorOrientation Orientation = ConnectorOrientation.Unset;       
    143139
    144140        /// <summary>
  • trunk/WorkspaceManagerModel/Model/Elements/ImageModel.cs

    r2693 r2747  
    1 using System;
     1/*                             
     2   Copyright 2010 Nils Kopal
     3
     4   Licensed under the Apache License, Version 2.0 (the "License");
     5   you may not use this file except in compliance with the License.
     6   You may obtain a copy of the License at
     7
     8       http://www.apache.org/licenses/LICENSE-2.0
     9
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15*/
     16
     17using System;
    218using System.Collections.Generic;
    319using System.Linq;
     
    1632    public class ImageModel : VisualElementModel
    1733    {
     34
     35        internal ImageModel()
     36        {
     37
     38        }
     39
    1840        private byte[] data = null;
    1941
     
    3759        }
    3860
    39         /// <summary>
    40         /// Instantiate a new ImageModel
    41         /// </summary>
    42         public ImageModel()           
    43         {
    44 
    45         }
    4661        /// <summary>
    4762        /// Instantiate a new ImageModel
  • trunk/WorkspaceManagerModel/Model/Elements/PluginModel.cs

    r2693 r2747  
    11/*                             
    2    Copyright 2010 Nils Kopal, Viktor M.
     2   Copyright 2010 Nils Kopal
    33
    44   Licensed under the Apache License, Version 2.0 (the "License");
     
    3333namespace WorkspaceManager.Model
    3434{
    35     /// <summary>
    36     /// Log updated event
    37     /// </summary>
    38     public class LogUpdated : EventArgs
    39     {
    40         public GuiLogEventArgs log;
    41     }
    4235
    4336    /// <summary>
     
    4740    public class PluginModel : VisualElementModel
    4841    {
     42        internal PluginModel()
     43        {
     44            this.InputConnectors = new List<ConnectorModel>();
     45            this.OutputConnectors = new List<ConnectorModel>();
     46        }
     47
    4948        [NonSerialized]
    50         public MessageExecution MessageExecution = null;
     49        internal MessageExecution MessageExecution = null;
    5150
    5251        #region private members
     
    149148        /// </summary>
    150149        public double PercentageFinished { get; internal set; }
    151 
    152         /// <summary>
    153         /// Create a new PluginModel
    154         /// </summary>
    155         public PluginModel()
    156         {
    157             this.InputConnectors = new List<ConnectorModel>();
    158             this.OutputConnectors = new List<ConnectorModel>();
    159         }
    160      
     150       
    161151        /// <summary>
    162152        /// The WorkspaceModel of this PluginModel
  • trunk/WorkspaceManagerModel/Model/Elements/TextModel.cs

    r2693 r2747  
    1 using System;
     1/*                             
     2   Copyright 2010 Nils Kopal
     3
     4   Licensed under the Apache License, Version 2.0 (the "License");
     5   you may not use this file except in compliance with the License.
     6   You may obtain a copy of the License at
     7
     8       http://www.apache.org/licenses/LICENSE-2.0
     9
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15*/
     16
     17using System;
    218using System.Collections.Generic;
    319using System.Linq;
     
    1531    public class TextModel : VisualElementModel
    1632    {
     33
     34        internal TextModel()
     35        {
     36
     37        }
     38
    1739        private byte[] data = null;
    18 
    19         /// <summary>
    20         /// Instantiate a new TextModel
    21         /// </summary> 
    22         public TextModel()
    23         {
    24            
    25         }
    2640
    2741        /// <summary>
  • trunk/WorkspaceManagerModel/Model/Elements/VisualElementModel.cs

    r2693 r2747  
    11/*                             
    2    Copyright 2010 Nils Kopal, Viktor M.
     2   Copyright 2010 Nils Kopal
    33
    44   Licensed under the Apache License, Version 2.0 (the "License");
     
    3232    [Serializable]
    3333    public abstract class VisualElementModel
    34     {       
     34    {
     35        internal VisualElementModel()
     36        {
     37
     38        }
     39
    3540        /// <summary>
    3641        /// Current Position of this VisualElementModel
    3742        /// </summary>
    38         public Point Position;
    39 
     43        internal Point Position;
     44       
    4045        /// <summary>
    4146        /// Minimum Width of this VisualElementModel
    4247        /// </summary>
    43         public double MinWidth = 250;
     48        internal double MinWidth = 250;
    4449       
    4550        /// <summary>
    4651        /// Minimum Height of this VisualElementModel
    4752        /// </summary>     
    48         public double MinHeight = 200;
     53        internal double MinHeight = 200;
    4954
    5055        /// <summary>
    5156        /// Width of this VisualElementModel
    5257        /// </summary>
    53         public double Width = 400;
     58        internal double Width = 400;
    5459
    5560        /// <summary>
    5661        /// Height of this VisualElementModel
    5762        /// </summary>
    58         public double Height = 300;
     63        internal double Height = 300;
    5964
    6065        /// <summary>
    6166        /// Name of this VisualElementModel
    6267        /// </summary>
    63         public string Name;
     68        internal string Name;
    6469
    6570        /// <summary>
     
    7277        /// </summary>
    7378        [NonSerialized]
    74         public IUpdateableViewElement UpdateableViewElement = null;   
     79        public IUpdateableViewElement UpdateableViewElement = null;
     80
     81        /// <summary>
     82        /// Get the current Position of this VisualElementModel
     83        /// </summary>
     84        /// <returns></returns>
     85        public Point GetPosition()
     86        {
     87            return Position;
     88        }
     89
     90        /// <summary>
     91        /// Get the minimum width of this VisualElementModel
     92        /// </summary>
     93        /// <returns></returns>       
     94        public double GetMinWidth()
     95        {
     96            return MinWidth;
     97        }
     98
     99        /// <summary>
     100        /// Get the minimum height of this VisualElementModel
     101        /// </summary>
     102        /// <returns></returns>       
     103        public double GetMinHeight()
     104        {
     105            return MinHeight;
     106        }
     107
     108        /// <summary>
     109        /// Get the width of this VisualElementModel
     110        /// </summary>
     111        /// <returns></returns>
     112        public double GetWidth()
     113        {
     114            return Width;
     115        }
     116
     117        /// <summary>
     118        /// Get the current height of this VisualElementModel
     119        /// </summary>
     120        /// <returns></returns>
     121        public double GetHeight()
     122        {
     123            return Height;
     124        }
     125
     126        /// <summary>
     127        /// Get the name of thisVisualElementModel
     128        /// </summary>
     129        /// <returns></returns>
     130        public string GetName()
     131        {
     132            return Name;
     133        }
    75134    }
    76135}
  • trunk/WorkspaceManagerModel/Model/Elements/WorkspaceModel.cs

    r2693 r2747  
    11/*                             
    2    Copyright 2010 Nils Kopal, Viktor M.
     2   Copyright 2010 Nils Kopal
    33
    44   Licensed under the Apache License, Version 2.0 (the "License");
     
    3636    public class WorkspaceModel : VisualElementModel
    3737    {
    38         [NonSerialized]
    39         private IEditor workspaceManagerEditor;
    40 
    41         /// <summary>
    42         /// The surrounding WorkspaceManagerEditor
    43         /// </summary>
    44         public IEditor Editor
    45         {
    46             get
    47             {
    48                 return workspaceManagerEditor;
    49             }
    50             set
    51             {
    52                 workspaceManagerEditor = value;
    53             }
    54         }
    55 
    56         [field: NonSerialized]
    57         public event GuiLogNotificationEventHandler OnGuiLogNotificationOccured;
    58 
    59         [NonSerialized]
    60         public UndoRedoManager UndoRedoManager;
    61 
    62         [NonSerialized]
    63         private bool hasChanges;
    64         public bool HasChanges
    65         {
    66             get
    67             {
    68                 return hasChanges;
    69             }
    70             private set
    71             {
    72                 hasChanges = value;
    73             }
    74         }
    75 
    76         /// <summary>
    77         /// All PluginModels of our Workspace Model
    78         /// </summary>
    79         public List<PluginModel> AllPluginModels;
    80 
    81         /// <summary>
    82         /// All Connector Models of our Workspace Model
    83         /// </summary>
    84         public List<ConnectorModel> AllConnectorModels;
    85 
    86         /// <summary>
    87         /// All ConnectionModels of our Workspace Model
    88         /// </summary>
    89         public List<ConnectionModel> AllConnectionModels;
    90 
    91         /// <summary>
    92         /// All ImageModels of our Workspace Model
    93         /// </summary>
    94         public List<ImageModel> AllImageModels;
    95 
    96         /// <summary>
    97         /// All TextModels of our Workspace Model
    98         /// </summary>
    99         public List<TextModel> AllTextModels;
    100 
    101         /// <summary>
    102         /// Creates a new Workspace Model
    103         /// </summary>
    104         public WorkspaceModel()
     38
     39        internal WorkspaceModel()
    10540        {
    10641            this.AllPluginModels = new List<PluginModel>();
     
    11146        }
    11247
     48        [NonSerialized]
     49        private IEditor workspaceManagerEditor;
     50
     51        /// <summary>
     52        /// The surrounding WorkspaceManagerEditor
     53        /// </summary>
     54        public IEditor Editor
     55        {
     56            get
     57            {
     58                return workspaceManagerEditor;
     59            }
     60            set
     61            {
     62                workspaceManagerEditor = value;
     63            }
     64        }
     65
     66        [NonSerialized]
     67        public UndoRedoManager UndoRedoManager;
     68
     69        [NonSerialized]
     70        private bool hasChanges;
     71        public bool HasChanges
     72        {
     73            get
     74            {
     75                return hasChanges;
     76            }
     77            private set
     78            {
     79                hasChanges = value;
     80            }
     81        }
     82
     83        /// <summary>
     84        /// All PluginModels of our Workspace Model
     85        /// </summary>
     86        public List<PluginModel> AllPluginModels;
     87
     88        /// <summary>
     89        /// All Connector Models of our Workspace Model
     90        /// </summary>
     91        public List<ConnectorModel> AllConnectorModels;
     92
     93        /// <summary>
     94        /// All ConnectionModels of our Workspace Model
     95        /// </summary>
     96        public List<ConnectionModel> AllConnectionModels;
     97
     98        /// <summary>
     99        /// All ImageModels of our Workspace Model
     100        /// </summary>
     101        public List<ImageModel> AllImageModels;
     102
     103        /// <summary>
     104        /// All TextModels of our Workspace Model
     105        /// </summary>
     106        public List<TextModel> AllTextModels;
     107       
    113108        /// <summary>
    114109        /// Creates a new PluginModel belonging to this WorkspaceModel
     
    131126            pluginModel.generateConnectors();
    132127            pluginModel.Plugin.Initialize();
    133             pluginModel.Plugin.OnGuiLogNotificationOccured += OnGuiLogNotificationOccured;
    134128            //pluginModel.Plugin.OnGuiLogNotificationOccured += pluginModel.GuiLogNotificationOccured;
    135129            pluginModel.Plugin.OnPluginProgressChanged += pluginModel.PluginProgressChanged;
     
    413407        /// <param name="connectorModelB"></param>
    414408        /// <returns></returns>
    415         internal static bool compatibleConnectors(ConnectorModel connectorModelA, ConnectorModel connectorModelB)
     409        public static bool compatibleConnectors(ConnectorModel connectorModelA, ConnectorModel connectorModelB)
    416410        {
    417411            if (!connectorModelA.Outgoing || connectorModelB.Outgoing || connectorModelA.PluginModel == connectorModelB.PluginModel)
     
    442436            }
    443437        }
    444 
    445         internal void GuiLogMessage(string message, NotificationLevel level)
    446         {
    447             if (OnGuiLogNotificationOccured != null)
    448             {
    449                 GuiLogEventArgs args = new GuiLogEventArgs(message, Editor, level);
    450                 args.Title = "-";
    451                 OnGuiLogNotificationOccured(Editor, args);
    452             }
    453         }
    454 
    455438    }
    456439}
  • trunk/WorkspaceManagerModel/Model/Interfaces/IUpdateableViewElement.cs

    r2693 r2747  
    1 using System;
     1/*                             
     2   Copyright 2010 Nils Kopal
     3
     4   Licensed under the Apache License, Version 2.0 (the "License");
     5   you may not use this file except in compliance with the License.
     6   You may obtain a copy of the License at
     7
     8       http://www.apache.org/licenses/LICENSE-2.0
     9
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15*/
     16
     17using System;
    218using System.Collections.Generic;
    319using System.Linq;
  • trunk/WorkspaceManagerModel/Model/Tools/ColorHelper.cs

    r2693 r2747  
    1 using System;
     1/*                             
     2   Copyright 2010 Nils Kopal
     3
     4   Licensed under the Apache License, Version 2.0 (the "License");
     5   you may not use this file except in compliance with the License.
     6   You may obtain a copy of the License at
     7
     8       http://www.apache.org/licenses/LICENSE-2.0
     9
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15*/
     16
     17using System;
    218using System.Collections.Generic;
    319using System.Linq;
     
    1632namespace WorkspaceManager.Model
    1733{
    18     public class ColorHelper
     34    public static class ColorHelper
    1935    {
    2036        /// <summary>
  • trunk/WorkspaceManagerModel/Model/Tools/ModelPersistance.cs

    r2693 r2747  
    11/*                             
    2    Copyright 2010 Nils Kopal, Viktor M.
     2   Copyright 2010 Nils Kopal
    33
    44   Licensed under the Apache License, Version 2.0 (the "License");
     
    3232    /// Class with static methods for loading and saving of WorkspaceModels
    3333    /// </summary>
    34     public class ModelPersistance
     34    public static class ModelPersistance
    3535    {
    3636        /// <summary>
  • trunk/WorkspaceManagerModel/Model/Tools/UndoRedoManager.cs

    r2693 r2747  
    1 using System;
     1/*                             
     2   Copyright 2010 Nils Kopal
     3
     4   Licensed under the Apache License, Version 2.0 (the "License");
     5   you may not use this file except in compliance with the License.
     6   You may obtain a copy of the License at
     7
     8       http://www.apache.org/licenses/LICENSE-2.0
     9
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15*/
     16
     17using System;
    218using System.Collections.Generic;
    319using System.Linq;
     
    1228    public class UndoRedoManager
    1329    {
     30        internal UndoRedoManager()
     31        {
     32
     33        }
     34
    1435        private Stack<Operation> UndoStack = new Stack<Operation>();
    1536        private Stack<Operation> RedoStack = new Stack<Operation>();
  • trunk/WorkspaceManagerModel/Model/Tools/XMLSerialization.cs

    r2693 r2747  
    11/*                             
    2    Copyright 2010 Nils Kopal, Viktor M.
     2   Copyright 2010 Nils Kopal
    33
    44   Licensed under the Apache License, Version 2.0 (the "License");
     
    3434    /// Provides static methods for XML serialization and deserialization
    3535    /// </summary>
    36     public class XMLSerialization
     36    public static class XMLSerialization
    3737    {
    3838        /// <summary>
Note: See TracChangeset for help on using the changeset viewer.