[NUI] Refine codes to reduce code duplication (#1096)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewPublicMethods.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
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  */
17
18 using System;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
22
23 namespace Tizen.NUI.BaseComponents
24 {
25     /// <summary>
26     /// View is the base class for all views.
27     /// </summary>
28     /// <since_tizen> 3 </since_tizen>
29     public partial class View
30     {
31         /// <summary>
32         /// Perform an action on a visual registered to this view. <br />
33         /// Visuals will have actions. This API is used to perform one of these actions with the given attributes.
34         /// </summary>
35         /// <param name="propertyIndexOfVisual">The Property index of the visual.</param>
36         /// <param name="propertyIndexOfActionId">The action to perform. See Visual to find the supported actions.</param>
37         /// <param name="attributes">Optional attributes for the action.</param>
38         /// <since_tizen> 5 </since_tizen>
39         public void DoAction(int propertyIndexOfVisual, int propertyIndexOfActionId, PropertyValue attributes)
40         {
41             Interop.View.View_DoAction(swigCPtr, propertyIndexOfVisual, propertyIndexOfActionId, PropertyValue.getCPtr(attributes));
42             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
43         }
44
45         /// <summary>
46         /// Creates an animation to animate the background color visual. If there is no
47         /// background visual, creates one with transparent black as it's mixColor.
48         /// </summary>
49         /// <since_tizen> 3 </since_tizen>
50         public Animation AnimateBackgroundColor(object destinationValue,
51                                                  int startTime,
52                                                  int endTime,
53                                                  AlphaFunction.BuiltinFunctions? alphaFunction = null,
54                                                  object initialValue = null)
55         {
56             Tizen.NUI.PropertyMap background = Background;
57
58             if (background.Empty())
59             {
60                 // If there is no background yet, ensure there is a transparent
61                 // color visual
62                 BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
63                 background = Background;
64             }
65             return AnimateColor("background", destinationValue, startTime, endTime, alphaFunction, initialValue);
66         }
67
68         /// <summary>
69         /// Creates an animation to animate the mixColor of the named visual.
70         /// </summary>
71         /// <since_tizen> 3 </since_tizen>
72         public Animation AnimateColor(string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null)
73         {
74             Animation animation = null;
75             {
76                 PropertyMap _animator = new PropertyMap();
77                 if (alphaFunction != null)
78                 {
79                     _animator.Add("alphaFunction", new PropertyValue(AlphaFunction.BuiltinToPropertyKey(alphaFunction)));
80                 }
81
82                 PropertyMap _timePeriod = new PropertyMap();
83                 _timePeriod.Add("duration", new PropertyValue((endTime - startTime) / 1000.0f));
84                 _timePeriod.Add("delay", new PropertyValue(startTime / 1000.0f));
85                 _animator.Add("timePeriod", new PropertyValue(_timePeriod));
86
87                 PropertyMap _transition = new PropertyMap();
88                 _transition.Add("animator", new PropertyValue(_animator));
89                 _transition.Add("target", new PropertyValue(targetVisual));
90                 _transition.Add("property", new PropertyValue("mixColor"));
91
92                 if (initialColor != null)
93                 {
94                     PropertyValue initValue = PropertyValue.CreateFromObject(initialColor);
95                     _transition.Add("initialValue", initValue);
96                 }
97
98                 PropertyValue destValue = PropertyValue.CreateFromObject(destinationColor);
99                 _transition.Add("targetValue", destValue);
100                 TransitionData _transitionData = new TransitionData(_transition);
101
102                 animation = new Animation(Interop.View.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true);
103                 if (NDalicPINVOKE.SWIGPendingException.Pending)
104                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105             }
106             return animation;
107         }
108
109         // From Container Base class
110         /// <summary>
111         /// Adds a child view to this view.
112         /// </summary>
113         /// <seealso cref="Container.Add" />
114         /// <since_tizen> 4 </since_tizen>
115         public override void Add(View child)
116         {
117             bool hasLayout = (_layout != null);
118
119             if (null == child)
120             {
121                 Tizen.Log.Fatal("NUI", "Child is null");
122                 return;
123             }
124
125             Container oldParent = child.GetParent();
126             if (oldParent != this)
127             {
128                 // If child already has a parent then re-parent child
129                 if (oldParent != null)
130                 {
131                     oldParent.Remove(child);
132                 }
133                 child.InternalParent = this;
134
135                 Interop.Actor.Actor_Add(swigCPtr, View.getCPtr(child));
136
137                 if (NDalicPINVOKE.SWIGPendingException.Pending)
138                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139                 Children.Add(child);
140
141                 if (ChildAdded != null)
142                 {
143                     ChildAddedEventArgs e = new ChildAddedEventArgs
144                     {
145                         Added = child
146                     };
147                     ChildAdded(this, e);
148                 }
149                 BindableObject.SetInheritedBindingContext(child, this?.BindingContext);
150             }
151         }
152
153         /// <summary>
154         /// Removes a child view from this View. If the view was not a child of this view, this is a no-op.
155         /// </summary>
156         /// <seealso cref="Container.Remove" />
157         /// <since_tizen> 4 </since_tizen>
158         public override void Remove(View child)
159         {
160             if (!child || child.GetParent() == null) // Early out if child null.
161                 return;
162
163             bool hasLayout = (_layout != null);
164
165             // If View has a layout then do a deferred child removal
166             // Actual child removal is performed by the layouting system so
167             // transitions can be completed.
168             if (hasLayout)
169             {
170                 (_layout as LayoutGroup)?.RemoveChildFromLayoutGroup(child);
171             }
172             else
173             {
174                 RemoveChild(child);
175             }
176         }
177
178         /// <summary>
179         /// Retrieves a child view by index.
180         /// </summary>
181         /// <seealso cref="Container.GetChildAt" />
182         /// <since_tizen> 4 </since_tizen>
183         public override View GetChildAt(uint index)
184         {
185             if (index < Children.Count)
186             {
187                 return Children[Convert.ToInt32(index)];
188             }
189             else
190             {
191                 return null;
192             }
193         }
194
195         /// <summary>
196         /// Retrieves the number of children held by the view.
197         /// </summary>
198         /// <seealso cref="Container.GetChildCount" />
199         /// <since_tizen> 4 </since_tizen>
200         public override uint GetChildCount()
201         {
202             return Convert.ToUInt32(Children.Count);
203         }
204
205         /// <summary>
206         /// Gets the views parent.
207         /// </summary>
208         /// <seealso cref="Container.GetParent()" />
209         /// <since_tizen> 4 </since_tizen>
210         public override Container GetParent()
211         {
212             return this.InternalParent as Container;
213         }
214
215         /// <summary>
216         /// Queries whether the view has a focus.
217         /// </summary>
218         /// <returns>True if this view has a focus.</returns>
219         /// <since_tizen> 3 </since_tizen>
220         public bool HasFocus()
221         {
222             bool ret = false;
223             if (swigCPtr.Handle != global::System.IntPtr.Zero)
224             {
225                 ret = Interop.View.View_HasKeyInputFocus(swigCPtr);
226                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227             }
228             else
229             {
230                 Tizen.Log.Error("NUI", "swigCPtr of view is aleady disposed.");
231             }
232             return ret;
233         }
234
235         /// <summary>
236         /// Sets the name of the style to be applied to the view.
237         /// </summary>
238         /// <param name="styleName">A string matching a style described in a stylesheet.</param>
239         /// <since_tizen> 3 </since_tizen>
240         public void SetStyleName(string styleName)
241         {
242             Interop.View.View_SetStyleName(swigCPtr, styleName);
243             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244         }
245
246         /// <summary>
247         /// Retrieves the name of the style to be applied to the view (if any).
248         /// </summary>
249         /// <returns>A string matching a style, or an empty string.</returns>
250         /// <since_tizen> 3 </since_tizen>
251         public string GetStyleName()
252         {
253             string ret = Interop.View.View_GetStyleName(swigCPtr);
254             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255             return ret;
256         }
257
258         /// <summary>
259         /// Clears the background.
260         /// </summary>
261         /// <since_tizen> 3 </since_tizen>
262         public void ClearBackground()
263         {
264             Interop.View.View_ClearBackground(swigCPtr);
265             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266         }
267
268         /// <summary>
269         /// Shows the view.
270         /// </summary>
271         /// <remarks>
272         /// This is an asynchronous method.
273         /// </remarks>
274         /// <since_tizen> 3 </since_tizen>
275         public void Show()
276         {
277             SetVisible(true);
278         }
279
280         /// <summary>
281         /// Hides the view.
282         /// </summary>
283         /// <remarks>
284         /// This is an asynchronous method.
285         /// If the view is hidden, then the view and its children will not be rendered.
286         /// This is regardless of the individual visibility of the children, i.e., the view will only be rendered if all of its parents are shown.
287         /// </remarks>
288         /// <since_tizen> 3 </since_tizen>
289         public void Hide()
290         {
291             SetVisible(false);
292         }
293
294         /// <summary>
295         /// Raises the view above all other views.
296         /// </summary>
297         /// <remarks>
298         /// Sibling order of views within the parent will be updated automatically.
299         /// Once a raise or lower API is used, that view will then have an exclusive sibling order independent of insertion.
300         /// </remarks>
301         /// <since_tizen> 3 </since_tizen>
302         public void RaiseToTop()
303         {
304             var parentChildren = GetParent()?.Children;
305
306             if (parentChildren != null)
307             {
308                 parentChildren.Remove(this);
309                 parentChildren.Add(this);
310
311                 Interop.NDalic.RaiseToTop(swigCPtr);
312                 if (NDalicPINVOKE.SWIGPendingException.Pending)
313                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314             }
315
316         }
317
318         /// <summary>
319         /// Lowers the view to the bottom of all views.
320         /// </summary>
321         /// <remarks>
322         /// The sibling order of views within the parent will be updated automatically.
323         /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
324         /// </remarks>
325         /// <since_tizen> 3 </since_tizen>
326         public void LowerToBottom()
327         {
328             var parentChildren = GetParent()?.Children;
329
330             if (parentChildren != null)
331             {
332                 parentChildren.Remove(this);
333                 parentChildren.Insert(0, this);
334
335                 Interop.NDalic.LowerToBottom(swigCPtr);
336                 if (NDalicPINVOKE.SWIGPendingException.Pending)
337                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338             }
339         }
340
341         /// <summary>
342         /// Queries if all resources required by a view are loaded and ready.
343         /// </summary>
344         /// <remarks>Most resources are only loaded when the control is placed on the stage.
345         /// </remarks>
346         /// <since_tizen> 3 </since_tizen>
347         public bool IsResourceReady()
348         {
349             bool ret = Interop.View.IsResourceReady(swigCPtr);
350             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351             return ret;
352         }
353
354         /// <summary>
355         /// Gets the parent layer of this view.If a view has no parent, this method does not do anything.
356         /// </summary>
357         /// <pre>The view has been initialized. </pre>
358         /// <returns>The parent layer of view </returns>
359         /// <since_tizen> 5 </since_tizen>
360         public Layer GetLayer()
361         {
362             //to fix memory leak issue, match the handle count with native side.
363             IntPtr cPtr = Interop.Actor.Actor_GetLayer(swigCPtr);
364             Layer ret = this.GetInstanceSafely<Layer>(cPtr);
365             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366             return ret;
367         }
368
369         /// <summary>
370         /// Removes a view from its parent view or layer. If a view has no parent, this method does nothing.
371         /// </summary>
372         /// <pre>The (child) view has been initialized. </pre>
373         /// <since_tizen> 4 </since_tizen>
374         public void Unparent()
375         {
376             GetParent()?.Remove(this);
377         }
378
379         /// <summary>
380         /// Search through this view's hierarchy for a view with the given name.
381         /// The view itself is also considered in the search.
382         /// </summary>
383         /// <pre>The view has been initialized.</pre>
384         /// <param name="viewName">The name of the view to find.</param>
385         /// <returns>A handle to the view if found, or an empty handle if not.</returns>
386         /// <since_tizen> 3 </since_tizen>
387         public View FindChildByName(string viewName)
388         {
389             //to fix memory leak issue, match the handle count with native side.
390             IntPtr cPtr = Interop.Actor.Actor_FindChildByName(swigCPtr, viewName);
391             View ret = this.GetInstanceSafely<View>(cPtr);
392             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
393             return ret;
394         }
395
396         /// <summary>
397         /// Converts screen coordinates into the view's coordinate system using the default camera.
398         /// </summary>
399         /// <pre>The view has been initialized.</pre>
400         /// <remarks>The view coordinates are relative to the top-left(0.0, 0.0, 0.5).</remarks>
401         /// <param name="localX">On return, the X-coordinate relative to the view.</param>
402         /// <param name="localY">On return, the Y-coordinate relative to the view.</param>
403         /// <param name="screenX">The screen X-coordinate.</param>
404         /// <param name="screenY">The screen Y-coordinate.</param>
405         /// <returns>True if the conversion succeeded.</returns>
406         /// <since_tizen> 3 </since_tizen>
407         public bool ScreenToLocal(out float localX, out float localY, float screenX, float screenY)
408         {
409             bool ret = Interop.Actor.Actor_ScreenToLocal(swigCPtr, out localX, out localY, screenX, screenY);
410             if (NDalicPINVOKE.SWIGPendingException.Pending)
411                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412             return ret;
413         }
414
415         /// <summary>
416         /// Sets the relative to parent size factor of the view.<br />
417         /// This factor is only used when ResizePolicy is set to either:
418         /// ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.<br />
419         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicy.<br />
420         /// </summary>
421         /// <pre>The view has been initialized.</pre>
422         /// <param name="factor">A Vector3 representing the relative factor to be applied to each axis.</param>
423         /// <since_tizen> 3 </since_tizen>
424         public void SetSizeModeFactor(Vector3 factor)
425         {
426             Interop.Actor.Actor_SetSizeModeFactor(swigCPtr, Vector3.getCPtr(factor));
427             if (NDalicPINVOKE.SWIGPendingException.Pending)
428                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
429         }
430         /// <summary>
431         /// Calculates the height of the view given a width.<br />
432         /// The natural size is used for default calculation.<br />
433         /// Size 0 is treated as aspect ratio 1:1.<br />
434         /// </summary>
435         /// <param name="width">The width to use.</param>
436         /// <returns>The height based on the width.</returns>
437         /// <since_tizen> 3 </since_tizen>
438         public float GetHeightForWidth(float width)
439         {
440             float ret = Interop.Actor.Actor_GetHeightForWidth(swigCPtr, width);
441             if (NDalicPINVOKE.SWIGPendingException.Pending)
442                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
443             return ret;
444         }
445
446         /// <summary>
447         /// Calculates the width of the view given a height.<br />
448         /// The natural size is used for default calculation.<br />
449         /// Size 0 is treated as aspect ratio 1:1.<br />
450         /// </summary>
451         /// <param name="height">The height to use.</param>
452         /// <returns>The width based on the height.</returns>
453         /// <since_tizen> 3 </since_tizen>
454         public float GetWidthForHeight(float height)
455         {
456             float ret = Interop.Actor.Actor_GetWidthForHeight(swigCPtr, height);
457             if (NDalicPINVOKE.SWIGPendingException.Pending)
458                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
459             return ret;
460         }
461
462         /// <summary>
463         /// Return the amount of size allocated for relayout.
464         /// </summary>
465         /// <param name="dimension">The dimension to retrieve.</param>
466         /// <returns>Return the size.</returns>
467         /// <since_tizen> 3 </since_tizen>
468         public float GetRelayoutSize(DimensionType dimension)
469         {
470             float ret = Interop.Actor.Actor_GetRelayoutSize(swigCPtr, (int)dimension);
471             if (NDalicPINVOKE.SWIGPendingException.Pending)
472                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
473             return ret;
474         }
475
476         /// <summary>
477         /// Set the padding for the view.
478         /// </summary>
479         /// <param name="padding">Padding for the view.</param>
480         /// <since_tizen> 3 </since_tizen>
481         public void SetPadding(PaddingType padding)
482         {
483             Interop.Actor.Actor_SetPadding(swigCPtr, PaddingType.getCPtr(padding));
484             if (NDalicPINVOKE.SWIGPendingException.Pending)
485                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
486         }
487
488         /// <summary>
489         /// Return the value of padding for the view.
490         /// </summary>
491         /// <param name="paddingOut">the value of padding for the view</param>
492         /// <since_tizen> 3 </since_tizen>
493         public void GetPadding(PaddingType paddingOut)
494         {
495             Interop.Actor.Actor_GetPadding(swigCPtr, PaddingType.getCPtr(paddingOut));
496             if (NDalicPINVOKE.SWIGPendingException.Pending)
497                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
498         }
499
500         /// <since_tizen> 3 </since_tizen>
501         public uint AddRenderer(Renderer renderer)
502         {
503             uint ret = Interop.Actor.Actor_AddRenderer(swigCPtr, Renderer.getCPtr(renderer));
504             if (NDalicPINVOKE.SWIGPendingException.Pending)
505                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
506             return ret;
507         }
508
509         /// <since_tizen> 3 </since_tizen>
510         public Renderer GetRendererAt(uint index)
511         {
512             //to fix memory leak issue, match the handle count with native side.
513             IntPtr cPtr = Interop.Actor.Actor_GetRendererAt(swigCPtr, index);
514             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
515             Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer;
516             if (cPtr != null && ret == null)
517             {
518                 ret = new Renderer(cPtr, false);
519                 if (NDalicPINVOKE.SWIGPendingException.Pending)
520                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
521                 return ret;
522             }
523             Interop.BaseHandle.delete_BaseHandle(CPtr);
524             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
525
526             if (NDalicPINVOKE.SWIGPendingException.Pending)
527                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
528             return ret;
529         }
530
531         /// <since_tizen> 3 </since_tizen>
532         public void RemoveRenderer(Renderer renderer)
533         {
534             Interop.Actor.Actor_RemoveRenderer__SWIG_0(swigCPtr, Renderer.getCPtr(renderer));
535             if (NDalicPINVOKE.SWIGPendingException.Pending)
536                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
537         }
538
539         /// <since_tizen> 3 </since_tizen>
540         public void RemoveRenderer(uint index)
541         {
542             Interop.Actor.Actor_RemoveRenderer__SWIG_1(swigCPtr, index);
543             if (NDalicPINVOKE.SWIGPendingException.Pending)
544                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545         }
546
547         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
548         [EditorBrowsable(EditorBrowsableState.Never)]
549         public void RotateBy(Degree angle, Vector3 axis)
550         {
551             Interop.ActorInternal.Actor_RotateBy__SWIG_0(swigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis));
552             if (NDalicPINVOKE.SWIGPendingException.Pending)
553                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554         }
555
556         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
557         [EditorBrowsable(EditorBrowsableState.Never)]
558         public void RotateBy(Radian angle, Vector3 axis)
559         {
560             Interop.ActorInternal.Actor_RotateBy__SWIG_1(swigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis));
561             if (NDalicPINVOKE.SWIGPendingException.Pending)
562                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
563         }
564
565         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
566         [EditorBrowsable(EditorBrowsableState.Never)]
567         public void RotateBy(Rotation relativeRotation)
568         {
569             Interop.ActorInternal.Actor_RotateBy__SWIG_2(swigCPtr, Rotation.getCPtr(relativeRotation));
570             if (NDalicPINVOKE.SWIGPendingException.Pending)
571                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572         }
573
574         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
575         [EditorBrowsable(EditorBrowsableState.Never)]
576         public void ScaleBy(Vector3 relativeScale)
577         {
578             Interop.ActorInternal.Actor_ScaleBy(swigCPtr, Vector3.getCPtr(relativeScale));
579             if (NDalicPINVOKE.SWIGPendingException.Pending)
580                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
581         }
582
583         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
584         [EditorBrowsable(EditorBrowsableState.Never)]
585         public void SetColorMode(ColorMode colorMode)
586         {
587             Interop.ActorInternal.Actor_SetColorMode(swigCPtr, (int)colorMode);
588             if (NDalicPINVOKE.SWIGPendingException.Pending)
589                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
590         }
591
592
593
594         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
595         [EditorBrowsable(EditorBrowsableState.Never)]
596         public Transition GetTransition(string transitionName)
597         {
598             Transition trans = null;
599             transDictionary.TryGetValue(transitionName, out trans);
600             return trans;
601         }
602     }
603 }