Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Marko Boger HTWG Konstanz Karsten Thoms - temis !os Warmer - n"epen"ant #a$io #i%ipe%%i& Markus Gerhart& Michae% Bauer& 'teffen Ko%%osche HTWG Konstanz
0ur goa% is to make the "e1e%opement of graphica% 2"itors as simp%e as a te3tua% e"itor with too%s %ike 4te3t #irst Target 5%atform is 2c%ipse with Graphiti an" 2M# 6ersion */7/* re%ease" in March )*+)
(o"eGeneration )*+) - Marko Boger )
Graphiti
Framework approach Easy to understand (relatively...) Hides complexity of GEF, Draw2D Only few core concepts Everything is a Feature
Add, Update, Move, Delete, ... Diagram Type Provider, Tool Provider, Image Provider, ...
8
Providers
Graphiti
Much code, often repetitive implementation Per mapped meta class
at least AddFeature, CreateFeature, UpdateFeature Remove, Delete, Move, Layout, DrillDown, ... Registration in FeatureProvider Configure palette in ToolBehaviourProvider
shape connection
sty%e c%ass
Model-Driven Generation Eclipse Plugin for Graphical Editor !ML (Plugin) ava Properties (Plugin)
'pray :';
<
'pray :';
:efining 'hapes
The Shape
>
+*
++
'ty%es
'ty%e :';
(o%or #ont ;ine
+)
+8
6arious 'ty%es
'ty%es can $e reuse" 'ty%es can $e inherite"
n"i1i"ua% attri$utes can $e o1erri""en
+9
Anchor
An Anchor is the connection point of a connection to a shape ts position is a property of the shape There are 7 options
(enter B"efau%tC (orners #i3e" @e%ati1e
+<
+=
0ur To"o-;ist
(%ipping @esize cons (opy-5aste 0ut%ine Dn"er%ine @api" Button (onte3t menu 'ha"ows an" G%ows Gra"ients 5roperty 2"itor Te3t-'upport (ompartments Mo"e% 1a%i"ation Mo"e% $rowser
+>
#uture 5%ans
(omp%e3 :iagrams- B5ME& DM;& 5etriEet 21o%1e :';s 'e1era% Bui%" targets
'wing We$
)*
The Metamo"e%
2M# metamo"e%
(an $e create" with any 2M# comp%iant too%
2c%ipse tree e"itor 5osei"on for :';s
)+
class LWCLocationNoLine alias Noline : shape LWC_Location_NoLine { shapeName = name.substring(0,name.indexOf(";")) valueName = name.substring(name.indexOf(";")+1, name.length) behavior { create into modelElements palette "Locations" askFor name;
(o"eGeneration )*+) - Marko Boger ))
class LWC'o(rceE)ha(st'tart : connection LWC_'o(rce_E)ha(st %& { from fromElement; to toElement; behavior { create into modelElements palette "Connections";
)8
)7
shape LWC_"eatE)changer %*ava+lang+'tring shapeName& { ellipse { position%)-./0-4.& si#e%1idth-2./height-2.& pol0line { point%)-7./0-8.& point%)-6./0-8.& point%)-5./0-5.& point%)-6./0-6.& point%)-7./0-6.& te)t { position%)-./0-.& si#e%1idth-3../height-4.& val(e-shapeName anchor { position%)-./0-5.& position%)-7./0-6.& position%)-7./0-8.&
(o"eGeneration )*+) - Marko Boger )9
shape LWC_"eatE)changer %*ava+lang+'tring shapeName& { ro(nded,rectangle { position%)-./0-4.& si#e%1idth-2./height-7.& c(rve%1idth-5./ height-5.& pol0line { point%)-7./0-7.& point%)-6./0-7.& point%)-5./0-8.& point%)-6./0-5.& point%)-7./0-5.& te)t { position%)-./0-.& si#e%1idth-3../height-4.& val(e-shapeName anchor { position%)-./0-5.& position%)-./0-7.& position%)-7./0-5.& position%)-7./0-7.&
(o"eGeneration )*+) - Marko Boger )<
The (ha%%enge
)=
)>
(osts
Metamo"e%- )? %ines 'pray BcoreC :';- +89 %ines 'hape :';- 8*8 %ines 'ty%e- * %ines