SlideShare a Scribd company logo
Brief Introduction to
Eclipse GEF (Part I)
Yongqiang
Outlines
•   What’s GEF?
•   Basic Concepts in GEF
•   Brief Introduction to Draw2d
•   Dive into a Real Case – How to draw a wafer and dies on it?
•   Summary
•   References
What’s GEF?
• Stands for Graphical Editing Framework
• A library to ease the task of building a graphical editor, in
  Eclipse




• Model – View – Controller Architecture
Samples
Basic Concepts
                    Interaction Layer
                    Model-to-View mapping
                    Workbench Integration
                    Rendering
                    Layout
                    Scaling

                    Native (SWT) Layer
GEF Components & Dependencies




                ui.views        GEF


           RCP
                     SWT   Draw2D

        Platform Runtime
Model                   View                  Controller

• Hold all data you   • Not hold any        • Make the link
  want to be edited     important data        between M and V
  by the users        • Know nothing        • In GEF, controllers
• Know nothing          about the model       are subclasses of
  about the view                              EditPart.
                      • Must be
• Must implement        completely dumb
  some kind of
  notification        • In GEF, view is
  mechanism             built with Draw2d
                        Figures
• Model Notification Mechanism




• Dumb View
• MVC Working Together
Brief Introduction to Draw2d
• a lightweight system of graphical components
• Its purpose is only to show things on the screen, not to hold
  and manipulate any data.
• Figures
• Painting of Figures




• Bounds of Figures
• Interesting features
  •   Layout Managers
  •   Hit-testing
  •   Events
  •   Predefined types of Figures
  •   Predefined types of Borders
  •   Connections
  •   Cursors and tooltips
  •   Layers
Dive into a Real Case –
How to draw a wafer and dies on it?




                                        Q: What is in
                                        your mind now?
                                        How to solve
                                        this problem?


                                      Die

                                Wafer
Maybe…
• We need to write a model to represent wafer, die and their
  relations.
• We need to write the view to represent them on screen to
  users.
• And also create subclasses of EditPart (controllers).
Model classes? Emm… seems easy!




                                  Just my own implementation.
                                  If you have better idea, let me
                                  know! 


           Q: What’s the relationship
           between Wafer and Die?
View classes (Let’s simplify it)
• A wafer is a round plate.
• A die is a square.
                         Ellipse                        RectangleFigure




                         If so, I believe there must be predefined figures
                         in draw2d to represent ellipse and rectangle!
The next is the subclasses of EditPart!
• Actually, we are going to use AbstractGraphicalEditPart (an
  abstract class which implements the interface of EditPart).
  a                 class org.eclipse.gef
                                      g

                                «abstract»
                         AbstractGraphicalEditPart

                     +    createEditPolicies() : void
                     +    createFigure() : IFigure




                          Q: What is createFigure() used
                          for?
                          Q: How to derive it and create the link
                          between model and view?
                          Q: How many subclasses do we need? 1 or
                          2?
We need 2! One for Wafer, the other is for Die.




                                      Cover this line first!

Return an Ellipse




                                Tell GEF what is my model children
Return an DieRectangleFigure, an
subclass of RectangleFigure
All classes are ready! How to integrate them into
Eclipse?
• In Eclipse, editing action happens in some Editors!
• We call such classes as EditorParts.
• Graphical editing action also happens there!
  G

      class org.eclipse.gef.editpart


                                                          EditorPart




                                                       GraphicalEditor

                                       +    setEditPartFactory(EditPartFactory) : void
                                       +    setRootEditPart(RootEditPart) : void




                                                                                            GraphicalViewer

                                                                                  +      setContents(Object) : void



         GraphicalEditorWithFlyoutPalette          GraphicalEditorWithPalette
Oh, many new classes!  See this sample




Palette   GraphicalEditor    GraphicalViewer
Data Flow                           Wait! the parameter is Object!
                                    How does GEF know it is a wafer object
Wafer Data                          and create WaferPart?




        GraphicalEditor




                      GraphicalViewer


                                                    Wafer View
                                    WaferPart
                                                     Die View


                                                DiePart
Let’s introduce EditPartFactory!




 EditoPartFactory will tell GEF the relationship between model classes
 and EditPart classes.
See the implementation…
Let’s create the Eclipse RCP App…
• Omit N words…
• Run it…

 Why are all dies
there?
Remember this feature?
So the covered line is…
Re-run the app…
Summary
• You should know…
  •   The basic concepts of GEF, draw2D and MVC archiecture
  •   How to write model, view and controller
  •   What GraphicalEditor and GraphicalViewer are.
  •   How to use EditorPartFactory
  •   How to use LayoutManager
• Next, in Part II, I will cover…
  •   how to add EditPolicy
  •   how to do notification?
  •   how to use EditDomain?
  •   How to add Tool and Commands?
  •   …
References
• GEF Main Page (http://www.eclipse.org/gef/)
• Good GEF tutorial (http://wiki.eclipse.org/GEF_Description,
  http://wiki.eclipse.org/GEF_Description2)
• Good Chinese GEF tutorial (
  http://liugang594.iteye.com/blog/152084,
  http://liugang594.iteye.com/blog/152086,
  http://liugang594.iteye.com/blog/152087)
Eclipse GEF (Part I)

More Related Content

Viewers also liked

Herramientas de sistema 160607010638
Herramientas de sistema 160607010638Herramientas de sistema 160607010638
Herramientas de sistema 160607010638
ricardo721
 
Ambiental SENA
Ambiental SENAAmbiental SENA
Ambiental SENA
garciabraian26
 
Stratégie de la_bad_pour_la_période_2013-2022_-_au_centre_de_la_transformatio...
Stratégie de la_bad_pour_la_période_2013-2022_-_au_centre_de_la_transformatio...Stratégie de la_bad_pour_la_période_2013-2022_-_au_centre_de_la_transformatio...
Stratégie de la_bad_pour_la_période_2013-2022_-_au_centre_de_la_transformatio...
Flore DIBI
 
Opera vpn
Opera vpnOpera vpn
Opera vpn
pinarsgp
 
The 9 Tallest Skyscrapers Being Completed in 2016
The 9 Tallest Skyscrapers Being Completed in 2016The 9 Tallest Skyscrapers Being Completed in 2016
The 9 Tallest Skyscrapers Being Completed in 2016
Kenny Slaught
 
Final Portfolio without Resume in sheets
Final Portfolio without Resume in sheetsFinal Portfolio without Resume in sheets
Final Portfolio without Resume in sheetsJacqueline Reese
 
【J-SHIS】地震の発生確率と地震動の超過確率
【J-SHIS】地震の発生確率と地震動の超過確率【J-SHIS】地震の発生確率と地震動の超過確率
【J-SHIS】地震の発生確率と地震動の超過確率
NIED
 
گزارش کسب و کارهای اینترنتی ایران
گزارش کسب و کارهای اینترنتی ایرانگزارش کسب و کارهای اینترنتی ایران
گزارش کسب و کارهای اینترنتی ایران
E-Commerce Monitor (ECM)
 
Array
ArrayArray
BDI- The Beginning (Big data training in Coimbatore)
BDI- The Beginning (Big data training in Coimbatore)BDI- The Beginning (Big data training in Coimbatore)
BDI- The Beginning (Big data training in Coimbatore)
Ashok Rangaswamy
 
Mediosdetransmisin 160726172933
Mediosdetransmisin 160726172933Mediosdetransmisin 160726172933
Mediosdetransmisin 160726172933
David Felipe Duque Arce
 
Topologiasderedbryan 160816131256
Topologiasderedbryan 160816131256Topologiasderedbryan 160816131256
Topologiasderedbryan 160816131256
David Felipe Duque Arce
 

Viewers also liked (12)

Herramientas de sistema 160607010638
Herramientas de sistema 160607010638Herramientas de sistema 160607010638
Herramientas de sistema 160607010638
 
Ambiental SENA
Ambiental SENAAmbiental SENA
Ambiental SENA
 
Stratégie de la_bad_pour_la_période_2013-2022_-_au_centre_de_la_transformatio...
Stratégie de la_bad_pour_la_période_2013-2022_-_au_centre_de_la_transformatio...Stratégie de la_bad_pour_la_période_2013-2022_-_au_centre_de_la_transformatio...
Stratégie de la_bad_pour_la_période_2013-2022_-_au_centre_de_la_transformatio...
 
Opera vpn
Opera vpnOpera vpn
Opera vpn
 
The 9 Tallest Skyscrapers Being Completed in 2016
The 9 Tallest Skyscrapers Being Completed in 2016The 9 Tallest Skyscrapers Being Completed in 2016
The 9 Tallest Skyscrapers Being Completed in 2016
 
Final Portfolio without Resume in sheets
Final Portfolio without Resume in sheetsFinal Portfolio without Resume in sheets
Final Portfolio without Resume in sheets
 
【J-SHIS】地震の発生確率と地震動の超過確率
【J-SHIS】地震の発生確率と地震動の超過確率【J-SHIS】地震の発生確率と地震動の超過確率
【J-SHIS】地震の発生確率と地震動の超過確率
 
گزارش کسب و کارهای اینترنتی ایران
گزارش کسب و کارهای اینترنتی ایرانگزارش کسب و کارهای اینترنتی ایران
گزارش کسب و کارهای اینترنتی ایران
 
Array
ArrayArray
Array
 
BDI- The Beginning (Big data training in Coimbatore)
BDI- The Beginning (Big data training in Coimbatore)BDI- The Beginning (Big data training in Coimbatore)
BDI- The Beginning (Big data training in Coimbatore)
 
Mediosdetransmisin 160726172933
Mediosdetransmisin 160726172933Mediosdetransmisin 160726172933
Mediosdetransmisin 160726172933
 
Topologiasderedbryan 160816131256
Topologiasderedbryan 160816131256Topologiasderedbryan 160816131256
Topologiasderedbryan 160816131256
 

Similar to Eclipse GEF (Part I)

Gef tutorial 2005
Gef tutorial 2005Gef tutorial 2005
Gef tutorial 2005Ryan Wang
 
OOP, API Design and MVP
OOP, API Design and MVPOOP, API Design and MVP
OOP, API Design and MVP
Harshith Keni
 
Shader Programming With Unity
Shader Programming With UnityShader Programming With Unity
Shader Programming With Unity
Mindstorm Studios
 
JavaFX in Action Part I
JavaFX in Action Part IJavaFX in Action Part I
JavaFX in Action Part I
Mohammad Hossein Rimaz
 
jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture
Jiby John
 
Conquering Gef Part 1: Effectively creating a well designed graphical editor
Conquering Gef Part 1: Effectively creating a well designed graphical editorConquering Gef Part 1: Effectively creating a well designed graphical editor
Conquering Gef Part 1: Effectively creating a well designed graphical editor
Vineet Sinha
 
Re-architecting visualisations in Java Swing
Re-architecting visualisations in Java SwingRe-architecting visualisations in Java Swing
Re-architecting visualisations in Java Swing
martinjgraham
 
Installing Games Sucks, Learn WebGL
Installing Games Sucks, Learn WebGLInstalling Games Sucks, Learn WebGL
Installing Games Sucks, Learn WebGL
Corey Clark, Ph.D.
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
ICS
 
Professional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsProfessional JavaScript: AntiPatterns
Professional JavaScript: AntiPatterns
Mike Wilcox
 
CeedMath & CeedGL, Let's talk 3D...
CeedMath & CeedGL, Let's talk 3D...CeedMath & CeedGL, Let's talk 3D...
CeedMath & CeedGL, Let's talk 3D...
rsebbe
 
GEF - Past, Present, and Future
GEF - Past, Present, and FutureGEF - Past, Present, and Future
GEF - Past, Present, and Future
Alexander Nyßen
 
Svcc Java2D And Groovy
Svcc Java2D And GroovySvcc Java2D And Groovy
Svcc Java2D And Groovy
Andres Almiray
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updatesVinay H G
 
GMF : Create your graphical DSL - EclipseCon 11
GMF : Create your graphical DSL - EclipseCon 11GMF : Create your graphical DSL - EclipseCon 11
GMF : Create your graphical DSL - EclipseCon 11Chauvin Mariot
 
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
Chauvin Mariot
 
Design Patterns Illustrated
Design Patterns IllustratedDesign Patterns Illustrated
Design Patterns Illustrated
Herman Peeren
 
elm-d3 @ NYC D3.js Meetup (30 June, 2014)
elm-d3 @ NYC D3.js Meetup (30 June, 2014)elm-d3 @ NYC D3.js Meetup (30 June, 2014)
elm-d3 @ NYC D3.js Meetup (30 June, 2014)Spiros
 
OpenGL ES on iOS
OpenGL ES on iOSOpenGL ES on iOS
OpenGL ES on iOS
EungShik (Henry) Kim
 

Similar to Eclipse GEF (Part I) (20)

Gef tutorial 2005
Gef tutorial 2005Gef tutorial 2005
Gef tutorial 2005
 
Solid OOPS
Solid OOPSSolid OOPS
Solid OOPS
 
OOP, API Design and MVP
OOP, API Design and MVPOOP, API Design and MVP
OOP, API Design and MVP
 
Shader Programming With Unity
Shader Programming With UnityShader Programming With Unity
Shader Programming With Unity
 
JavaFX in Action Part I
JavaFX in Action Part IJavaFX in Action Part I
JavaFX in Action Part I
 
jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture jQquerysummit - Large-scale JavaScript Application Architecture
jQquerysummit - Large-scale JavaScript Application Architecture
 
Conquering Gef Part 1: Effectively creating a well designed graphical editor
Conquering Gef Part 1: Effectively creating a well designed graphical editorConquering Gef Part 1: Effectively creating a well designed graphical editor
Conquering Gef Part 1: Effectively creating a well designed graphical editor
 
Re-architecting visualisations in Java Swing
Re-architecting visualisations in Java SwingRe-architecting visualisations in Java Swing
Re-architecting visualisations in Java Swing
 
Installing Games Sucks, Learn WebGL
Installing Games Sucks, Learn WebGLInstalling Games Sucks, Learn WebGL
Installing Games Sucks, Learn WebGL
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
 
Professional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsProfessional JavaScript: AntiPatterns
Professional JavaScript: AntiPatterns
 
CeedMath & CeedGL, Let's talk 3D...
CeedMath & CeedGL, Let's talk 3D...CeedMath & CeedGL, Let's talk 3D...
CeedMath & CeedGL, Let's talk 3D...
 
GEF - Past, Present, and Future
GEF - Past, Present, and FutureGEF - Past, Present, and Future
GEF - Past, Present, and Future
 
Svcc Java2D And Groovy
Svcc Java2D And GroovySvcc Java2D And Groovy
Svcc Java2D And Groovy
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
 
GMF : Create your graphical DSL - EclipseCon 11
GMF : Create your graphical DSL - EclipseCon 11GMF : Create your graphical DSL - EclipseCon 11
GMF : Create your graphical DSL - EclipseCon 11
 
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
 
Design Patterns Illustrated
Design Patterns IllustratedDesign Patterns Illustrated
Design Patterns Illustrated
 
elm-d3 @ NYC D3.js Meetup (30 June, 2014)
elm-d3 @ NYC D3.js Meetup (30 June, 2014)elm-d3 @ NYC D3.js Meetup (30 June, 2014)
elm-d3 @ NYC D3.js Meetup (30 June, 2014)
 
OpenGL ES on iOS
OpenGL ES on iOSOpenGL ES on iOS
OpenGL ES on iOS
 

More from Yongqiang Li

Why Kotlin?
Why Kotlin?Why Kotlin?
Why Kotlin?
Yongqiang Li
 
How to Recognize Henry's Face
How to Recognize Henry's FaceHow to Recognize Henry's Face
How to Recognize Henry's Face
Yongqiang Li
 
Introduction to Boost regex
Introduction to Boost regexIntroduction to Boost regex
Introduction to Boost regex
Yongqiang Li
 
Let's talk about java class loader
Let's talk about java class loaderLet's talk about java class loader
Let's talk about java class loader
Yongqiang Li
 
Brief introduction to domain-driven design
Brief introduction to domain-driven designBrief introduction to domain-driven design
Brief introduction to domain-driven designYongqiang Li
 
Let's talk about java class file
Let's talk about java class fileLet's talk about java class file
Let's talk about java class file
Yongqiang Li
 
Garbage Collection of Java VM
Garbage Collection of Java VMGarbage Collection of Java VM
Garbage Collection of Java VM
Yongqiang Li
 
Let's talk about jni
Let's talk about jniLet's talk about jni
Let's talk about jni
Yongqiang Li
 

More from Yongqiang Li (8)

Why Kotlin?
Why Kotlin?Why Kotlin?
Why Kotlin?
 
How to Recognize Henry's Face
How to Recognize Henry's FaceHow to Recognize Henry's Face
How to Recognize Henry's Face
 
Introduction to Boost regex
Introduction to Boost regexIntroduction to Boost regex
Introduction to Boost regex
 
Let's talk about java class loader
Let's talk about java class loaderLet's talk about java class loader
Let's talk about java class loader
 
Brief introduction to domain-driven design
Brief introduction to domain-driven designBrief introduction to domain-driven design
Brief introduction to domain-driven design
 
Let's talk about java class file
Let's talk about java class fileLet's talk about java class file
Let's talk about java class file
 
Garbage Collection of Java VM
Garbage Collection of Java VMGarbage Collection of Java VM
Garbage Collection of Java VM
 
Let's talk about jni
Let's talk about jniLet's talk about jni
Let's talk about jni
 

Recently uploaded

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
 
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
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
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
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
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
 
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
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
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
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 

Recently uploaded (20)

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
 
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
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
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
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
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
 
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?
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
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
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 

Eclipse GEF (Part I)

  • 1. Brief Introduction to Eclipse GEF (Part I) Yongqiang
  • 2. Outlines • What’s GEF? • Basic Concepts in GEF • Brief Introduction to Draw2d • Dive into a Real Case – How to draw a wafer and dies on it? • Summary • References
  • 3. What’s GEF? • Stands for Graphical Editing Framework • A library to ease the task of building a graphical editor, in Eclipse • Model – View – Controller Architecture
  • 5.
  • 6. Basic Concepts  Interaction Layer  Model-to-View mapping  Workbench Integration  Rendering  Layout  Scaling  Native (SWT) Layer
  • 7. GEF Components & Dependencies ui.views GEF RCP SWT Draw2D Platform Runtime
  • 8. Model View Controller • Hold all data you • Not hold any • Make the link want to be edited important data between M and V by the users • Know nothing • In GEF, controllers • Know nothing about the model are subclasses of about the view EditPart. • Must be • Must implement completely dumb some kind of notification • In GEF, view is mechanism built with Draw2d Figures
  • 9. • Model Notification Mechanism • Dumb View
  • 10. • MVC Working Together
  • 11. Brief Introduction to Draw2d • a lightweight system of graphical components • Its purpose is only to show things on the screen, not to hold and manipulate any data. • Figures
  • 12. • Painting of Figures • Bounds of Figures
  • 13. • Interesting features • Layout Managers • Hit-testing • Events • Predefined types of Figures • Predefined types of Borders • Connections • Cursors and tooltips • Layers
  • 14. Dive into a Real Case – How to draw a wafer and dies on it? Q: What is in your mind now? How to solve this problem? Die Wafer
  • 15. Maybe… • We need to write a model to represent wafer, die and their relations. • We need to write the view to represent them on screen to users. • And also create subclasses of EditPart (controllers).
  • 16. Model classes? Emm… seems easy! Just my own implementation. If you have better idea, let me know!  Q: What’s the relationship between Wafer and Die?
  • 17. View classes (Let’s simplify it) • A wafer is a round plate. • A die is a square. Ellipse RectangleFigure If so, I believe there must be predefined figures in draw2d to represent ellipse and rectangle!
  • 18. The next is the subclasses of EditPart! • Actually, we are going to use AbstractGraphicalEditPart (an abstract class which implements the interface of EditPart). a class org.eclipse.gef g «abstract» AbstractGraphicalEditPart + createEditPolicies() : void + createFigure() : IFigure Q: What is createFigure() used for? Q: How to derive it and create the link between model and view? Q: How many subclasses do we need? 1 or 2?
  • 19. We need 2! One for Wafer, the other is for Die. Cover this line first! Return an Ellipse Tell GEF what is my model children
  • 20. Return an DieRectangleFigure, an subclass of RectangleFigure
  • 21. All classes are ready! How to integrate them into Eclipse? • In Eclipse, editing action happens in some Editors! • We call such classes as EditorParts. • Graphical editing action also happens there! G class org.eclipse.gef.editpart EditorPart GraphicalEditor + setEditPartFactory(EditPartFactory) : void + setRootEditPart(RootEditPart) : void GraphicalViewer + setContents(Object) : void GraphicalEditorWithFlyoutPalette GraphicalEditorWithPalette
  • 22. Oh, many new classes!  See this sample Palette GraphicalEditor GraphicalViewer
  • 23. Data Flow Wait! the parameter is Object! How does GEF know it is a wafer object Wafer Data and create WaferPart? GraphicalEditor GraphicalViewer Wafer View WaferPart Die View DiePart
  • 24. Let’s introduce EditPartFactory! EditoPartFactory will tell GEF the relationship between model classes and EditPart classes.
  • 26. Let’s create the Eclipse RCP App… • Omit N words… • Run it…  Why are all dies there?
  • 28.
  • 29. So the covered line is…
  • 31. Summary • You should know… • The basic concepts of GEF, draw2D and MVC archiecture • How to write model, view and controller • What GraphicalEditor and GraphicalViewer are. • How to use EditorPartFactory • How to use LayoutManager • Next, in Part II, I will cover… • how to add EditPolicy • how to do notification? • how to use EditDomain? • How to add Tool and Commands? • …
  • 32. References • GEF Main Page (http://www.eclipse.org/gef/) • Good GEF tutorial (http://wiki.eclipse.org/GEF_Description, http://wiki.eclipse.org/GEF_Description2) • Good Chinese GEF tutorial ( http://liugang594.iteye.com/blog/152084, http://liugang594.iteye.com/blog/152086, http://liugang594.iteye.com/blog/152087)