introduction to the graphical modeling framework
DESCRIPTION
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.” - PowerPoint PPT PresentationTRANSCRIPT
© 2008 by Borland Software Corp; made available under the EPL v1.0 | 17 March 2008
Introduction to the Graphical Modeling Framework
Artem Tikhomirov, BorlandAlexander Shatalin, Borland
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
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
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
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
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Define requirements for diagram editor
Workstation
RouterSubNet
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
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 ?
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
EMF domain meta-model
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Graphical elements
• SVG picture
• Draw2d “matryoshka”
• Composite SVG figure
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Define diagram structure and generate code
Javacode
Domain model
?M2M
M2T
Graphical shapes
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Live demo
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Hands on/Q&A session
Try building your version of GMF diagram
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
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
Generator Model (GMFGen)
Java code
Mapping (GMFMap)
Tool Definition (GMFTool)
Graphical Definition (GMFGraph)
Domain Model (ECore)
Transformation
Templates
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Models: Domain. What is meta-model?
UML EMF XSD
Java API
A dog sits in a car.
A girl reads a green book.
…
Instance level Meta-level
…
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Models: Graphical Definition
FiguresShapes
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Models: Graphical Definition
Diagram Elements
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Models: Tooling
Palette tools
Context menu actions
Property sheet
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Models: Mapping
Domain model
Tool Definition
Graphical Definition
Mapping model
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Models: Generation
M2T
M2M
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
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
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Variation points
Generator Model (GMFGen)
Java code
Mapping (GMFMap)
Tool Definition (GMFTool)
Graphical Definition (GMFGraph)
Domain Model (ECore)
ModelsTransformationTemplatesExtension pointsCode
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Additions
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
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
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Notation Model
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
<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.
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Visual model: Styled text representation
A dog sits in a car. A dog sits in a car.
Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0
Thank you for your attention.
• www.eclipse.org/gmf