Projekt zakończony
Szybura Bartek b.szybura@interia.pl
GEFARDXTT
GEF and Eclipse based editor for ARD and XTT. Evaluation, feasibility, prototype. XTTv2 Editor requirements
input:
Eclipse: EMF, GEF resources (GEF, http://www.eclipse.org/articles/Article-GEF-editor/gef-schema-editor.html),
ARD: Towards Formalization of ARD+ Conceptual Design and Refinement Method and An ARD+ Design and Visualization Toolchain Prototype in Prolog and UServ Case Study, Conceptual Design with ARD+ Method.
output:
Feasibility study, a description how to create such editors with GEF, a prototype editor MS Thesis regarding GEF: Interfejs graficzny do budowy aplikacji komponentowych zapewniający weryfikację semantyczną, ARD+ Editor requirements
Celem projektu było zapoznanie się z dostępnymi Frameworkami pozwalającymi na budowę edytora XTT. Na początku przeanalizowałem framewrok GEF (Graphical Editing Framework). Niestety w przypadku GEF zbudowanie odpowiedniego edytora było bardzo pracochłonne. Praca w GEF-ie zaczynała się o stworzenia odpowiednich tablic, połączeń, etykiet tablic lub połączeń. Korzystając tylko z GEF-a wszystkie właściwości takie jak miejsce narysowania strzałki, tablicy trzeba ręcznie ustawiać.
Dlatego też poszukałem inne rozwiązania, które są wykorzystywane w budowie edytorów. Znalazłem następny framework EMF (Eclipse Modeling Framework). Dzięki temu rozwiązaniu udało mi się stworzyć opis XTT w XML Schema.
Poniżej przedstawiam opis XTT w .xsd:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="http://student.agh.edu.pl/~szybura/xtt" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:xtt="http://student.agh.edu.pl/~szybura/xtt" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType name="Graph"> <xsd:sequence> <xsd:element name="TitleGraph" type="xsd:string" /> <xsd:element name="DescribeGraph" type="xsd:string" /> <xsd:element maxOccurs="unbounded" minOccurs="1" name="TableGarph" type="xtt:Tabel" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Tabel"> <xsd:sequence> <xsd:element name="TitleTabel" type="xsd:string" /> <xsd:element name="DescribeTabel" type="xsd:string" /> <xsd:element maxOccurs="unbounded" minOccurs="1" name="DataTabel" type="xtt:Row" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="InsideRow"> <xsd:sequence> <xsd:element name="DescribeInsideRow" type="xsd:string" /> <xsd:element name="DataInsideRow" type="xsd:string" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Row"> <xsd:sequence> <xsd:element name="TitleRow" type="xsd:string" /> <xsd:element name="IdRow" type="xsd:int" /> <xsd:element maxOccurs="unbounded" minOccurs="1" name="DataRow" type="xtt:InsideRow" /> <xsd:element maxOccurs="1" minOccurs="0" name="ConectorRow" type="xsd:anyURI" ecore:reference="xtt:Row" ecore:opposite="IdRow"/> </xsd:sequence> </xsd:complexType> </xsd:schema>
Dzięki danemu plikowi mogłem wygenerować pliki xtt.ecore oraz xtt.genmodel, które potrzebne mi były do stworzenia edytora XTT.
Rysunek 1.
Dzięki stworzonemu edytorowi XTT mogę wygenerować opis grafów XTT, np. (opis skrócony):
<?xml version="1.0" encoding="UTF-8"?> <xtt:Graph xmlns:xtt="http://student.agh.edu.pl/~szybura/xtt"> <TitleGraph>Termostat</TitleGraph> <DescribeGraph>Example. Termostat</DescribeGraph> <TableGarph> <TitleTabel>ms</TitleTabel> <DescribeTabel>Table id: 1 - ms</DescribeTabel> <DataTabel> <TitleRow>Describe row</TitleRow> <DataRow> <DescribeInsideRow>(?) month</DescribeInsideRow> <DataInsideRow>(?) month</DataInsideRow> </DataRow> <DataRow> <DescribeInsideRow>(?) season</DescribeInsideRow> <DataInsideRow>(?) season</DataInsideRow> </DataRow> </DataTabel> </TableGarph> </xtt:Graph>
W każdym pliku mogę wygenerować odpowiednie tabele, w których mogę stworzyć wiersze, które są akurat potrzebne do przedstawienia danego modelu. Odpowiednie wiersze mogę ze sobą łączyć:
<ConectorRow>#//@tableGarph.0/@dataTabel.0</ConectorRow>
W tutorialu wykorzystuję oprogramowanie:
Eclipse Platform Version: 3.4.0