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;
49with League.Strings.Internals;
50
51package body AMF.Internals.UMLDI_UML_Redefines_Labels is
52
53   -----------------------
54   -- Get_Model_Element --
55   -----------------------
56
57   overriding function Get_Model_Element
58    (Self : not null access constant UMLDI_UML_Redefines_Label_Proxy)
59       return AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access is
60   begin
61      return
62        AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access
63         (AMF.Internals.Helpers.To_Element
64           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Model_Element
65             (Self.Element)));
66   end Get_Model_Element;
67
68   -----------------------
69   -- Set_Model_Element --
70   -----------------------
71
72   overriding procedure Set_Model_Element
73    (Self : not null access UMLDI_UML_Redefines_Label_Proxy;
74     To   : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) is
75   begin
76      raise Program_Error;
77--      AMF.Internals.Tables.UML_Attributes.Internal_Set_Model_Element
78--       (Self.Element,
79--        AMF.Internals.Helpers.To_Element
80--         (AMF.Elements.Element_Access (To)));
81   end Set_Model_Element;
82
83   --------------
84   -- Get_Text --
85   --------------
86
87   overriding function Get_Text
88    (Self : not null access constant UMLDI_UML_Redefines_Label_Proxy)
89       return League.Strings.Universal_String is
90   begin
91      null;
92      return
93        League.Strings.Internals.Create
94         (AMF.Internals.Tables.UML_Attributes.Internal_Get_Text (Self.Element));
95   end Get_Text;
96
97   --------------
98   -- Set_Text --
99   --------------
100
101   overriding procedure Set_Text
102    (Self : not null access UMLDI_UML_Redefines_Label_Proxy;
103     To   : League.Strings.Universal_String) is
104   begin
105      AMF.Internals.Tables.UML_Attributes.Internal_Set_Text
106       (Self.Element,
107        League.Strings.Internals.Internal (To));
108   end Set_Text;
109
110   -----------------
111   -- Get_Is_Icon --
112   -----------------
113
114   overriding function Get_Is_Icon
115    (Self : not null access constant UMLDI_UML_Redefines_Label_Proxy)
116       return Boolean is
117   begin
118      return
119        AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Icon
120         (Self.Element);
121   end Get_Is_Icon;
122
123   -----------------
124   -- Set_Is_Icon --
125   -----------------
126
127   overriding procedure Set_Is_Icon
128    (Self : not null access UMLDI_UML_Redefines_Label_Proxy;
129     To   : Boolean) is
130   begin
131      AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Icon
132       (Self.Element, To);
133   end Set_Is_Icon;
134
135   ---------------------
136   -- Get_Local_Style --
137   ---------------------
138
139   overriding function Get_Local_Style
140    (Self : not null access constant UMLDI_UML_Redefines_Label_Proxy)
141       return AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access is
142   begin
143      return
144        AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access
145         (AMF.Internals.Helpers.To_Element
146           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Style
147             (Self.Element)));
148   end Get_Local_Style;
149
150   ---------------------
151   -- Set_Local_Style --
152   ---------------------
153
154   overriding procedure Set_Local_Style
155    (Self : not null access UMLDI_UML_Redefines_Label_Proxy;
156     To   : AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access) is
157   begin
158      AMF.Internals.Tables.UML_Attributes.Internal_Set_Local_Style
159       (Self.Element,
160        AMF.Internals.Helpers.To_Element
161         (AMF.Elements.Element_Access (To)));
162   end Set_Local_Style;
163
164   -----------------------
165   -- Get_Model_Element --
166   -----------------------
167
168   overriding function Get_Model_Element
169    (Self : not null access constant UMLDI_UML_Redefines_Label_Proxy)
170       return AMF.UML.Elements.Collections.Set_Of_UML_Element is
171   begin
172      raise Program_Error;
173      return X : AMF.UML.Elements.Collections.Set_Of_UML_Element;
174--      return
175--        AMF.UML.Elements.Collections.Wrap
176--         (AMF.Internals.Element_Collections.Wrap
177--           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Model_Element
178--             (Self.Element)));
179   end Get_Model_Element;
180
181   -----------------------
182   -- Get_Model_Element --
183   -----------------------
184
185   overriding function Get_Model_Element
186    (Self : not null access constant UMLDI_UML_Redefines_Label_Proxy)
187       return AMF.CMOF.Elements.CMOF_Element_Access is
188   begin
189      return
190        AMF.CMOF.Elements.CMOF_Element_Access
191         (AMF.Internals.Helpers.To_Element
192           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Model_Element
193             (Self.Element)));
194   end Get_Model_Element;
195
196   ---------------------
197   -- Get_Local_Style --
198   ---------------------
199
200   overriding function Get_Local_Style
201    (Self : not null access constant UMLDI_UML_Redefines_Label_Proxy)
202       return AMF.DI.Styles.DI_Style_Access is
203   begin
204      return
205        AMF.DI.Styles.DI_Style_Access
206         (AMF.Internals.Helpers.To_Element
207           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Style
208             (Self.Element)));
209   end Get_Local_Style;
210
211   ---------------------
212   -- Set_Local_Style --
213   ---------------------
214
215   overriding procedure Set_Local_Style
216    (Self : not null access UMLDI_UML_Redefines_Label_Proxy;
217     To   : AMF.DI.Styles.DI_Style_Access) is
218   begin
219      AMF.Internals.Tables.UML_Attributes.Internal_Set_Local_Style
220       (Self.Element,
221        AMF.Internals.Helpers.To_Element
222         (AMF.Elements.Element_Access (To)));
223   end Set_Local_Style;
224
225   -------------------
226   -- Enter_Element --
227   -------------------
228
229   overriding procedure Enter_Element
230    (Self    : not null access constant UMLDI_UML_Redefines_Label_Proxy;
231     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
232     Control : in out AMF.Visitors.Traverse_Control) is
233   begin
234      if Visitor in AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class then
235         AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class
236          (Visitor).Enter_UML_Redefines_Label
237            (AMF.UMLDI.UML_Redefines_Labels.UMLDI_UML_Redefines_Label_Access (Self),
238           Control);
239      end if;
240   end Enter_Element;
241
242   -------------------
243   -- Leave_Element --
244   -------------------
245
246   overriding procedure Leave_Element
247    (Self    : not null access constant UMLDI_UML_Redefines_Label_Proxy;
248     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
249     Control : in out AMF.Visitors.Traverse_Control) is
250   begin
251      if Visitor in AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class then
252         AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class
253          (Visitor).Leave_UML_Redefines_Label
254            (AMF.UMLDI.UML_Redefines_Labels.UMLDI_UML_Redefines_Label_Access (Self),
255           Control);
256      end if;
257   end Leave_Element;
258
259   -------------------
260   -- Visit_Element --
261   -------------------
262
263   overriding procedure Visit_Element
264    (Self     : not null access constant UMLDI_UML_Redefines_Label_Proxy;
265     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
266     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
267     Control  : in out AMF.Visitors.Traverse_Control) is
268   begin
269      if Iterator in AMF.Visitors.UMLDI_Iterators.UMLDI_Iterator'Class then
270         AMF.Visitors.UMLDI_Iterators.UMLDI_Iterator'Class
271          (Iterator).Visit_UML_Redefines_Label
272            (Visitor,
273             AMF.UMLDI.UML_Redefines_Labels.UMLDI_UML_Redefines_Label_Access (Self),
274           Control);
275      end if;
276   end Visit_Element;
277
278end AMF.Internals.UMLDI_UML_Redefines_Labels;
279