Free cookie consent management tool by TermsFeed Policy Generator

source: branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Shapes.cs @ 10525

Last change on this file since 10525 was 10525, checked in by abeham, 10 years ago

#1610: added visual model

File size: 16.8 KB
Line 
1//------------------------------------------------------------------------------
2// <auto-generated>
3//     This code was generated by a tool.
4//
5//     Changes to this file may cause incorrect behavior and will be lost if
6//     the code is regenerated.
7// </auto-generated>
8//------------------------------------------------------------------------------
9
10using DslModeling = global::Microsoft.VisualStudio.Modeling;
11using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
12using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
13
14namespace HeuristicLab.SimulationCore
15{
16  /// <summary>
17  /// DomainClass ActivityShape
18  /// Description for HeuristicLab.SimulationCore.ActivityShape
19  /// </summary>
20  [DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.ActivityShape.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
21  [DslDesign::DescriptionResource("HeuristicLab.SimulationCore.ActivityShape.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
22  [DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
23  [global::System.CLSCompliant(true)]
24  [DslModeling::DomainObjectId("9aa624f1-2625-4cc3-b759-7070505f1a8b")]
25  public partial class ActivityShape : DslDiagrams::NodeShape
26  {
27    #region DiagramElement boilerplate
28    private static DslDiagrams::StyleSet classStyleSet;
29    private static global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields;
30    private static global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators;
31   
32    /// <summary>
33    /// Per-class style set for this shape.
34    /// </summary>
35    protected override DslDiagrams::StyleSet ClassStyleSet
36    {
37      get
38      {
39        if (classStyleSet == null)
40        {
41          classStyleSet = CreateClassStyleSet();
42        }
43        return classStyleSet;
44      }
45    }
46   
47    /// <summary>
48    /// Per-class ShapeFields for this shape.
49    /// </summary>
50    public override global::System.Collections.Generic.IList<DslDiagrams::ShapeField> ShapeFields
51    {
52      get
53      {
54        if (shapeFields == null)
55        {
56          shapeFields = CreateShapeFields();
57        }
58        return shapeFields;
59      }
60    }
61   
62    /// <summary>
63    /// Event fired when decorator initialization is complete for this shape type.
64    /// </summary>
65    public static event global::System.EventHandler DecoratorsInitialized;
66   
67    /// <summary>
68    /// List containing decorators used by this type.
69    /// </summary>
70    public override global::System.Collections.Generic.IList<DslDiagrams::Decorator> Decorators
71    {
72      get
73      {
74        if(decorators == null)
75        {
76          decorators = CreateDecorators();
77         
78          // fire this event to allow the diagram to initialize decorator mappings for this shape type.
79          if(DecoratorsInitialized != null)
80          {
81            DecoratorsInitialized(this, global::System.EventArgs.Empty);
82          }
83        }
84       
85        return decorators;
86      }
87    }
88   
89    /// <summary>
90    /// Finds a decorator associated with ActivityShape.
91    /// </summary>
92    public static DslDiagrams::Decorator FindActivityShapeDecorator(string decoratorName)
93    {
94      if(decorators == null) return null;
95      return DslDiagrams::ShapeElement.FindDecorator(decorators, decoratorName);
96    }
97   
98   
99    /// <summary>
100    /// Shape instance initialization.
101    /// </summary>
102    public override void OnInitialize()
103    {
104      base.OnInitialize();
105     
106      // Create host shapes for outer decorators.
107      foreach(DslDiagrams::Decorator decorator in this.Decorators)
108      {
109        if(decorator.RequiresHost)
110        {
111          decorator.ConfigureHostShape(this);
112        }
113      }
114     
115    }
116    #endregion
117    #region Shape size
118   
119    /// <summary>
120    /// Default size for this shape.
121    /// </summary>
122    public override DslDiagrams::SizeD DefaultSize
123    {
124      get
125      {
126        return new DslDiagrams::SizeD(1.62, 1);
127      }
128    }
129    #endregion
130    #region Shape styles
131    /// <summary>
132    /// Initializes style set resources for this shape type
133    /// </summary>
134    /// <param name="classStyleSet">The style set for this shape class</param>
135    protected override void InitializeResources(DslDiagrams::StyleSet classStyleSet)
136    {
137      base.InitializeResources(classStyleSet);
138     
139      // Fill brush settings for this shape.
140      DslDiagrams::BrushSettings backgroundBrush = new DslDiagrams::BrushSettings();
141      backgroundBrush.Color = global::System.Drawing.Color.FromKnownColor(global::System.Drawing.KnownColor.DarkKhaki);
142      classStyleSet.OverrideBrush(DslDiagrams::DiagramBrushes.ShapeBackground, backgroundBrush);
143   
144    }
145   
146    /// <summary>
147    /// Indicates whether this shape displays a background gradient.
148    /// </summary>
149    public override bool HasBackgroundGradient
150    {
151      get
152      {
153        return true;
154      }
155    }
156   
157    /// <summary>
158    /// Indicates the direction of the gradient.
159    /// </summary>
160    public override global::System.Drawing.Drawing2D.LinearGradientMode BackgroundGradientMode
161    {
162      get
163      {
164        return global::System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
165      }
166    }
167    /// <summary>
168    /// Specifies the geometry used by this shape
169    /// </summary>
170    public override DslDiagrams::ShapeGeometry ShapeGeometry
171    {
172      get
173      {
174        return DslDiagrams::ShapeGeometries.RoundedRectangle;
175      }
176    }
177    #endregion
178    #region Decorators
179    /// <summary>
180    /// Initialize the collection of shape fields associated with this shape type.
181    /// </summary>
182    protected override void InitializeShapeFields(global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields)
183    {
184      base.InitializeShapeFields(shapeFields);
185      DslDiagrams::TextField field1 = new DslDiagrams::TextField("NameDecorator");
186      field1.DefaultText = global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("ActivityShapeNameDecoratorDefaultText");
187      field1.DefaultFocusable = true;
188      field1.DefaultAutoSize = true;
189      field1.AnchoringBehavior.MinimumHeightInLines = 1;
190      field1.AnchoringBehavior.MinimumWidthInCharacters = 1;
191      field1.DefaultAccessibleState = global::System.Windows.Forms.AccessibleStates.Invisible;
192      shapeFields.Add(field1);
193     
194    }
195   
196    /// <summary>
197    /// Initialize the collection of decorators associated with this shape type.  This method also
198    /// creates shape fields for outer decorators, because these are not part of the shape fields collection
199    /// associated with the shape, so they must be created here rather than in InitializeShapeFields.
200    /// </summary>
201    protected override void InitializeDecorators(global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields, global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators)
202    {
203      base.InitializeDecorators(shapeFields, decorators);
204     
205      DslDiagrams::ShapeField field1 = DslDiagrams::ShapeElement.FindShapeField(shapeFields, "NameDecorator");
206      DslDiagrams::Decorator decorator1 = new DslDiagrams::ShapeDecorator(field1, DslDiagrams::ShapeDecoratorPosition.InnerTopLeft, DslDiagrams::PointD.Empty);
207      decorators.Add(decorator1);
208       
209    }
210   
211    /// <summary>
212    /// Ensure outer decorators are placed appropriately.  This is called during view fixup,
213    /// after the shape has been associated with the model element.
214    /// </summary>
215    public override void OnBoundsFixup(DslDiagrams::BoundsFixupState fixupState, int iteration, bool createdDuringViewFixup)
216    {
217      base.OnBoundsFixup(fixupState, iteration, createdDuringViewFixup);
218     
219      if(iteration == 0)
220      {
221        foreach(DslDiagrams::Decorator decorator in this.Decorators)
222        {
223          if(decorator.RequiresHost)
224          {
225            decorator.RepositionHostShape(decorator.GetHostShape(this));
226          }
227        }
228      }
229    }
230    #endregion
231    #region Constructors, domain class Id
232 
233    /// <summary>
234    /// ActivityShape domain class Id.
235    /// </summary>
236    public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x9aa624f1, 0x2625, 0x4cc3, 0xb7, 0x59, 0x70, 0x70, 0x50, 0x5f, 0x1a, 0x8b);
237    /// <summary>
238    /// Constructor
239    /// </summary>
240    /// <param name="store">Store where new element is to be created.</param>
241    /// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
242    public ActivityShape(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
243      : this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
244    {
245    }
246   
247    /// <summary>
248    /// Constructor
249    /// </summary>
250    /// <param name="partition">Partition where new element is to be created.</param>
251    /// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
252    public ActivityShape(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
253      : base(partition, propertyAssignments)
254    {
255    }
256    #endregion
257  }
258}
259namespace HeuristicLab.SimulationCore
260{
261  /// <summary>
262  /// DomainClass ActionShape
263  /// Description for HeuristicLab.SimulationCore.ActionShape
264  /// </summary>
265  [DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.ActionShape.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
266  [DslDesign::DescriptionResource("HeuristicLab.SimulationCore.ActionShape.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
267  [DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
268  [global::System.CLSCompliant(true)]
269  [DslModeling::DomainObjectId("25205757-e7e3-4310-b3c8-e4b85c91b152")]
270  public partial class ActionShape : DslDiagrams::NodeShape
271  {
272    #region DiagramElement boilerplate
273    private static DslDiagrams::StyleSet classStyleSet;
274    private static global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields;
275    private static global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators;
276   
277    /// <summary>
278    /// Per-class style set for this shape.
279    /// </summary>
280    protected override DslDiagrams::StyleSet ClassStyleSet
281    {
282      get
283      {
284        if (classStyleSet == null)
285        {
286          classStyleSet = CreateClassStyleSet();
287        }
288        return classStyleSet;
289      }
290    }
291   
292    /// <summary>
293    /// Per-class ShapeFields for this shape.
294    /// </summary>
295    public override global::System.Collections.Generic.IList<DslDiagrams::ShapeField> ShapeFields
296    {
297      get
298      {
299        if (shapeFields == null)
300        {
301          shapeFields = CreateShapeFields();
302        }
303        return shapeFields;
304      }
305    }
306   
307    /// <summary>
308    /// Event fired when decorator initialization is complete for this shape type.
309    /// </summary>
310    public static event global::System.EventHandler DecoratorsInitialized;
311   
312    /// <summary>
313    /// List containing decorators used by this type.
314    /// </summary>
315    public override global::System.Collections.Generic.IList<DslDiagrams::Decorator> Decorators
316    {
317      get
318      {
319        if(decorators == null)
320        {
321          decorators = CreateDecorators();
322         
323          // fire this event to allow the diagram to initialize decorator mappings for this shape type.
324          if(DecoratorsInitialized != null)
325          {
326            DecoratorsInitialized(this, global::System.EventArgs.Empty);
327          }
328        }
329       
330        return decorators;
331      }
332    }
333   
334    /// <summary>
335    /// Finds a decorator associated with ActionShape.
336    /// </summary>
337    public static DslDiagrams::Decorator FindActionShapeDecorator(string decoratorName)
338    {
339      if(decorators == null) return null;
340      return DslDiagrams::ShapeElement.FindDecorator(decorators, decoratorName);
341    }
342   
343   
344    /// <summary>
345    /// Shape instance initialization.
346    /// </summary>
347    public override void OnInitialize()
348    {
349      base.OnInitialize();
350     
351      // Create host shapes for outer decorators.
352      foreach(DslDiagrams::Decorator decorator in this.Decorators)
353      {
354        if(decorator.RequiresHost)
355        {
356          decorator.ConfigureHostShape(this);
357        }
358      }
359     
360    }
361    #endregion
362    #region Shape size
363   
364    /// <summary>
365    /// Default size for this shape.
366    /// </summary>
367    public override DslDiagrams::SizeD DefaultSize
368    {
369      get
370      {
371        return new DslDiagrams::SizeD(0.75, 0.75);
372      }
373    }
374    #endregion
375    #region Shape styles
376    /// <summary>
377    /// Initializes style set resources for this shape type
378    /// </summary>
379    /// <param name="classStyleSet">The style set for this shape class</param>
380    protected override void InitializeResources(DslDiagrams::StyleSet classStyleSet)
381    {
382      base.InitializeResources(classStyleSet);
383     
384      // Fill brush settings for this shape.
385      DslDiagrams::BrushSettings backgroundBrush = new DslDiagrams::BrushSettings();
386      backgroundBrush.Color = global::System.Drawing.Color.FromKnownColor(global::System.Drawing.KnownColor.IndianRed);
387      classStyleSet.OverrideBrush(DslDiagrams::DiagramBrushes.ShapeBackground, backgroundBrush);
388   
389    }
390   
391    /// <summary>
392    /// Specifies the geometry used by this shape
393    /// </summary>
394    public override DslDiagrams::ShapeGeometry ShapeGeometry
395    {
396      get
397      {
398        return DslDiagrams::ShapeGeometries.Circle;
399      }
400    }
401    #endregion
402    #region Decorators
403    /// <summary>
404    /// Initialize the collection of shape fields associated with this shape type.
405    /// </summary>
406    protected override void InitializeShapeFields(global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields)
407    {
408      base.InitializeShapeFields(shapeFields);
409      DslDiagrams::TextField field1 = new DslDiagrams::TextField("NameDecorator");
410      field1.DefaultText = global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("ActionShapeNameDecoratorDefaultText");
411      field1.DefaultFocusable = true;
412      field1.DefaultAutoSize = true;
413      field1.AnchoringBehavior.MinimumHeightInLines = 1;
414      field1.AnchoringBehavior.MinimumWidthInCharacters = 1;
415      field1.DefaultAccessibleState = global::System.Windows.Forms.AccessibleStates.Invisible;
416      shapeFields.Add(field1);
417     
418    }
419   
420    /// <summary>
421    /// Initialize the collection of decorators associated with this shape type.  This method also
422    /// creates shape fields for outer decorators, because these are not part of the shape fields collection
423    /// associated with the shape, so they must be created here rather than in InitializeShapeFields.
424    /// </summary>
425    protected override void InitializeDecorators(global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields, global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators)
426    {
427      base.InitializeDecorators(shapeFields, decorators);
428     
429      DslDiagrams::ShapeField field1 = DslDiagrams::ShapeElement.FindShapeField(shapeFields, "NameDecorator");
430      DslDiagrams::Decorator decorator1 = new DslDiagrams::ShapeDecorator(field1, DslDiagrams::ShapeDecoratorPosition.InnerTopLeft, DslDiagrams::PointD.Empty);
431      decorators.Add(decorator1);
432       
433    }
434   
435    /// <summary>
436    /// Ensure outer decorators are placed appropriately.  This is called during view fixup,
437    /// after the shape has been associated with the model element.
438    /// </summary>
439    public override void OnBoundsFixup(DslDiagrams::BoundsFixupState fixupState, int iteration, bool createdDuringViewFixup)
440    {
441      base.OnBoundsFixup(fixupState, iteration, createdDuringViewFixup);
442     
443      if(iteration == 0)
444      {
445        foreach(DslDiagrams::Decorator decorator in this.Decorators)
446        {
447          if(decorator.RequiresHost)
448          {
449            decorator.RepositionHostShape(decorator.GetHostShape(this));
450          }
451        }
452      }
453    }
454    #endregion
455    #region Constructors, domain class Id
456 
457    /// <summary>
458    /// ActionShape domain class Id.
459    /// </summary>
460    public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x25205757, 0xe7e3, 0x4310, 0xb3, 0xc8, 0xe4, 0xb8, 0x5c, 0x91, 0xb1, 0x52);
461    /// <summary>
462    /// Constructor
463    /// </summary>
464    /// <param name="store">Store where new element is to be created.</param>
465    /// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
466    public ActionShape(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
467      : this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
468    {
469    }
470   
471    /// <summary>
472    /// Constructor
473    /// </summary>
474    /// <param name="partition">Partition where new element is to be created.</param>
475    /// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
476    public ActionShape(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
477      : base(partition, propertyAssignments)
478    {
479    }
480    #endregion
481  }
482}
483
Note: See TracBrowser for help on using the repository browser.