Eclipse Modeling Framewok (EMF) - Distributed Systems
Eclipse Modeling Framewok (EMF) - Distributed Systems
Eclipse Modeling Framewok (EMF) - Distributed Systems
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Crear un modelo programáticamente – Java<br />
TreeFactory tree = TreeFactory . eINSTANCE ;<br />
2 Node root = tree . createNode ();<br />
root . setLabel (" Root ");<br />
4 Node a = tree . createNode ();<br />
a. setLabel ("A");<br />
6 root . getChildren ().add (a);<br />
Node x = tree . createNode ();<br />
8 x. setLabel ("X");<br />
a. getChildren ().add (x);<br />
10 Node b = tree . createNode ();<br />
b. setLabel ("B");<br />
12 root . getChildren ().add (b);<br />
Node y = tree . createNode ();<br />
14 y. setLabel ("Y");<br />
b. getChildren ().add (y);<br />
Diego Sevilla Ruiz (DITEC Facultad de Informática) <strong>Eclipse</strong> <strong>Modeling</strong> <strong>Framewok</strong> (<strong>EMF</strong>) Murcia, October 2011 50 / 52