introduction to the graphical modeling framework

25
© 2008 by Borland Software Corp; made available under the EPL v1.0 | 17 March 2008 Introduction to the Graphical Modeling Framework Artem Tikhomirov, Borland Alexander Shatalin, Borland

Upload: storm

Post on 02-Feb-2016

43 views

Category:

Documents


1 download

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 Presentation

TRANSCRIPT

Page 1: Introduction to the Graphical Modeling Framework

© 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

Page 2: Introduction to the Graphical Modeling Framework

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

Page 3: Introduction to the Graphical Modeling Framework

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

Page 4: Introduction to the Graphical Modeling Framework

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

Page 5: Introduction to the Graphical Modeling Framework

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 ?

Page 6: Introduction to the Graphical Modeling Framework

Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0

EMF domain meta-model

Page 7: Introduction to the Graphical Modeling Framework

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

Page 8: Introduction to the Graphical Modeling Framework

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

Page 9: Introduction to the Graphical Modeling Framework

Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0

Live demo

Page 10: Introduction to the Graphical Modeling Framework

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

Page 11: Introduction to the Graphical Modeling Framework

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

Page 12: Introduction to the Graphical Modeling Framework

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

Page 13: Introduction to the Graphical Modeling Framework

Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0

Models: Graphical Definition

FiguresShapes

Page 14: Introduction to the Graphical Modeling Framework

Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0

Models: Graphical Definition

Diagram Elements

Page 15: Introduction to the Graphical Modeling Framework

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

Page 16: Introduction to the Graphical Modeling Framework

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

Page 17: Introduction to the Graphical Modeling Framework

Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0

Models: Generation

M2T

M2M

Page 18: Introduction to the Graphical Modeling Framework

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

Page 19: Introduction to the Graphical Modeling Framework

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

Page 20: Introduction to the Graphical Modeling Framework

Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0

Additions

Page 21: Introduction to the Graphical Modeling Framework

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

Page 22: Introduction to the Graphical Modeling Framework

Introduction to the Graphical Modeling Framework | © 2008 by Borland Software Corp; made available under the EPL v1.0

Notation Model

Page 23: Introduction to the Graphical Modeling Framework

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.

Page 24: Introduction to the Graphical Modeling Framework

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.

Page 25: Introduction to the Graphical Modeling Framework

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