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