SlideShare a Scribd company logo
1 of 17
Creating well designed graphical editors
... and bringing them to the Web
Vineet Sinha                      Elias Volanakis
                                 
    Elizabeth Murnane
                                      Works for EclipseSource
     Work for Architexa               Committer on Riena and
                                        RAP
     Built visual dev tools:
                                       Worked on GEF during his
      ▪   Microsoft
      ▪                                 Masters
          IBM
      ▪   Nokia
      ▪   Accenture
                                      Anthony Hunter
                                  
      ▪   Progress/IONA
                                       Works for IBM
     Focus on solving
                                       Lead committer on GEF
      developers' problems
                                        (and GMF Runtime)
     Not modeling
     Building on GEF for 5 yrs
Creating a well designed Graphical Editor

     User Experience
     Key Concepts
     Coding Challenges



    Bringing GEF apps to the web

     Demo
     Approaches & Challenges
Diagrams are not as useful when too many

    items need to be shown. Try:
     Hiding less relevant nodes.
     Grouping nodes using visual containment or
      layout constraints.
     Thinking of ways to show nodes in a smaller
      representation.

    If users need to scroll consider overlaying or

    showing reminders of out of sight pieces.
Don’t want to force users to be manually positioning

    nodes.
     Automatic layout is good.
     But it is always good to let the user change things

    Laying out a set of nodes…

     has the problem that it often depends on the particular use-case
      and on personal preferences.
     if there is more than one good option, it might be too vague to
      implement it correctly.

    Should think about how the layout will work with

     On inserting a node
     On adding or removing a neighboring node
GEF allows developers to take an existing application

    model and create a visual representation of it.
    It consists of three components: Draw2D, Zest, and GEF.


    Draw2D provides support for layout and

    rendering.
    Zest provides support for JFace patterns

    to create quick graphical views.
    GEF provides for a MVC architecture,

    supports users interacting with the model, and provides
    workbench integration.
LightweightSystem provides link from Draw2d to SWT.


    Figures are lightweight containers

    forming a tree with preorder
    traversal for painting, i.e. last is
    shown on top with reverse for
    hit-testing.
    Layout Managers position children Figure and calculate

    the preferred sizes.
    Connections are also Figures positioned using

    ConnectionAnchors having children like ArrowHeads and
    Labels.
Viewer: foundation for displaying and editing

    your model
     Adapter on an SWT Control
     Selection Provider
    EditPart: elements inside a viewer.

    Tool: interprets user input; represents mode.

    Palette: displays available tools.

    CommandStack: stores Commands for

    undo/redo.
    EditDomain: ties everything together.

    GraphicalEditor: for building an Editor.

Source:
   “GEF
   Description”

Source: GEF Description
Stuff that we have learned over the last 5 years of GEF

    development.
    To put GEF in Context:


            quot;Final Thoughts:
        
             ...
             Very rich framework
               ▪ Lots of predefined functionality
               ▪ Do very complex things with almost no code
             ...”
              - Koen Aers, GEF Tutorial, EC08

    If you want to do something look for an example that does it and

    try to understand how.
What should be in the Model (and the Commands)

       No dependencies on the View and Controller
       Don't have references to EditParts, EditPolicies, and Figures here.
       Anything that needs to be saved.
       You might need two models
        ▪ One from before or one for an external purpose.
        ▪ i.e. A presentation model (as opposed to a business model).

    The Deleting Command can be tricky with multiple levels of

    containment and connections.
     quot;When objects (i.e. quot;nodesquot;) in a diagram are deleted, it is necessary to remove, in the
        very least, the connections between the items being deleted, including contained
        parts such as children, and any items remaining in the diagram. ... Care must be
        taken in the implementation because both ends of the connection may be deleted
        using multiple selection. To avoid deleting the connection twice, the application
        should lazily determine which connections must be deleted. Do this inside the
        execute() of the command. On undo, the connection will get restored just once. For
        an example implementation, see DeleteCommand in the Logic example.quot;
                    - GEF Trouble Shooting Guide
Try to use EditPolicies

     By default the controller is where the most of the code goes.
     EditPolicies help in separation of concerns, and allow uniform
      reuse of capabilities across different classes.
     Spend some time trying to understand what policies already
      exist and what they do.
     Already provided policies have support for
      selection, editing, connection management, etc.

    You might have more than one type of child:

     Group children into compartments.
     Have your model have a set of fake children – one each per
      compartment.
Layout

     Don’t try to create your own one, though highly constrained
      layouts are ok.
     Be careful about custom stuff – it is very hard.
     Buy or port one from another layout package.
     Implement one from an academic paper if you need to.

    Advanced Graphics:

     Antialiasing, Gradients and Shadows:
      ▪ These are possible, but each has its own complications.
      ▪ Look at the newsgroups for howto.
     Embossing, Blur, and Glow are more complicated – but
      should be doable (see Filthy Rich Clients).
Animation

     Look at the flow example.
     Code is available, but you need to hook into it at the right places.
      ▪ You will need to capture initial and final node positions and incrementally set
        the bounds of nodes as a set amount of time passes

    Coordinates

     Shapes, Connections, and Anchors always deal with absolute
      coordinates.
     Figures bounds are not absolute.
     These issues show up when doing using containment.

    Threading

     GEF/Draw2D are not thread-safe
     Do not call methods on Figures from non UI threads.
GEF Description

     http://wiki.eclipse.org/GEF_Description
     http://wiki.eclipse.org/GEF_Description2

    Red Book

     http://www.redbooks.ibm.com/redbooks/pdfs/sg246302.pdf

    GEF Articles

     http://wiki.eclipse.org/GEF_Articles

    GEF Trouble Shoting Guide

     http://wiki.eclipse.org/GEF_Troubleshooting_Guide

    ANCiT Consulting - Eclipse in Clips - GEF CBT

Conquering Gef Part 1: Effectively creating a well designed graphical editor

More Related Content

Similar to Conquering Gef Part 1: Effectively creating a well designed graphical editor

Desktop Applications with NetBeans
Desktop Applications with NetBeansDesktop Applications with NetBeans
Desktop Applications with NetBeansHuu Bang Le Phan
 
Designing Great User Interfaces for Composite Applications
Designing Great User Interfaces for Composite ApplicationsDesigning Great User Interfaces for Composite Applications
Designing Great User Interfaces for Composite Applicationsdominion
 
Smart Client Development
Smart Client DevelopmentSmart Client Development
Smart Client DevelopmentTamir Khason
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Libraryjeresig
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistMark Fayngersh
 
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, trapsFlorian Weil
 
Prototyping Adobe AIR Applications with Fireworks CS4
Prototyping Adobe AIR Applications with Fireworks CS4Prototyping Adobe AIR Applications with Fireworks CS4
Prototyping Adobe AIR Applications with Fireworks CS4Juan Sanchez
 
AEM Best Practices for Component Development
AEM Best Practices for Component DevelopmentAEM Best Practices for Component Development
AEM Best Practices for Component DevelopmentGabriel Walt
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5SSW
 
Lavacon 2014 responsive design in your hat
Lavacon 2014   responsive design in your hatLavacon 2014   responsive design in your hat
Lavacon 2014 responsive design in your hatNeil Perlin
 
Are Agile Projects Doomed To Halfbaked Design
Are Agile Projects Doomed To Halfbaked DesignAre Agile Projects Doomed To Halfbaked Design
Are Agile Projects Doomed To Halfbaked Designeraz
 
Javascript Dependency Management
Javascript Dependency ManagementJavascript Dependency Management
Javascript Dependency ManagementSean Duncan
 
Hacking the Mid-End (Great Lakes Ruby Bash Edition)
Hacking the Mid-End (Great Lakes Ruby Bash Edition)Hacking the Mid-End (Great Lakes Ruby Bash Edition)
Hacking the Mid-End (Great Lakes Ruby Bash Edition)Michael Bleigh
 
Developing SPI applications using Grails and AngularJS
Developing SPI applications using Grails and AngularJSDeveloping SPI applications using Grails and AngularJS
Developing SPI applications using Grails and AngularJSAlvaro Sanchez-Mariscal
 
Why you should consider a microframework for your next web project
Why you should consider a microframework for your next web projectWhy you should consider a microframework for your next web project
Why you should consider a microframework for your next web projectJoaquín Muñoz M.
 
Nagios Conference 2012 - Nathan Vonnahme - Monitoring the User Experience
Nagios Conference 2012 - Nathan Vonnahme - Monitoring the User ExperienceNagios Conference 2012 - Nathan Vonnahme - Monitoring the User Experience
Nagios Conference 2012 - Nathan Vonnahme - Monitoring the User ExperienceNagios
 

Similar to Conquering Gef Part 1: Effectively creating a well designed graphical editor (20)

PHP & MVC
PHP & MVCPHP & MVC
PHP & MVC
 
Ilog Ria2
Ilog Ria2Ilog Ria2
Ilog Ria2
 
Desktop Applications with NetBeans
Desktop Applications with NetBeansDesktop Applications with NetBeans
Desktop Applications with NetBeans
 
Designing Great User Interfaces for Composite Applications
Designing Great User Interfaces for Composite ApplicationsDesigning Great User Interfaces for Composite Applications
Designing Great User Interfaces for Composite Applications
 
Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09
 
Smart Client Development
Smart Client DevelopmentSmart Client Development
Smart Client Development
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
 
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
 
Prototyping Adobe AIR Applications with Fireworks CS4
Prototyping Adobe AIR Applications with Fireworks CS4Prototyping Adobe AIR Applications with Fireworks CS4
Prototyping Adobe AIR Applications with Fireworks CS4
 
AEM Best Practices for Component Development
AEM Best Practices for Component DevelopmentAEM Best Practices for Component Development
AEM Best Practices for Component Development
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 
Lavacon 2014 responsive design in your hat
Lavacon 2014   responsive design in your hatLavacon 2014   responsive design in your hat
Lavacon 2014 responsive design in your hat
 
Are Agile Projects Doomed To Halfbaked Design
Are Agile Projects Doomed To Halfbaked DesignAre Agile Projects Doomed To Halfbaked Design
Are Agile Projects Doomed To Halfbaked Design
 
Javascript Dependency Management
Javascript Dependency ManagementJavascript Dependency Management
Javascript Dependency Management
 
Hacking the Mid-End (Great Lakes Ruby Bash Edition)
Hacking the Mid-End (Great Lakes Ruby Bash Edition)Hacking the Mid-End (Great Lakes Ruby Bash Edition)
Hacking the Mid-End (Great Lakes Ruby Bash Edition)
 
Developing SPI applications using Grails and AngularJS
Developing SPI applications using Grails and AngularJSDeveloping SPI applications using Grails and AngularJS
Developing SPI applications using Grails and AngularJS
 
Why you should consider a microframework for your next web project
Why you should consider a microframework for your next web projectWhy you should consider a microframework for your next web project
Why you should consider a microframework for your next web project
 
Nagios Conference 2012 - Nathan Vonnahme - Monitoring the User Experience
Nagios Conference 2012 - Nathan Vonnahme - Monitoring the User ExperienceNagios Conference 2012 - Nathan Vonnahme - Monitoring the User Experience
Nagios Conference 2012 - Nathan Vonnahme - Monitoring the User Experience
 
Symfony for non-techies
Symfony for non-techiesSymfony for non-techies
Symfony for non-techies
 

Recently uploaded

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

Conquering Gef Part 1: Effectively creating a well designed graphical editor

  • 1. Creating well designed graphical editors ... and bringing them to the Web
  • 2. Vineet Sinha Elias Volanakis   Elizabeth Murnane   Works for EclipseSource  Work for Architexa  Committer on Riena and RAP  Built visual dev tools:  Worked on GEF during his ▪ Microsoft ▪ Masters IBM ▪ Nokia ▪ Accenture Anthony Hunter  ▪ Progress/IONA  Works for IBM  Focus on solving  Lead committer on GEF developers' problems (and GMF Runtime)  Not modeling  Building on GEF for 5 yrs
  • 3. Creating a well designed Graphical Editor   User Experience  Key Concepts  Coding Challenges Bringing GEF apps to the web   Demo  Approaches & Challenges
  • 4.
  • 5. Diagrams are not as useful when too many  items need to be shown. Try:  Hiding less relevant nodes.  Grouping nodes using visual containment or layout constraints.  Thinking of ways to show nodes in a smaller representation. If users need to scroll consider overlaying or  showing reminders of out of sight pieces.
  • 6. Don’t want to force users to be manually positioning  nodes.  Automatic layout is good.  But it is always good to let the user change things Laying out a set of nodes…   has the problem that it often depends on the particular use-case and on personal preferences.  if there is more than one good option, it might be too vague to implement it correctly. Should think about how the layout will work with   On inserting a node  On adding or removing a neighboring node
  • 7. GEF allows developers to take an existing application  model and create a visual representation of it. It consists of three components: Draw2D, Zest, and GEF.  Draw2D provides support for layout and  rendering. Zest provides support for JFace patterns  to create quick graphical views. GEF provides for a MVC architecture,  supports users interacting with the model, and provides workbench integration.
  • 8. LightweightSystem provides link from Draw2d to SWT.  Figures are lightweight containers  forming a tree with preorder traversal for painting, i.e. last is shown on top with reverse for hit-testing. Layout Managers position children Figure and calculate  the preferred sizes. Connections are also Figures positioned using  ConnectionAnchors having children like ArrowHeads and Labels.
  • 9. Viewer: foundation for displaying and editing  your model  Adapter on an SWT Control  Selection Provider EditPart: elements inside a viewer.  Tool: interprets user input; represents mode.  Palette: displays available tools.  CommandStack: stores Commands for  undo/redo. EditDomain: ties everything together.  GraphicalEditor: for building an Editor. 
  • 10. Source: “GEF Description” Source: GEF Description
  • 11. Stuff that we have learned over the last 5 years of GEF  development. To put GEF in Context:  quot;Final Thoughts:   ...  Very rich framework ▪ Lots of predefined functionality ▪ Do very complex things with almost no code  ...” - Koen Aers, GEF Tutorial, EC08 If you want to do something look for an example that does it and  try to understand how.
  • 12. What should be in the Model (and the Commands)   No dependencies on the View and Controller  Don't have references to EditParts, EditPolicies, and Figures here.  Anything that needs to be saved.  You might need two models ▪ One from before or one for an external purpose. ▪ i.e. A presentation model (as opposed to a business model). The Deleting Command can be tricky with multiple levels of  containment and connections.  quot;When objects (i.e. quot;nodesquot;) in a diagram are deleted, it is necessary to remove, in the very least, the connections between the items being deleted, including contained parts such as children, and any items remaining in the diagram. ... Care must be taken in the implementation because both ends of the connection may be deleted using multiple selection. To avoid deleting the connection twice, the application should lazily determine which connections must be deleted. Do this inside the execute() of the command. On undo, the connection will get restored just once. For an example implementation, see DeleteCommand in the Logic example.quot; - GEF Trouble Shooting Guide
  • 13. Try to use EditPolicies   By default the controller is where the most of the code goes.  EditPolicies help in separation of concerns, and allow uniform reuse of capabilities across different classes.  Spend some time trying to understand what policies already exist and what they do.  Already provided policies have support for selection, editing, connection management, etc. You might have more than one type of child:   Group children into compartments.  Have your model have a set of fake children – one each per compartment.
  • 14. Layout   Don’t try to create your own one, though highly constrained layouts are ok.  Be careful about custom stuff – it is very hard.  Buy or port one from another layout package.  Implement one from an academic paper if you need to. Advanced Graphics:   Antialiasing, Gradients and Shadows: ▪ These are possible, but each has its own complications. ▪ Look at the newsgroups for howto.  Embossing, Blur, and Glow are more complicated – but should be doable (see Filthy Rich Clients).
  • 15. Animation   Look at the flow example.  Code is available, but you need to hook into it at the right places. ▪ You will need to capture initial and final node positions and incrementally set the bounds of nodes as a set amount of time passes Coordinates   Shapes, Connections, and Anchors always deal with absolute coordinates.  Figures bounds are not absolute.  These issues show up when doing using containment. Threading   GEF/Draw2D are not thread-safe  Do not call methods on Figures from non UI threads.
  • 16. GEF Description   http://wiki.eclipse.org/GEF_Description  http://wiki.eclipse.org/GEF_Description2 Red Book   http://www.redbooks.ibm.com/redbooks/pdfs/sg246302.pdf GEF Articles   http://wiki.eclipse.org/GEF_Articles GEF Trouble Shoting Guide   http://wiki.eclipse.org/GEF_Troubleshooting_Guide ANCiT Consulting - Eclipse in Clips - GEF CBT 