1------------------------------------------------------------------------------
2--                                                                          --
3--                            Matreshka Project                             --
4--                                                                          --
5--                          Ada Modeling Framework                          --
6--                                                                          --
7--                        Runtime Library Component                         --
8--                                                                          --
9------------------------------------------------------------------------------
10--                                                                          --
11-- Copyright © 2012, Vadim Godunko <vgodunko@gmail.com>                     --
12-- All rights reserved.                                                     --
13--                                                                          --
14-- Redistribution and use in source and binary forms, with or without       --
15-- modification, are permitted provided that the following conditions       --
16-- are met:                                                                 --
17--                                                                          --
18--  * Redistributions of source code must retain the above copyright        --
19--    notice, this list of conditions and the following disclaimer.         --
20--                                                                          --
21--  * Redistributions in binary form must reproduce the above copyright     --
22--    notice, this list of conditions and the following disclaimer in the   --
23--    documentation and/or other materials provided with the distribution.  --
24--                                                                          --
25--  * Neither the name of the Vadim Godunko, IE nor the names of its        --
26--    contributors may be used to endorse or promote products derived from  --
27--    this software without specific prior written permission.              --
28--                                                                          --
29-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      --
30-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        --
31-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR    --
32-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT     --
33-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   --
34-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
35-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR   --
36-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF   --
37-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING     --
38-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS       --
39-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.             --
40--                                                                          --
41------------------------------------------------------------------------------
42--  $Revision: 3436 $ $Date: 2012-11-14 10:14:34 +0400 (Wed, 14 Nov 2012) $
43------------------------------------------------------------------------------
44with AMF.Elements;
45with AMF.Internals.Helpers;
46with AMF.Internals.Tables.UML_Attributes;
47with AMF.Visitors.UMLDI_Iterators;
48with AMF.Visitors.UMLDI_Visitors;
49
50package body AMF.Internals.UMLDI_UML_Association_Or_Connector_Or_Link_Shapes is
51
52   --------------
53   -- Get_Kind --
54   --------------
55
56   overriding function Get_Kind
57    (Self : not null access constant UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy)
58       return AMF.UMLDI.UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind is
59   begin
60      return
61        AMF.Internals.Tables.UML_Attributes.Internal_Get_Kind
62         (Self.Element);
63   end Get_Kind;
64
65   --------------
66   -- Set_Kind --
67   --------------
68
69   overriding procedure Set_Kind
70    (Self : not null access UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy;
71     To   : AMF.UMLDI.UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind) is
72   begin
73      AMF.Internals.Tables.UML_Attributes.Internal_Set_Kind
74       (Self.Element, To);
75   end Set_Kind;
76
77   -----------------
78   -- Get_Is_Icon --
79   -----------------
80
81   overriding function Get_Is_Icon
82    (Self : not null access constant UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy)
83       return Boolean is
84   begin
85      return
86        AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Icon
87         (Self.Element);
88   end Get_Is_Icon;
89
90   -----------------
91   -- Set_Is_Icon --
92   -----------------
93
94   overriding procedure Set_Is_Icon
95    (Self : not null access UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy;
96     To   : Boolean) is
97   begin
98      AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Icon
99       (Self.Element, To);
100   end Set_Is_Icon;
101
102   ---------------------
103   -- Get_Local_Style --
104   ---------------------
105
106   overriding function Get_Local_Style
107    (Self : not null access constant UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy)
108       return AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access is
109   begin
110      return
111        AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access
112         (AMF.Internals.Helpers.To_Element
113           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Style
114             (Self.Element)));
115   end Get_Local_Style;
116
117   ---------------------
118   -- Set_Local_Style --
119   ---------------------
120
121   overriding procedure Set_Local_Style
122    (Self : not null access UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy;
123     To   : AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access) is
124   begin
125      AMF.Internals.Tables.UML_Attributes.Internal_Set_Local_Style
126       (Self.Element,
127        AMF.Internals.Helpers.To_Element
128         (AMF.Elements.Element_Access (To)));
129   end Set_Local_Style;
130
131   -----------------------
132   -- Get_Model_Element --
133   -----------------------
134
135   overriding function Get_Model_Element
136    (Self : not null access constant UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy)
137       return AMF.UML.Elements.Collections.Set_Of_UML_Element is
138   begin
139      raise Program_Error;
140      return X : AMF.UML.Elements.Collections.Set_Of_UML_Element;
141--      return
142--        AMF.UML.Elements.Collections.Wrap
143--         (AMF.Internals.Element_Collections.Wrap
144--           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Model_Element
145--             (Self.Element)));
146   end Get_Model_Element;
147
148   -----------------------
149   -- Get_Model_Element --
150   -----------------------
151
152   overriding function Get_Model_Element
153    (Self : not null access constant UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy)
154       return AMF.CMOF.Elements.CMOF_Element_Access is
155   begin
156      return
157        AMF.CMOF.Elements.CMOF_Element_Access
158         (AMF.Internals.Helpers.To_Element
159           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Model_Element
160             (Self.Element)));
161   end Get_Model_Element;
162
163   ---------------------
164   -- Get_Local_Style --
165   ---------------------
166
167   overriding function Get_Local_Style
168    (Self : not null access constant UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy)
169       return AMF.DI.Styles.DI_Style_Access is
170   begin
171      return
172        AMF.DI.Styles.DI_Style_Access
173         (AMF.Internals.Helpers.To_Element
174           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Style
175             (Self.Element)));
176   end Get_Local_Style;
177
178   ---------------------
179   -- Set_Local_Style --
180   ---------------------
181
182   overriding procedure Set_Local_Style
183    (Self : not null access UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy;
184     To   : AMF.DI.Styles.DI_Style_Access) is
185   begin
186      AMF.Internals.Tables.UML_Attributes.Internal_Set_Local_Style
187       (Self.Element,
188        AMF.Internals.Helpers.To_Element
189         (AMF.Elements.Element_Access (To)));
190   end Set_Local_Style;
191
192   -------------------
193   -- Enter_Element --
194   -------------------
195
196   overriding procedure Enter_Element
197    (Self    : not null access constant UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy;
198     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
199     Control : in out AMF.Visitors.Traverse_Control) is
200   begin
201      if Visitor in AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class then
202         AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class
203          (Visitor).Enter_UML_Association_Or_Connector_Or_Link_Shape
204            (AMF.UMLDI.UML_Association_Or_Connector_Or_Link_Shapes.UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Access (Self),
205           Control);
206      end if;
207   end Enter_Element;
208
209   -------------------
210   -- Leave_Element --
211   -------------------
212
213   overriding procedure Leave_Element
214    (Self    : not null access constant UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy;
215     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
216     Control : in out AMF.Visitors.Traverse_Control) is
217   begin
218      if Visitor in AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class then
219         AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class
220          (Visitor).Leave_UML_Association_Or_Connector_Or_Link_Shape
221            (AMF.UMLDI.UML_Association_Or_Connector_Or_Link_Shapes.UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Access (Self),
222           Control);
223      end if;
224   end Leave_Element;
225
226   -------------------
227   -- Visit_Element --
228   -------------------
229
230   overriding procedure Visit_Element
231    (Self     : not null access constant UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Proxy;
232     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
233     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
234     Control  : in out AMF.Visitors.Traverse_Control) is
235   begin
236      if Iterator in AMF.Visitors.UMLDI_Iterators.UMLDI_Iterator'Class then
237         AMF.Visitors.UMLDI_Iterators.UMLDI_Iterator'Class
238          (Iterator).Visit_UML_Association_Or_Connector_Or_Link_Shape
239            (Visitor,
240             AMF.UMLDI.UML_Association_Or_Connector_Or_Link_Shapes.UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Access (Self),
241           Control);
242      end if;
243   end Visit_Element;
244
245end AMF.Internals.UMLDI_UML_Association_Or_Connector_Or_Link_Shapes;
246