260 likes | 368 Views
Introduction to the Graphical Modeling Framework. Artem Tikhomirov, Borland Alexander Shatalin, Borland. GMF Overview. “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for developing graphical editors based on EMF and GEF.”
E N D
Introduction to the Graphical Modeling Framework Artem Tikhomirov, Borland Alexander Shatalin, Borland
GMF Overview • “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for developing graphical editors based on EMF and GEF.” • Significantly reduces cost of DSL tooling • GMF is part of Eclipse Modeling Project • GMF-generated solutions proved by: • .ecore diagram editor • .gmfgraph bootstrapping editor • UML2 Tools project diagram editors • Borland Together DSL toolkit
Agenda • Define requirements for diagram editor • Building diagram editor with GMF, basic steps • Live demo • Hands on – try building your version of GMF diagram • GMF architecture • Q&A session • Generated diagram extensibility • Additions
Define requirements for diagram editor Router SubNet Workstation
Building diagram editor with GMF, basic steps • Design EMF domain meta-model • Create graphical representations for diagram nodes/links • Define diagram structure and generate code ?
Graphical elements • SVG picture • Draw2d “matryoshka” • Composite SVG figure
M2T ? Domain model M2M Graphical shapes Define diagram structure and generate code Java code
Hands on/Q&A session Try building your version of GMF diagram
Transformation Templates Domain Model (ECore) Generator Model (GMFGen) Java code Mapping (GMFMap) Platform Graphical Definition (GMFGraph) GMF Runtime Tool Definition (GMFTool) GMF architecture: GMF Tooling • Set of models to define diagram editor - capturing graphical, tooling and meta-modeling aspects. • Extensible code generator, capable to customize generated code to match specific requirements
Models: Domain. What is meta-model? A dog sits in a car. A girl reads a green book. … UML EMF XSD … Java API Instance level Meta-level
Figures Shapes Models: Graphical Definition
Diagram Elements Models: Graphical Definition
Models: Tooling • Palette tools • Context menu actions • Property sheet
Domain model Tool Definition Graphical Definition Mapping model Models: Mapping
M2T M2M Models: Generation
GMF architecture: Runtime component A set of plug-ins simplifying development of EMF-based diagram editor, with an execution time extensibility • Reusable components for graphical editors • Standardized model to describe visual properties of diagram elements • Set of Services extensible via declared extension-points at execution time • Command infrastructure that bridges EMF and GEF
Domain Model (ECore) Generator Model (GMFGen) Java code Mapping (GMFMap) Platform Graphical Definition (GMFGraph) GMF Runtime Tool Definition (GMFTool) Variation points Transformation Templates Extension points Code Models
Runtime - Lite • Lightweight alternative to Full Runtime • Notation Model to represent diagram • Experimental option • Targets pure GEF • Easy to understand • nothing but EMF and GEF
Visual model: Styled text representation A dog sits in a car. A dog sits in a car. <sentenceRepresentation sentence="s.xmi#//@sentence"> <wordRepresentations word="s.xmi#//@sentence/@words.0"/> <wordRepresentations word="s.xmi#//@sentence/@words.1"> <color red=“255“ blue=“0” green=“0”/> </wordRepresentations> <wordRepresentations word="s.xmi#//@sentence/@words.2"/> <wordRepresentations word="s.xmi#//@sentence/@words.3"/> <wordRepresentations word="s.xmi#//@sentence/@words.4"/> <wordRepresentations word="s.xmi#//@sentence/@words.5" bold="true"/> </sentenceRepresentation>
Visual model: Styled text representation A dog sits in a car. A dog sits in a car.
Thank you for your attention. • www.eclipse.org/gmf