SlideShare a Scribd company logo
GraphitiThe Graphical Tooling Infrastructure Speaking Plain Java Michael Wenz SAP AG 03/23/2010 Graphiti are: Christian Brand Jürgen Pasch 	Matthias Gorning 	Michael Wenz 	Tim Kaiser
What Is Graphiti All About ? “The goal of Graphiti is to support the fast and easy creation of unified graphical tools, which can display and edit underlying domain models using a tool-defined graphical notation.”
What Is Graphiti All About ? “The goal of Graphiti is to support the fast and easy creation of unified graphical tools, which can display and edit underlying domain models using a tool-defined graphical notation.”
Why Should I Want to Use Graphiti ?
How Does Graphiti Work ?
What about the Diagram Type Agent ? Diagram Type Agent Feature Provider Diagram Type Provider A feature implements an operation for a domain object and defines the context in which the operation can be triggered Add Feature Create Feature Delete Feature … Specialized features for common user interactions available
Domain Hierarchie Pictogram Elements Links Visualization Graphics Algorithms EClass Container Shape Link EAttribute Attribute Text Shape Shape Shape Shape Container Shape Which Objects Do I Deal with ? Text Text EOperation Attribute Link Link Link Link Result Shape Container Shape
Well Then - How Do I Build a Tool ?
Well Then - How Do I Build a Tool ?
packageorg.eclipse.graphiti.tutorial;   importorg.eclipse.graphiti.dt.AbstractDiagramTypeProvider;   publicclassTutorialDiagramTypeProviderextendsAbstractDiagramTypeProvider {   publicTutorialDiagramTypeProvider() { super(); 	} } Well Then - How Do I Build a Tool ?
Well Then - How Do I Build a Tool ?
Well Then - How Do I Build a Tool ? … <extension point="org.eclipse.graphiti.eclipse.diagramTypes"> <diagramType 	id="org.eclipse.graphiti.tutorial.TutorialDiagramType„ 	type="tutorial„ 	name="Tutorial Diagram Type„ 	description="This is the diagram type for the Graphiti tutorial"> </diagramType> </extension> <extension point="org.eclipse.graphiti.eclipse.diagramTypeProviders">     <diagramTypeProvider 	id="org.eclipse.graphiti.tutorial.TutorialDiagramTypeProvider„ 	name="Tutorial Editor„ 	class="org.eclipse.graphiti.tutorial.TutorialDiagramTypeProvider„ 	description="This is the editor for the Graphiti tutorial"> <diagramType 	    id="org.eclipse.graphiti.tutorial.TutorialDiagramType"> 	</diagramType>     </diagramTypeProvider> </extension> …
Well Then - How Do I Build a Tool ?
Well Then - How Do I Build a Tool ? packageorg.eclipse.graphiti.tutorial; … publicclassTutorialFeatureProviderextendsDefaultFeatureProvider {   publicTutorialFeatureProvider(IDiagramTypeProviderdtp) { super(dtp); 	} } … publicTutorialDiagramTypeProvider() { super(); setFeatureProvider(newTutorialFeatureProvider(this)); 	} …
Well Then - How Do I Build a Tool ?
Well Then - How Do I Build a Tool ? … publicclassTutorialAddEClassFeatureextendsAbstractAddShapeFeature {   publicTutorialAddEClassFeature(IFeatureProviderfp) { super(fp); 	}   @Override public booleancanAdd(IAddContext context) { // Check if user wants to add an EClass if (context.getNewObject() instanceofEClass) { // Check if user wants to add to a diagram if (context.getTargetContainer() instanceof Diagram) { return true; 			} 		} return false; 	}   @Override publicPictogramElement add(IAddContext context) { … 	} }
Well Then - How Do I Build a Tool ? publicPictogramElement add(IAddContext context) { EClassaddedClass = (EClass) context.getNewObject(); 	Diagram targetDiagram = (Diagram) context.getTargetContainer(); int w = context.getWidth() <= 0 ? 100 : context.getWidth(); int h = context.getHeight() <= 0 ? 50 : context.getHeight(); ContainerShapecontainerShape = PeUtil.createContainerShape(targetDiagram, true); RoundedRectangleroundedRectangle = GaUtil.createRoundedRectangle(containerShape, 5, 5); roundedRectangle.setForeground(manageColor(CLASS_FOREGROUND)); roundedRectangle.setBackground(manageColor(CLASS_BACKGROUND)); roundedRectangle.setLineWidth(2); GaUtil.setLocationAndSizeOfGraphicsAlgorithm(roundedRectangle, context.getX(), context.getY(), w, h);  	link(containerShape, addedClass); 	Shape shape = PeUtil.createShape(containerShape, false); 	Text text = GaUtil.createDefaultText(shape, addedClass.getName()); text.setForeground(manageColor(CLASS_TEXT_FOREGROUND)); text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER); text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER); text.getFont().setBold(true); GaUtil.setLocationAndSizeOfGraphicsAlgorithm(text, 0, 0, width, 20); 	shape = PeUtil.createShape(containerShape, false); Polylinepolyline = GaUtil.createPolyline(shape, newint[] { 0, 20, width, 20 }); polyline.setForeground(manageColor(CLASS_FOREGROUND)); polyline.setLineWidth(2); returncontainerShape; }
Well Then - How Do I Build a Tool ? publicclassTutorialFeatureProviderextendsDefaultFeatureProvider { … @Override public IAddFeature getAddFeature(IAddContext context) { if (context.getNewObject() instanceof EClass) { returnnew TutorialAddEClassFeature(this); 		} returnsuper.getAddFeature(context); 	} }
Graphiti – What else to Mention ?
Short Talk on Graphiti at EclipseCon 2010

More Related Content

Similar to Short Talk on Graphiti at EclipseCon 2010

JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
alexsaves
 
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 EnglishGrails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
Sven Haiges
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Degrafa Overview
Degrafa OverviewDegrafa Overview
Degrafa Overview
Bill White
 
What I Learned At Drupal Con Dc 2009
What I Learned At Drupal Con Dc 2009What I Learned At Drupal Con Dc 2009
What I Learned At Drupal Con Dc 2009
Neil Giarratana
 
JavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern ImplementationJavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern Implementation
davejohnson
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NET
goodfriday
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's How
mrdon
 
Moving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsMoving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, traps
Florian Weil
 
Google Apps Script: Accessing G Suite & other Google services with JavaScript
Google Apps Script: Accessing G Suite & other Google services with JavaScriptGoogle Apps Script: Accessing G Suite & other Google services with JavaScript
Google Apps Script: Accessing G Suite & other Google services with JavaScript
wesley chun
 
Relevance trilogy may dream be with you! (dec17)
Relevance trilogy  may dream be with you! (dec17)Relevance trilogy  may dream be with you! (dec17)
Relevance trilogy may dream be with you! (dec17)
Woonsan Ko
 
Let's Jira do the work
Let's Jira do the workLet's Jira do the work
Let's Jira do the work
Frank Ittermann
 
Building Web Hack Interfaces
Building Web Hack InterfacesBuilding Web Hack Interfaces
Building Web Hack Interfaces
Christian Heilmann
 
Spring18 Lightning Component Updates
Spring18 Lightning Component UpdatesSpring18 Lightning Component Updates
Spring18 Lightning Component Updates
Mohith Shrivastava
 
Introduction to Gradio library in python.pptx
Introduction to Gradio library in python.pptxIntroduction to Gradio library in python.pptx
Introduction to Gradio library in python.pptx
vahid67ebrahimian
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Nanddeep Nachan
 
Developing for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformDeveloping for LinkedIn's Application Platform
Developing for LinkedIn's Application Platform
Taylor Singletary
 
Microsoft and jQuery: A true love story - templating and other contributions
Microsoft and jQuery: A true love story - templating and other contributionsMicrosoft and jQuery: A true love story - templating and other contributions
Microsoft and jQuery: A true love story - templating and other contributions
jamessenior
 
MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"
Theo Rushin Jr
 

Similar to Short Talk on Graphiti at EclipseCon 2010 (20)

JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 EnglishGrails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Degrafa Overview
Degrafa OverviewDegrafa Overview
Degrafa Overview
 
What I Learned At Drupal Con Dc 2009
What I Learned At Drupal Con Dc 2009What I Learned At Drupal Con Dc 2009
What I Learned At Drupal Con Dc 2009
 
JavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern ImplementationJavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern Implementation
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NET
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's How
 
Moving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsMoving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, traps
 
Google Apps Script: Accessing G Suite & other Google services with JavaScript
Google Apps Script: Accessing G Suite & other Google services with JavaScriptGoogle Apps Script: Accessing G Suite & other Google services with JavaScript
Google Apps Script: Accessing G Suite & other Google services with JavaScript
 
Relevance trilogy may dream be with you! (dec17)
Relevance trilogy  may dream be with you! (dec17)Relevance trilogy  may dream be with you! (dec17)
Relevance trilogy may dream be with you! (dec17)
 
Let's Jira do the work
Let's Jira do the workLet's Jira do the work
Let's Jira do the work
 
Building Web Hack Interfaces
Building Web Hack InterfacesBuilding Web Hack Interfaces
Building Web Hack Interfaces
 
CS267_Graph_Lab
CS267_Graph_LabCS267_Graph_Lab
CS267_Graph_Lab
 
Spring18 Lightning Component Updates
Spring18 Lightning Component UpdatesSpring18 Lightning Component Updates
Spring18 Lightning Component Updates
 
Introduction to Gradio library in python.pptx
Introduction to Gradio library in python.pptxIntroduction to Gradio library in python.pptx
Introduction to Gradio library in python.pptx
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Developing for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformDeveloping for LinkedIn's Application Platform
Developing for LinkedIn's Application Platform
 
Microsoft and jQuery: A true love story - templating and other contributions
Microsoft and jQuery: A true love story - templating and other contributionsMicrosoft and jQuery: A true love story - templating and other contributions
Microsoft and jQuery: A true love story - templating and other contributions
 
MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"
 

Recently uploaded

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 

Recently uploaded (20)

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 

Short Talk on Graphiti at EclipseCon 2010

  • 1. GraphitiThe Graphical Tooling Infrastructure Speaking Plain Java Michael Wenz SAP AG 03/23/2010 Graphiti are: Christian Brand Jürgen Pasch Matthias Gorning Michael Wenz Tim Kaiser
  • 2. What Is Graphiti All About ? “The goal of Graphiti is to support the fast and easy creation of unified graphical tools, which can display and edit underlying domain models using a tool-defined graphical notation.”
  • 3. What Is Graphiti All About ? “The goal of Graphiti is to support the fast and easy creation of unified graphical tools, which can display and edit underlying domain models using a tool-defined graphical notation.”
  • 4. Why Should I Want to Use Graphiti ?
  • 6. What about the Diagram Type Agent ? Diagram Type Agent Feature Provider Diagram Type Provider A feature implements an operation for a domain object and defines the context in which the operation can be triggered Add Feature Create Feature Delete Feature … Specialized features for common user interactions available
  • 7. Domain Hierarchie Pictogram Elements Links Visualization Graphics Algorithms EClass Container Shape Link EAttribute Attribute Text Shape Shape Shape Shape Container Shape Which Objects Do I Deal with ? Text Text EOperation Attribute Link Link Link Link Result Shape Container Shape
  • 8. Well Then - How Do I Build a Tool ?
  • 9. Well Then - How Do I Build a Tool ?
  • 10. packageorg.eclipse.graphiti.tutorial;   importorg.eclipse.graphiti.dt.AbstractDiagramTypeProvider;   publicclassTutorialDiagramTypeProviderextendsAbstractDiagramTypeProvider {   publicTutorialDiagramTypeProvider() { super(); } } Well Then - How Do I Build a Tool ?
  • 11. Well Then - How Do I Build a Tool ?
  • 12. Well Then - How Do I Build a Tool ? … <extension point="org.eclipse.graphiti.eclipse.diagramTypes"> <diagramType id="org.eclipse.graphiti.tutorial.TutorialDiagramType„ type="tutorial„ name="Tutorial Diagram Type„ description="This is the diagram type for the Graphiti tutorial"> </diagramType> </extension> <extension point="org.eclipse.graphiti.eclipse.diagramTypeProviders"> <diagramTypeProvider id="org.eclipse.graphiti.tutorial.TutorialDiagramTypeProvider„ name="Tutorial Editor„ class="org.eclipse.graphiti.tutorial.TutorialDiagramTypeProvider„ description="This is the editor for the Graphiti tutorial"> <diagramType id="org.eclipse.graphiti.tutorial.TutorialDiagramType"> </diagramType> </diagramTypeProvider> </extension> …
  • 13. Well Then - How Do I Build a Tool ?
  • 14. Well Then - How Do I Build a Tool ? packageorg.eclipse.graphiti.tutorial; … publicclassTutorialFeatureProviderextendsDefaultFeatureProvider {   publicTutorialFeatureProvider(IDiagramTypeProviderdtp) { super(dtp); } } … publicTutorialDiagramTypeProvider() { super(); setFeatureProvider(newTutorialFeatureProvider(this)); } …
  • 15. Well Then - How Do I Build a Tool ?
  • 16. Well Then - How Do I Build a Tool ? … publicclassTutorialAddEClassFeatureextendsAbstractAddShapeFeature {   publicTutorialAddEClassFeature(IFeatureProviderfp) { super(fp); }   @Override public booleancanAdd(IAddContext context) { // Check if user wants to add an EClass if (context.getNewObject() instanceofEClass) { // Check if user wants to add to a diagram if (context.getTargetContainer() instanceof Diagram) { return true; } } return false; }   @Override publicPictogramElement add(IAddContext context) { … } }
  • 17. Well Then - How Do I Build a Tool ? publicPictogramElement add(IAddContext context) { EClassaddedClass = (EClass) context.getNewObject(); Diagram targetDiagram = (Diagram) context.getTargetContainer(); int w = context.getWidth() <= 0 ? 100 : context.getWidth(); int h = context.getHeight() <= 0 ? 50 : context.getHeight(); ContainerShapecontainerShape = PeUtil.createContainerShape(targetDiagram, true); RoundedRectangleroundedRectangle = GaUtil.createRoundedRectangle(containerShape, 5, 5); roundedRectangle.setForeground(manageColor(CLASS_FOREGROUND)); roundedRectangle.setBackground(manageColor(CLASS_BACKGROUND)); roundedRectangle.setLineWidth(2); GaUtil.setLocationAndSizeOfGraphicsAlgorithm(roundedRectangle, context.getX(), context.getY(), w, h);   link(containerShape, addedClass); Shape shape = PeUtil.createShape(containerShape, false); Text text = GaUtil.createDefaultText(shape, addedClass.getName()); text.setForeground(manageColor(CLASS_TEXT_FOREGROUND)); text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER); text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER); text.getFont().setBold(true); GaUtil.setLocationAndSizeOfGraphicsAlgorithm(text, 0, 0, width, 20); shape = PeUtil.createShape(containerShape, false); Polylinepolyline = GaUtil.createPolyline(shape, newint[] { 0, 20, width, 20 }); polyline.setForeground(manageColor(CLASS_FOREGROUND)); polyline.setLineWidth(2); returncontainerShape; }
  • 18. Well Then - How Do I Build a Tool ? publicclassTutorialFeatureProviderextendsDefaultFeatureProvider { … @Override public IAddFeature getAddFeature(IAddContext context) { if (context.getNewObject() instanceof EClass) { returnnew TutorialAddEClassFeature(this); } returnsuper.getAddFeature(context); } }
  • 19. Graphiti – What else to Mention ?