Upload
jan-koehnlein
View
3.268
Download
2
Embed Size (px)
DESCRIPTION
Ta
Citation preview
A FRESH LOOK AT
GRAPHICAL EDITING
Dr. Jan Köhnlein
Mittwoch, 28. März 12
一畫勝千言
Mittwoch, 28. März 12
A PICTURESAYS
MORE THANA THOUSAND
WORDS
一畫勝千言
Mittwoch, 28. März 12
A PICTURESAYS
MORE THANA THOUSAND
WORDS
一畫勝千言
Myth
Mittwoch, 28. März 12
Mittwoch, 28. März 12
package ecore
abstract class EModelElement extends EObject { op EAnnotation getEAnnotation(String source) contains EAnnotation[] eAnnotation opposite eModelElement }
class EAnnotation extends EObject { container EModelElement eModelElement opposite eAnnotation}
abstract class ENamedElement extends EModelElement{ String name}
class EFactory extends EObject { op EObject ^create(EClass eClass) op EJavaObject createFromString(EDataType eDataType, String literalValue) op String createFromString(EDataType eDataType, EJavaObject instanceValue) refers EPackage ePackage opposite eFactoryInstance}
abstract class ETypedElement extends ENamedElement { boolean ordered = "true" boolean ^unique = "true" int lowerBound int upperBound = "1" boolean many refers EClassifier eType}
abstract class EClassifier extends ENamedElement { String instanceClassName EJavaClass instanceClass EJavaObject defaultValue op boolean isInstance(EJavaObject object) op int getClassifierID() container EPackage ePackage opposite eClassifiers}
class EPackage extends ENamedElement { String nsURI String nsPrefix op EClassifier getEClassifier(String name) refers EFactory eFactoryInstance opposite ePackage contains EPackage[] eSubPackages opposite eSuperPackage container EPackage eSuperPackage opposite eSubPackages contains EClassifier[] eClassifiers opposite ePackage}
class EOperation extends ETypedElement { contains EParameter[] eParameters opposite eOperation container EClass eContainingClass opposite eOperations refers EClassifier[] eExceptions}
class EClass extends EClassifier { boolean ^abstract boolean ^interface op boolean isSuperTypeOf(EClass someClass) op EStructuralFeature getEStructuralFeature(int featureID) op EStructuralFeature getEStructuralFeature(String featureName) contains EOperation[] eOperations opposite eContainingClass refers EOperation[] eAllOperations contains EStructuralFeature[] eStructuralFeatures opposite eContainingClass refers EStructuralFeature[] eAllStructuralFeatures refers EReference[] eAllContainments refers EReference[] eAllReferences refers EReference[] eReferences refers EAttribute[] eAllAtrributes refers EAttribute[] eAtrributes refers EAttribute eIDAtrributes refers EClass[] eAllSuperTypes refers EClass[] eSuperTypes}
class EDataType extends EClassifier { boolean serializable = "true"}
abstract class EStructuralFeature extends ETypedElement { boolean changeable = "true" boolean ^volatile boolean ^transient String defaultValueLiteral EJavaObject defaultValue boolean ^unsettable boolean ^derived op int getFeatureID() op EJavaClass getContainerClass() container EClass eContainingClass opposite eStructuralFeatures}
class EReference extends EStructuralFeature { boolean containment boolean ^container boolean resolveProxies = "true" refers EReference eOpposite opposite eOpposite}
class EParameter extends ETypedElement { container EOperation eOperation opposite eParameters }
class EAttribute extends EStructuralFeature { boolean iD refers EDataType eAttributeType}
class EEnumLiteral extends ENamedElement { int value EEnumerator instance container EEnum eEnum opposite eLiterals}
class EEnum extends EDataType { op EEnumLiteral getEEnumLiteral(String name) op EEnumLiteral getEEnumLiteral(int value) contains EEnumLiteral[] eLiterals opposite eEnum}
class EObject {}type EJavaClass wraps Classtype EJavaObject wraps Objecttype EEnumerator wraps java.util.Enumeration
Mittwoch, 28. März 12
package ecore
abstract class EModelElement extends EObject { op EAnnotation getEAnnotation(String source) contains EAnnotation[] eAnnotation opposite eModelElement }
class EAnnotation extends EObject { container EModelElement eModelElement opposite eAnnotation}
abstract class ENamedElement extends EModelElement{ String name}
class EFactory extends EObject { op EObject ^create(EClass eClass) op EJavaObject createFromString(EDataType eDataType, String literalValue) op String createFromString(EDataType eDataType, EJavaObject instanceValue) refers EPackage ePackage opposite eFactoryInstance}
abstract class ETypedElement extends ENamedElement { boolean ordered = "true" boolean ^unique = "true" int lowerBound int upperBound = "1" boolean many refers EClassifier eType}
abstract class EClassifier extends ENamedElement { String instanceClassName EJavaClass instanceClass EJavaObject defaultValue op boolean isInstance(EJavaObject object) op int getClassifierID() container EPackage ePackage opposite eClassifiers}
class EPackage extends ENamedElement { String nsURI String nsPrefix op EClassifier getEClassifier(String name) refers EFactory eFactoryInstance opposite ePackage contains EPackage[] eSubPackages opposite eSuperPackage container EPackage eSuperPackage opposite eSubPackages contains EClassifier[] eClassifiers opposite ePackage}
class EOperation extends ETypedElement { contains EParameter[] eParameters opposite eOperation container EClass eContainingClass opposite eOperations refers EClassifier[] eExceptions}
class EClass extends EClassifier { boolean ^abstract boolean ^interface op boolean isSuperTypeOf(EClass someClass) op EStructuralFeature getEStructuralFeature(int featureID) op EStructuralFeature getEStructuralFeature(String featureName) contains EOperation[] eOperations opposite eContainingClass refers EOperation[] eAllOperations contains EStructuralFeature[] eStructuralFeatures opposite eContainingClass refers EStructuralFeature[] eAllStructuralFeatures refers EReference[] eAllContainments refers EReference[] eAllReferences refers EReference[] eReferences refers EAttribute[] eAllAtrributes refers EAttribute[] eAtrributes refers EAttribute eIDAtrributes refers EClass[] eAllSuperTypes refers EClass[] eSuperTypes}
class EDataType extends EClassifier { boolean serializable = "true"}
abstract class EStructuralFeature extends ETypedElement { boolean changeable = "true" boolean ^volatile boolean ^transient String defaultValueLiteral EJavaObject defaultValue boolean ^unsettable boolean ^derived op int getFeatureID() op EJavaClass getContainerClass() container EClass eContainingClass opposite eStructuralFeatures}
class EReference extends EStructuralFeature { boolean containment boolean ^container boolean resolveProxies = "true" refers EReference eOpposite opposite eOpposite}
class EParameter extends ETypedElement { container EOperation eOperation opposite eParameters }
class EAttribute extends EStructuralFeature { boolean iD refers EDataType eAttributeType}
class EEnumLiteral extends ENamedElement { int value EEnumerator instance container EEnum eEnum opposite eLiterals}
class EEnum extends EDataType { op EEnumLiteral getEEnumLiteral(String name) op EEnumLiteral getEEnumLiteral(int value) contains EEnumLiteral[] eLiterals opposite eEnum}
class EObject {}type EJavaClass wraps Classtype EJavaObject wraps Objecttype EEnumerator wraps java.util.Enumeration
368 Words
Mittwoch, 28. März 12
Mittwoch, 28. März 12
ENTIRE ECORE ~500 WORDS
Mittwoch, 28. März 12
Mittwoch, 28. März 12
DIAGRAMS ARE TALKING TO
YOU NOT TO YOUR COMPUTER
Mittwoch, 28. März 12
REQUIREMENTSModel(Computer)
Diagram(User)
Mittwoch, 28. März 12
REQUIREMENTSModel(Computer)
Diagram(User)
Completeness
Conciseness
Consistency
Containment
Mittwoch, 28. März 12
Explain Model to Humans
Projection, arbitrary focus
Verbosity and sloppiness
Slick visual design
Usability of a drawing tool
REQUIREMENTSModel(Computer)
Diagram(User)
Completeness
Conciseness
Consistency
Containment
Mittwoch, 28. März 12
Semantic model Diagram
1-to-1Mapping
MODEL EDITING SOLUTION
Mittwoch, 28. März 12
Semantic model Diagram
1-to-1Mapping
MODEL EDITING SOLUTION
Mittwoch, 28. März 12
MISMATCH IS THE RULE
TreeNode*
childrenDiagram
Node Edge
edgesnodes * *
Mittwoch, 28. März 12
MISMATCH IS THE RULE
TreeNode*
childrenDiagram
Node Edge
edgesnodes * *
Mittwoch, 28. März 12
MISMATCH IS THE RULE
TreeNode*
childrenDiagram
Node Edge
edgesnodes * *
TreeNode A > TreeNode B
Mittwoch, 28. März 12
MISMATCH IS THE RULE
TreeNode*
childrenDiagram
Node Edge
edgesnodes * *
TreeNode A > TreeNode B
Mittwoch, 28. März 12
MISMATCH IS THE RULE
TreeNode*
childrenDiagram
Node Edge
edgesnodes * *
TreeNode A > TreeNode B
Diagram > Node A> Node B> Edge (A,B)
Mittwoch, 28. März 12
DIAGRAM ASSIMILATION
Mittwoch, 28. März 12
USER SURPRISE
Mittwoch, 28. März 12
USER SURPRISE
Delete
Cut / Copy / Paste
Drag & Drop
Mittwoch, 28. März 12
GHOST ELEMENTS
Mittwoch, 28. März 12
GHOST ELEMENTS
Remnants of failed Cut/Copy/Paste/Deleteor Drag & Drop actions
Breaking model integrity
Not shown in any diagram
Mittwoch, 28. März 12
NON-GRAPHICAL EDITING
Mittwoch, 28. März 12
NON-GRAPHICAL EDITING
Mittwoch, 28. März 12
NON-GRAPHICAL EDITING
Mittwoch, 28. März 12
INSUFFICIENT DESIGN
Mittwoch, 28. März 12
INSUFFICIENT DESIGN
Mittwoch, 28. März 12
YOUR EDITOR DEGRADES
WHEN YOU FOCUS ON MODEL EDITING
Mittwoch, 28. März 12
Enforce 1-to-1-mapping
•Assimilate diagram
• Loss of expressiveness
• Loss of usability
•Add non-graphical tools
WHAT IS YOUR FOCUSModelEditing
Diagram Editing
Dynamic one-way mapping
Full graphical flexibility
Style for understandability
Choose projection easily
• Find another way to edit
Mittwoch, 28. März 12
Semantic model Diagram
One-wayMapping
MODEL VIEW SOLUTION
Mittwoch, 28. März 12
Semantic model Diagram
One-wayMapping
MODEL VIEW SOLUTION
Mittwoch, 28. März 12
MODELEDITING
Mittwoch, 28. März 12
DIAGRAMEDITING
Mittwoch, 28. März 12
• Reads mapping and stylesheet
• Capture snapshots of any live model
• Render GEF diagram with shape library
• Selection / navigation adapter for
• EMF, Xtext, JDT
RUNTIME
Mittwoch, 28. März 12
• Xtext-based with Xbase expressions
• Uni-directional transformation
• Interpreted
MAPPING DSL
Mittwoch, 28. März 12
• Xtext-based with Xbase expressions
• Directly modifies Draw2d figures
• Interpreted
STYLING DSL
Mittwoch, 28. März 12
MyClass
SuperClass
Mittwoch, 28. März 12
MyClass
SuperClass
this
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass {
MyClass
SuperClass
this
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass {
MyClass
SuperClass
this
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this {
MyClass
SuperClass
this
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this {
MyClass
SuperClass
this
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this { label Name for this
MyClass
SuperClass
this
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this { label Name for this
MyClass
SuperClass
this MyClass
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this { label Name for this edge SuperType for each this.getESuperTypes() {
MyClass
SuperClass
this MyClass
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this { label Name for this edge SuperType for each this.getESuperTypes() {
MyClass
SuperClass this
MyClass
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this { label Name for this edge SuperType for each this.getESuperTypes() { => call EClassNode for this
MyClass
SuperClass this
MyClass
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this { label Name for this edge SuperType for each this.getESuperTypes() { => call EClassNode for this
MyClass
SuperClass this
MyClass
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this { label Name for this edge SuperType for each this.getESuperTypes() { => call EClassNode for this
MyClass
SuperClass this SuperClass
MyClass
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this { label Name for this edge SuperType for each this.getESuperTypes() { => call EClassNode for this
MyClass
SuperClass
this
SuperClass
MyClass
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this { label Name for this edge SuperType for each this.getESuperTypes() { => call EClassNode for this
MyClass
SuperClass
this
SuperClass
MyClass
Mittwoch, 28. März 12
diagram EClassHierarchy type EClass { node EClassNode for this { label Name for this edge SuperType for each this.getESuperTypes() { => call EClassNode for this } }}
MyClass
SuperClass
this
SuperClass
MyClass
Mittwoch, 28. März 12
stylesheet EClassHierarchy for EClassHierarchy
style EClassNode.SuperType { var arrow = new PolygonDecoration() arrow.setScale(10,10) arrow.backgroundColor = color(#ffffff) arrow.lineWidth = 2 this.targetDecoration = arrow }
style EClassNode.Name { font = font("Helvetica", 13,
if (element.abstract) 3 else 1)}
Mittwoch, 28. März 12
refs to mappings
stylesheet EClassHierarchy for EClassHierarchy
style EClassNode.SuperType { var arrow = new PolygonDecoration() arrow.setScale(10,10) arrow.backgroundColor = color(#ffffff) arrow.lineWidth = 2 this.targetDecoration = arrow }
style EClassNode.Name { font = font("Helvetica", 13,
if (element.abstract) 3 else 1)}
Mittwoch, 28. März 12
Xbase body
stylesheet EClassHierarchy for EClassHierarchy
style EClassNode.SuperType { var arrow = new PolygonDecoration() arrow.setScale(10,10) arrow.backgroundColor = color(#ffffff) arrow.lineWidth = 2 this.targetDecoration = arrow }
style EClassNode.Name { font = font("Helvetica", 13,
if (element.abstract) 3 else 1)}
Mittwoch, 28. März 12
this variable
stylesheet EClassHierarchy for EClassHierarchy
style EClassNode.SuperType { var arrow = new PolygonDecoration() arrow.setScale(10,10) arrow.backgroundColor = color(#ffffff) arrow.lineWidth = 2 this.targetDecoration = arrow }
style EClassNode.Name { font = font("Helvetica", 13,
if (element.abstract) 3 else 1)}
Mittwoch, 28. März 12
color literals
stylesheet EClassHierarchy for EClassHierarchy
style EClassNode.SuperType { var arrow = new PolygonDecoration() arrow.setScale(10,10) arrow.backgroundColor = color(#ffffff) arrow.lineWidth = 2 this.targetDecoration = arrow }
style EClassNode.Name { font = font("Helvetica", 13,
if (element.abstract) 3 else 1)}
Mittwoch, 28. März 12
extensions
stylesheet EClassHierarchy for EClassHierarchy
style EClassNode.SuperType { var arrow = new PolygonDecoration() arrow.setScale(10,10) arrow.backgroundColor = color(#ffffff) arrow.lineWidth = 2 this.targetDecoration = arrow }
style EClassNode.Name { font = font("Helvetica", 13,
if (element.abstract) 3 else 1)}
Mittwoch, 28. März 12
semantic styling
stylesheet EClassHierarchy for EClassHierarchy
style EClassNode.SuperType { var arrow = new PolygonDecoration() arrow.setScale(10,10) arrow.backgroundColor = color(#ffffff) arrow.lineWidth = 2 this.targetDecoration = arrow }
style EClassNode.Name { font = font("Helvetica", 13,
if (element.abstract) 3 else 1)}
Mittwoch, 28. März 12
https://github.com/JanKoehnlein/Generic-Graph-View
The code is at
But remember:
IT‘S A PROTOTYPE
Mittwoch, 28. März 12