1 package cve.environment; 2 3 import cve.staticLayout.*; 4 import cve.core.comunicazione.*; 5 import cve.core.costruttori.*; 6 import cve.core.elementEEL.*; 7 import cve.core.elementLDL.*; 8 import cve.esecutori.*; 9 import cve.osservatori.*; 10 import cve.presenter.*; 11 import cve.util.*; 12 13 import relations.*; 14 import interactionHandler.*; 15 import interactionGraphics.*; 16 17 import java.util.*; 18 import javax.swing.*; 19 20 27 final public class Make_env_Genial_Semantic extends Make_env 28 { 29 30 34 public Make_env_Genial_Semantic() {} 35 36 41 public void createEnv(){ 42 Class ese=null,oss=null, oss1=null,pre=null, pre1=null, unit=null; 43 ist=new IstanziaElement(); 45 env=new Environment(2); 47 env.setDescription("Genial Semantic prototype"); 48 System.out.println(); 49 System.out.println("****** COSTRUISCO AMBIENTE LDL ******"); 50 System.out.println(" Creo i descrittori LDL degli elementi cve e delle loro relazioni"); 51 try { 53 ese = Class.forName("cve.esecutori.EACesecSemantic"); 54 oss = Class.forName("cve.osservatori.OACesecSemantic"); 55 56 pre=Class.forName("cve.core.elementEEL.Presenter"); 58 59 unit=Class.forName("cve.core.elementEEL.Unit"); 60 } catch (ClassNotFoundException e) { 61 System.err.println("Caught classe non trovata: " + 62 e.getMessage()); 63 } 64 66 IElementoCve eleCveE=ist.crea("esecutore","1",ese); 68 69 IElementoCve eleCveO=ist.crea("osservatore","2",oss); 71 JTool tool=new JTool(); 73 JCanvasFree can=new JCanvasFree(); 74 JTabbed tab=new JTabbed(); 76 77 Vector component=new Vector(); 78 component.add(tool); 79 component.add(can); 80 component.add(tab); 81 82 eleCveO.setParameters(component); 83 84 DescrCveToolBar cveTB=creaTB(); 87 IElementoCveVis eleCveP=ist.crea("presenter","3",pre,cveTB); 88 eleCveP.setDescription("Free view"); 89 eleCveP.setIcon(iconPath); 91 92 DescrCveMenu cveM=creaMenu(); 94 DescrCveMenu cveM1=creaMenu1(); 95 DescrCveMenu cveM2=creaMenu2(); 96 eleCveP.addMenu(cveM); 97 eleCveP.addMenu(cveM1); 98 eleCveP.addMenu(cveM2); 99 100 104 Vector parTitolo=new Vector(); 105 parTitolo.add(titleEnv); 106 eleCveP.setParameters(parTitolo); 107 eleCveP.setIcon(iconPath); 108 109 110 Vector members=new Vector(); 112 members.add(eleCveP); 113 IElementoCveVis eleCveUnit=ist.crea("unit","4",unit,null); 114 eleCveUnit.setParameters(members); 115 eleCveUnit.setDescription(titleEnv + " view unit "); 116 env.addElement(eleCveE); 118 env.addElement(eleCveO); 119 env.addElement(eleCveP); 120 env.addElement(eleCveUnit); 121 System.out.println(" la dimensione dell'insieme di elementi ldl non relazione e' "+env.getSizeEleLdl()); 122 IMemberRel membro1A=new MemberRel("esecutore",eleCveE); 124 IMemberRel membro2A=new MemberRel("osservatore",eleCveO); 125 RelInterlayerCve interlayerEO=new RelInterlayerCve("EsempioInterA"); 126 Vector appA=new Vector(); 127 appA.add(membro1A); 128 appA.add(membro2A); 129 interlayerEO.setMembers(appA); 130 IMemberRel memb1A=new MemberRel("presenter",eleCveP); 132 IMemberRel memb2A=new MemberRel("osservatore",eleCveO); 133 RelInterlayerCve interlayerPO=new RelInterlayerCve("EsempioInterB"); 134 Vector app1A=new Vector(); 135 app1A.add(memb1A); 136 app1A.add(memb2A); 137 interlayerPO.setMembers(app1A); 138 139 env.addRel((IRelazione)interlayerEO); 141 env.addRel((IRelazione)interlayerPO); 142 143 System.out.println(" la dimensione dell'insieme delle relazioni e'"+env.getSizeRelLdl()); 144 System.out.println(""); 145 System.out.println("****** COSTRUISCO AMBIENTE EEL ******"); 146 147 ldl_to_eel= new Ldl_to_Edl(env); 149 150 System.out.println( " Creato insieme elementi Edl (osservatori e esecutori) "); 151 System.out.println( " Create e riempite strutture dedicate alla comunicazione (gruppi,... ) "); 152 System.out.println( " "); 153 System.out.println( " "); 154 } 156 157 161 public EnvironmentEEL getEnvironmentEEL(){ 162 envEEL=ldl_to_eel.getEnvironmentEEL(); 164 return envEEL; 165 } 166 167 172 public void setIconEnv(String iconPath){ 173 this.iconPath = iconPath; 174 } 175 176 181 public void setTitle(String title){ 182 this.titleEnv = title; 183 } 184 185 186 190 194 private DescrCveToolBar creaTB(){ 195 DescrCveToolBar cveT=new DescrCveToolBar(); 196 197 DescrCveButton cveB1=new DescrCveButton(); 198 cveB1.setAction("getAssociation"); 199 cveB1.setIcon(ConfigurationRead.getCveRoot()+"/resource/LOAD_ALL.gif"); 200 201 DescrCveButton cveB2=new DescrCveButton(); 202 cveB2.setAction("cancAssociation"); 203 cveB2.setIcon(ConfigurationRead.getCveRoot()+"/resource/CANC_ALL.gif"); 204 205 210 211 DescrCveButton cveB4=new DescrCveButton(); 212 cveB4.setAction("cancSentence"); 213 cveB4.setIcon(ConfigurationRead.getCveRoot()+"/resource/CANCSENT.gif"); 214 215 DescrCveButton cveB5=new DescrCveButton(); 216 cveB5.setAction("openConfiguration"); 217 cveB5.setIcon(ConfigurationRead.getCveRoot()+"/resource/CONFIG_SENT.gif"); 218 219 224 225 DescrCveButton cveB7=new DescrCveButton(); 226 cveB7.setAction("startSent"); 227 cveB7.setIcon(ConfigurationRead.getCveRoot()+"/resource/START_SENT.gif"); 228 229 DescrCveButton cveB8=new DescrCveButton(); 230 cveB8.setAction("stepSent"); 231 cveB8.setIcon(ConfigurationRead.getCveRoot()+"/resource/STEP_SENT.gif"); 232 233 234 DescrCveButton cveB9=new DescrCveButton(); 235 cveB9.setAction("stopSent"); 236 cveB9.setIcon(ConfigurationRead.getCveRoot()+"/resource/STOP_SENT.gif"); 237 238 239 cveT.addDescrCveB(cveB1); 240 cveT.addDescrCveB(cveB2); 241 cveT.addDescrCveB(cveB4); 243 cveT.addDescrCveB(cveB5); 244 cveT.addDescrCveB(cveB7); 246 cveT.addDescrCveB(cveB8); 247 cveT.addDescrCveB(cveB9); 248 249 return cveT; 250 } 251 252 259 private DescrCveMenu creaMenu(){ 260 DescrCveMenu cveM=new DescrCveMenu(); 261 cveM.setName("Visual Sentence"); 262 263 DescrCveItem cveI1=new DescrCveItem(); 264 cveI1.setName("Get Association Language"); 265 cveI1.setAction("getAssociation"); 266 267 DescrCveItem cveI2=new DescrCveItem(); 268 cveI2.setName("Reset Association Language"); 269 cveI2.setAction("cancAssociation"); 270 271 280 281 DescrCveItem cveI5=new DescrCveItem(); 282 cveI5.setName("Reset Sentence"); 283 cveI5.setAction("cancSentence"); 284 285 286 cveM.addItem(cveI1); 287 cveM.addItem(cveI2); 288 cveM.addItem(cveI5); 291 292 return cveM; 293 } 294 295 296 303 private DescrCveMenu creaMenu1(){ 304 DescrCveMenu cveM=new DescrCveMenu(); 305 cveM.setName("Setting Sentence"); 306 307 DescrCveItem cveI1=new DescrCveItem(); 308 cveI1.setName("Configuration Sentence"); 309 cveI1.setAction("openConfiguration"); 310 311 DescrCveItem cveI2=new DescrCveItem(); 312 cveI2.setName("Start Semantic Sentence"); 313 cveI2.setAction("startSent"); 314 315 DescrCveItem cveI3=new DescrCveItem(); 316 cveI3.setName("Step Semantic Sentence"); 317 cveI3.setAction("stepSent"); 318 319 DescrCveItem cveI4=new DescrCveItem(); 320 cveI4.setName("Stop Semantic Sentence"); 321 cveI4.setAction("stopSent"); 322 323 cveM.addItem(cveI1); 324 cveM.addItem(cveI2); 325 cveM.addItem(cveI3); 326 cveM.addItem(cveI4); 327 328 return cveM; 329 } 330 331 332 333 340 private DescrCveMenu creaMenu2(){ 341 DescrCveMenu cveM=new DescrCveMenu(); 342 cveM.setName("Setting Environment"); 343 344 DescrCveItem cveI1=new DescrCveItem(); 345 cveI1.setName("Interaction modality"); 346 cveI1.setAction("changeEventAction"); 347 348 DescrCveItem cveI2=new DescrCveItem(); 349 cveI2.setName("Color select"); 350 cveI2.setAction("colorSelect"); 351 352 DescrCveItem cveI3=new DescrCveItem(); 353 cveI3.setName("Color dummy"); 354 cveI3.setAction("colorDummy"); 355 356 361 cveM.addItem(cveI1); 362 cveM.addItem(cveI2); 363 cveM.addItem(cveI3); 364 366 return cveM; 367 } 368 369 } | Popular Tags |