1 package cve.environment; 2 3 import cve.core.comunicazione.*; 4 import cve.core.costruttori.*; 5 import cve.core.elementLDL.*; 6 import cve.core.elementEEL.*; 7 import cve.esecutori.*; 8 import cve.util.*; 9 import cve.staticLayout.*; 10 11 import relations.*; 12 import java.util.*; 13 14 import javax.swing.*; 15 16 25 final public class Make_env_Semantic extends Make_env{ 26 27 public Make_env_Semantic() {} 28 29 public void createEnv(){ 30 Class ese=null,oss=null, pre=null,unit=null; 31 ist=new IstanziaElement(); 35 env=new Environment(1); 39 40 env.setDescription("Maker of WIPPOG Semantic Rules "); 41 ViewLog.writeInLog("\n"); 42 ViewLog.writeInLog("****** COSTRUISCO AMBIENTE LDL SPECIFICATION ******"+"\n"); 43 ViewLog.writeInLog("Creo i descrittori LDL degli elementi cve e delle loro relazioni"+"\n"); 45 try { 47 ese = Class.forName("cve.esecutori.EACBuildSemantic"); 49 oss = Class.forName("cve.osservatori.OACBuildSemantic"); 50 pre = Class.forName("cve.core.elementEEL.Presenter"); 51 unit=Class.forName("cve.core.elementEEL.Unit"); 52 } catch (ClassNotFoundException e) { 53 System.err.println("Problemi nella costruzione dell'ambiente " +e.getMessage()); 54 } 55 IElementoCve eleCveE=ist.crea("esecutore"," 1",ese); 58 IElementoCve eleCveO=ist.crea("osservatore"," 2",oss); 61 DescrCveToolBar cveTB=creaTB(); 64 IElementoCveVis eleCveP=ist.crea("presenter"," 3",pre,cveTB); 65 eleCveP.setDescription("Specification view"); 66 DescrCveMenu cveMRule=creaMenuRules(); 68 DescrCveMenu cveMAss =creaMenuAssociation(); 69 eleCveP.addMenu(cveMRule); 70 eleCveP.addMenu(cveMAss); 71 Vector parTitolo1=new Vector(); 74 parTitolo1.add(titleEnv); 75 eleCveP.setParameters(parTitolo1); 76 77 eleCveP.setIcon(iconPath); 79 80 Vector members=new Vector(); 82 members.add(eleCveP); 83 IElementoCveVis eleCveUnit=ist.crea("unit","4",unit,null); 84 eleCveUnit.setParameters(members); 85 eleCveUnit.setDescription(titleEnv + " view unit"); 86 87 env.addElement(eleCveE); 89 env.addElement(eleCveO); 90 env.addElement(eleCveP); 91 env.addElement(eleCveUnit); 92 ViewLog.writeInLog(" la dimensione dell'insieme di elementi ldl non relazione e' "+env.getSizeEleLdl()+"\n"); 93 IMemberRel membro1=new MemberRel("osservatore",eleCveE); 95 IMemberRel membro2=new MemberRel("esecutore",eleCveO); 96 RelInterlayerCve interlayerA=new RelInterlayerCve("EsempioInterA"); 97 Vector app=new Vector(); 98 app.add(membro1); 99 app.add(membro2); 100 interlayerA.setMembers(app); 101 IMemberRel memb1=new MemberRel("osservatore",eleCveO); 103 IMemberRel memb2=new MemberRel("presenter",eleCveP); 104 RelInterlayerCve interlayerB=new RelInterlayerCve("EsempioInterB"); 105 Vector app1=new Vector(); 106 app1.add(memb1); 107 app1.add(memb2); 108 interlayerB.setMembers(app1); 109 env.addRel((IRelazione)interlayerA); 111 env.addRel((IRelazione)interlayerB); 112 ViewLog.writeInLog(" la dimensione dell'insieme delle relazioni e' "+env.getSizeRelLdl()+"\n"); 113 ldl_to_eel= new Ldl_to_Edl(env); 115 ViewLog.writeInLog( "AMBIENTE EEL CREATO CORRETTAMENTE "+"\n"); 116 ViewLog.writeInLog( " "+"\n"); 117 ViewLog.writeInLog( "******* ESECUZIONE AMBIENTE EEL CREATO ************ "+"\n"); 118 ViewLog.writeInLog( " "+"\n"); 119 } 120 121 124 public EnvironmentEEL getEnvironmentEEL(){ 125 envEEL=ldl_to_eel.getEnvironmentEEL(); 128 return envEEL; 129 } 130 131 136 public void setIconEnv(String iconPath){ 137 this.iconPath = iconPath; 138 } 139 140 145 public void setTitle(String title){ 146 this.titleEnv = title; 147 } 148 149 150 151 152 157 158 162 private DescrCveToolBar creaTB(){ 163 DescrCveToolBar cveT=new DescrCveToolBar(); 164 165 DescrCveButton cveB1=new DescrCveButton(); 166 cveB1.setAction("getRegoleSint"); 167 cveB1.setIcon(ConfigurationRead.getCveRoot()+"/resource/LOADREG_SINT.gif"); 168 169 DescrCveButton cveB2=new DescrCveButton(); 170 cveB2.setAction("cancRegoleSint"); 171 cveB2.setIcon(ConfigurationRead.getCveRoot()+"/resource/CANCREG_SINT.gif"); 172 173 DescrCveButton cveB3=new DescrCveButton(); 174 cveB3.setAction("getRegoleSem"); 175 cveB3.setIcon(ConfigurationRead.getCveRoot()+"/resource/LOADREG_SEM.gif"); 176 177 DescrCveButton cveB4=new DescrCveButton(); 178 cveB4.setAction("cancRegoleSem"); 179 cveB4.setIcon(ConfigurationRead.getCveRoot()+"/resource/CANCREG_SEM.gif"); 180 181 DescrCveButton cveB5=new DescrCveButton(); 182 cveB5.setAction("creaRegolaSem"); 183 cveB5.setIcon(ConfigurationRead.getCveRoot()+"/resource/NEWREG_SEM.gif"); 184 185 DescrCveButton cveB6=new DescrCveButton(); 186 cveB6.setAction("associaSemSint"); 187 cveB6.setIcon(ConfigurationRead.getCveRoot()+"/resource/ASS_SIN_SEM.gif"); 188 189 DescrCveButton cveB7=new DescrCveButton(); 190 cveB7.setAction("cancRegoleAss"); 191 cveB7.setIcon(ConfigurationRead.getCveRoot()+"/resource/CANCREG_ASS.gif"); 192 193 DescrCveButton cveB8=new DescrCveButton(); 194 cveB8.setAction("openConfiguration"); 195 cveB8.setIcon(ConfigurationRead.getCveRoot()+"/resource/CONFIG_SEM.gif"); 196 197 198 DescrCveButton cveB9=new DescrCveButton(); 199 cveB9.setAction("getAll"); 200 cveB9.setIcon(ConfigurationRead.getCveRoot()+"/resource/LOAD_ALL.gif"); 201 202 DescrCveButton cveB10=new DescrCveButton(); 203 cveB10.setAction("cancAll"); 204 cveB10.setIcon(ConfigurationRead.getCveRoot()+"/resource/CANC_ALL.gif"); 205 206 207 cveT.addDescrCveB(cveB1); 208 cveT.addDescrCveB(cveB2); 209 cveT.addDescrCveB(cveB3); 210 cveT.addDescrCveB(cveB4); 211 cveT.addDescrCveB(cveB5); 212 cveT.addDescrCveB(cveB6); 213 cveT.addDescrCveB(cveB7); 214 cveT.addDescrCveB(cveB8); 215 cveT.addDescrCveB(cveB9); 216 cveT.addDescrCveB(cveB10); 217 218 219 return cveT; 220 } 221 222 226 private DescrCveMenu creaMenuRules(){ 227 DescrCveMenu cveM=new DescrCveMenu(); 228 cveM.setName("Rules"); 229 230 DescrCveItem cveI1=new DescrCveItem(); 231 cveI1.setName("Get Sintax Rules"); 232 cveI1.setAction("getRegoleSint"); 233 234 DescrCveItem cveI2=new DescrCveItem(); 235 cveI2.setName("Reset Sintax Rules"); 236 cveI2.setAction("cancRegoleSint"); 237 238 DescrCveItem cveI3=new DescrCveItem(); 239 cveI3.setName("Get Semantic Rules"); 240 cveI3.setAction("getRegoleSem"); 241 242 DescrCveItem cveI4=new DescrCveItem(); 243 cveI4.setName("Reset Semantic Rules"); 244 cveI4.setAction("cancRegoleSem"); 245 246 DescrCveItem cveI5=new DescrCveItem(); 247 cveI5.setName("Get WorkArea"); 248 cveI5.setAction("getAll"); 249 250 DescrCveItem cveI6=new DescrCveItem(); 251 cveI6.setName("Reset WorkArea"); 252 cveI6.setAction("cancAll"); 253 254 DescrCveItem cveI7=new DescrCveItem(); 255 cveI7.setName("Configuration"); 256 cveI7.setAction("openConfiguration"); 257 258 259 260 cveM.addItem(cveI1); 261 cveM.addItem(cveI2); 262 cveM.addItem(cveI3); 263 cveM.addItem(cveI4); 264 cveM.addItem(cveI5); 265 cveM.addItem(cveI6); 266 cveM.addItem(cveI7); 267 268 269 return cveM; 270 } 271 272 276 private DescrCveMenu creaMenuAssociation(){ 277 DescrCveMenu cveM=new DescrCveMenu(); 278 cveM.setName("Create"); 279 280 281 DescrCveItem cveI1=new DescrCveItem(); 282 cveI1.setName("Create Semantic Rule"); 283 cveI1.setAction("creaRegolaSem"); 284 285 DescrCveItem cveI2=new DescrCveItem(); 286 cveI2.setName("Create Association Rule Sintax<>Semantic"); 287 cveI2.setAction("associaSemSint"); 288 289 DescrCveItem cveI3=new DescrCveItem(); 290 cveI3.setName("Reset Associations"); 291 cveI3.setAction("cancRegoleAss"); 292 293 cveM.addItem(cveI1); 294 cveM.addItem(cveI2); 295 cveM.addItem(cveI3); 296 297 298 return cveM; 299 } 300 301 } | Popular Tags |