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.Element_Collections; 46with AMF.Internals.Helpers; 47with AMF.Internals.Tables.UML_Attributes; 48with AMF.Visitors.UMLDI_Iterators; 49with AMF.Visitors.UMLDI_Visitors; 50 51package body AMF.Internals.UMLDI_UML_State_Shapes is 52 53 ------------------- 54 -- Get_Is_Tabbed -- 55 ------------------- 56 57 overriding function Get_Is_Tabbed 58 (Self : not null access constant UMLDI_UML_State_Shape_Proxy) 59 return Boolean is 60 begin 61 return 62 AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Tabbed 63 (Self.Element); 64 end Get_Is_Tabbed; 65 66 ------------------- 67 -- Set_Is_Tabbed -- 68 ------------------- 69 70 overriding procedure Set_Is_Tabbed 71 (Self : not null access UMLDI_UML_State_Shape_Proxy; 72 To : Boolean) is 73 begin 74 AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Tabbed 75 (Self.Element, To); 76 end Set_Is_Tabbed; 77 78 ----------------------- 79 -- Get_Model_Element -- 80 ----------------------- 81 82 overriding function Get_Model_Element 83 (Self : not null access constant UMLDI_UML_State_Shape_Proxy) 84 return AMF.UML.States.Collections.Set_Of_UML_State is 85 begin 86 raise Program_Error; 87 return X : AMF.UML.States.Collections.Set_Of_UML_State; 88-- return 89-- AMF.UML.States.Collections.Wrap 90-- (AMF.Internals.Element_Collections.Wrap 91-- (AMF.Internals.Tables.UML_Attributes.Internal_Get_Model_Element 92-- (Self.Element))); 93 end Get_Model_Element; 94 95 --------------------- 96 -- Get_Compartment -- 97 --------------------- 98 99 overriding function Get_Compartment 100 (Self : not null access constant UMLDI_UML_State_Shape_Proxy) 101 return AMF.UMLDI.UML_Compartments.Collections.Ordered_Set_Of_UMLDI_UML_Compartment is 102 begin 103 return 104 AMF.UMLDI.UML_Compartments.Collections.Wrap 105 (AMF.Internals.Element_Collections.Wrap 106 (AMF.Internals.Tables.UML_Attributes.Internal_Get_Compartment 107 (Self.Element))); 108 end Get_Compartment; 109 110 ----------------- 111 -- Get_Is_Icon -- 112 ----------------- 113 114 overriding function Get_Is_Icon 115 (Self : not null access constant UMLDI_UML_State_Shape_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_State_Shape_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_State_Shape_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_State_Shape_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_State_Shape_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_State_Shape_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_State_Shape_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_State_Shape_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_State_Shape_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_State_Shape 237 (AMF.UMLDI.UML_State_Shapes.UMLDI_UML_State_Shape_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_State_Shape_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_State_Shape 254 (AMF.UMLDI.UML_State_Shapes.UMLDI_UML_State_Shape_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_State_Shape_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_State_Shape 272 (Visitor, 273 AMF.UMLDI.UML_State_Shapes.UMLDI_UML_State_Shape_Access (Self), 274 Control); 275 end if; 276 end Visit_Element; 277 278end AMF.Internals.UMLDI_UML_State_Shapes; 279