1 package cve.environment; 2 3 import cve.core.comunicazione.*; 4 import cve.core.costruttori.*; 5 import cve.core.elementEEL.*; 6 import cve.core.elementLDL.*; 7 import cve.esecutori.*; 8 import cve.util.*; 9 10 import relations.*; 11 12 import java.util.*; 13 14 21 final public class Make_env_graph extends Make_env 22 { 23 24 public Make_env_graph() {} 25 26 31 public void createEnv(){ 32 Class ese=null,oss=null, pre=null,unit=null; 33 ist=new IstanziaElement(); 35 env=new Environment(2); 37 System.out.println(); 38 System.out.println(" COSTRUISCO AMBIENTE LDL "); 39 try { 41 ese = Class.forName("cve.esecutori.EACesec"); 42 oss = Class.forName("cve.osservatori.OACesec"); 43 pre = Class.forName("cve.core.elementEEL.Presenter"); 44 } catch (ClassNotFoundException e) { 45 System.err.println("Caught classe non trovata: " + 46 e.getMessage()); 47 } 48 IElementoCve eleCveE=ist.crea("esecutore"," 1",ese); 50 IElementoCve eleCveO=ist.crea("osservatore"," 2",oss); 51 DescrCveToolBar cveTB=creaTB(); 53 IElementoCveVis eleCveP=ist.crea("presenter"," 3",pre,cveTB); 54 eleCveP.setIcon(iconPath); 56 57 env.addElement(eleCveE); 59 env.addElement(eleCveO); 60 env.addElement(eleCveP); 61 IMemberRel membro1=new MemberRel("esecutore",eleCveE); 63 IMemberRel membro2=new MemberRel("osservatore",eleCveO); 64 RelInterlayerCve interlayerA=new RelInterlayerCve("EsempioInterA"); 65 Vector app=new Vector(); 67 app.add(membro1); 68 app.add(membro2); 69 interlayerA.setMembers(app); 70 IMemberRel memb1=new MemberRel("presenter",eleCveP); 72 IMemberRel memb2=new MemberRel("osservatore",eleCveO); 73 RelInterlayerCve interlayerB=new RelInterlayerCve("EsempioInterB"); 74 Vector app1=new Vector(); 76 app1.add(memb1); 77 app1.add(memb2); 78 interlayerB.setMembers(app1); 79 System.out.println( " Creata relazione di tipo interlayer (A) "); 81 env.addRel((IRelazione)interlayerA); 83 env.addRel((IRelazione)interlayerB); 84 System.out.println( " Insieme di relazione cve (Ldl), contiene: un interlayer (A)(B) e un layer (C)"); 85 System.out.println(""); 86 System.out.println(" COSTRUISCO AMBIENTE EEL "); 87 ldl_to_eel= new Ldl_to_Edl(env); 89 System.out.println( " Creato insieme elementi Edl (osservatori e esecutori) "); 90 System.out.println( " Create e riempite strutture dedicate alla comunicazione (gruppi,... ) "); 91 } 92 93 97 101 public EnvironmentEEL getEnvironmentEEL(){ 102 envEEL=ldl_to_eel.getEnvironmentEEL(); 104 return envEEL; 105 } 106 107 112 public void setIconEnv(String iconPath){ 113 this.iconPath = iconPath; 114 } 115 116 117 122 public void setTitle(String title){ 123 this.titleEnv = title; 124 } 125 126 127 128 132 private DescrCveToolBar creaTB(){ 133 DescrCveToolBar cveT=new DescrCveToolBar(); 134 135 DescrCveButton cveB1=new DescrCveButton(); 136 cveB1.setAction("getLinguaggio"); 137 cveB1.setIcon(ConfigurationRead.getCveRoot()+"/resource/LOADAUT.gif"); 138 139 DescrCveButton cveB2=new DescrCveButton(); 140 cveB2.setAction("cancLinguaggio"); 141 cveB2.setIcon(ConfigurationRead.getCveRoot()+"/resource/CANCAUT.gif"); 142 143 cveT.addDescrCveB(cveB1); 144 cveT.addDescrCveB(cveB2); 145 return cveT; 146 } 147 } | Popular Tags |