SlideShare une entreprise Scribd logo
1  sur  22
Creating Modeler using

Graphiti


Manikantan Subramanyam
SAP Labs India
Agenda for this session:

           Who Am I?
           Introduction to Graphiti
           My Business Scenario/data
           Demo
           Short Discussion on
            Architecture
           Code snippets
           Link to useful resources
           Our Modeling Tools




Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
Some buzzzzzz words:

           EMF: Eclipse Modeling
            Framework
           Domain Model: Your business
            data as Java /EMF Objects
           Pictogram Model: Graphiti’s
            data model
           Pictorial Elements: UI Shapes
            created by Graphiti




Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
What Is Graphiti All About ?
“The goal                                                                                      easy
creation                                                                                      and edit
underlying
graphical




             Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
Why Would I Want to Use Graphiti ?




      Copyright © 2011 SAP AG, Made available under the Eclipse Public License v
My Business Data
     (Domain data)


                                          Club



ClubInfo                           PlayerInfo                                         CouncilInfo



     Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
Example of My Data:

Club: RCB
ClubInfo: clubName: rcb
PlayerInfo: playerName: Daniel Vettori
CouncilInfo: councilName: BCCI


Club: Mumbai Indians
ClubInfo: clubName: mi
PlayerInfo: playerName: The GOD 
CouncilInfo: councilName: BCCI


Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
Demo




Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
Sequence Flow…

   Prepare
Business Data
                                              Define
                                           ImageProvider


       Define
DiagramTypeProvider                               Define
                                           ToolBehaviorProvider




                                                Define
                                           FeatureProvider



       Draw                                FeatureProvider.add()
Pictorial Elements




            Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
Prepare Business Data
(Domain data)
Club RCB = createNewClub(factory, "RCB", "Daniel Vettori");
Club MI = createNewClub(factory, "MI", "Sachin Tendulkar");

private Club createNewClub(MyIPLFactory factory, String
clubName, String playerName) {

                Club newClub = factory.createClub();

                ClubInfo clubInfo = factory.createClubInfo();
                clubInfo.setClubName(clubName);

            PlayerInfo playerInfo =
factory.createPlayerInfo();
            playerInfo.setPlayerName(playerName);

                Council council = factory.createCouncil();
                council.setCouncilName("BCCI");

                newClub.setClubInfo(clubInfo);
                newClub.setPlayerInfo(playerInfo);
                newClub.setCouncilInfo(council);

                return newClub;
        }




Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
How Does Graphiti Work ?




      Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
What about the Diagram Type Agent ?




                                                                           Custom
                                                                           Features




      Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
Graphiti’s Extesntion
Points…




Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
ImageProvider..
public class MyDiagramImageProvider extends
AbstractImageProvider implements
       IImageProvider {

    public MyDiagramImageProvider() {
    }

    @Override
    protected void addAvailableImages() {
       addImageFilePath("rcb", "icons/rcb.jpg");
       addImageFilePath("mi", "icons/mi.jpg");
       addImageFilePath("rd", "icons/rd.jpg");
       addImageFilePath("sd", "icons/sd.jpg");
    }
}




          Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
ToolBehaviorProvider..
public class ToolBehaviorProvider extends CommonToolBehaviorProvider
{

    public ToolBehaviorProvider(IDiagramTypeProvider
diagramTypeProvider) {
         super(diagramTypeProvider);
    }

      // Important Methods of CommonToolBehaviorProvider that can be
overridden
    getContextButtonPad();
    getContextMenu();
    getPalette();
    getToolTip();
}




            Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
DiagramTypeProvider..
public class MyDiagramTypeProvider extends AbstractDiagramTypeProvider
          implements IDiagramTypeProvider {

     private IToolBehaviorProvider[] toolBehaviorProviders;

     public MyDiagramTypeProvider() {
        super();
        setFeatureProvider(new MyDiagramFeatureProvider(this));
     }

     @Override
     public IToolBehaviorProvider[] getAvailableToolBehaviorProviders() {
          if (this.toolBehaviorProviders == null) {
               this.toolBehaviorProviders = new IToolBehaviorProvider[] { new
ToolBehaviorProvider(this) };
          }
          return this.toolBehaviorProviders;
     }
}




               Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
FeatureProvider..
public class MyDiagramFeatureProvider extends DefaultFeatureProviderWithPatterns
{
     ICustomFeature[] customFeatures = null;
     public MyDiagramFeatureProvider(IDiagramTypeProvider dtp) {
          super(dtp);
     }
     @Override
     public IAddFeature getAddFeature(IAddContext context) {

          if (context.getNewObject() instanceof ClubInfo)
               return new AddClubInfoFeature(this);

          else if (context.getNewObject() instanceof PlayerInfo)
               return new AddPlayerInfoFeature(this);

          else if (context.getNewObject() instanceof Council)
               return new AddBCCIFeature(this);

          return super.getAddFeature(context);
     }
// Important Methods of DefaultFeatureProviderWithPatterns that can be
overridden
     getCustomFeatures();
     getMoveShapeFeature();
     getResizeShapeFeature();
     getDeleteFeature();
     getRemoveFeature();
}



               Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
How to draw the RCB Club Logo ?
      protected void drawClubInfo(ClubInfo
      clubInfo) {

               // Create an area for the Drawing
      the Club Logo
               AreaContext areaContext = new
      AreaContext();
               areaContext.setSize(400, 400);

               IAddContext myClubContext = new
      AddContext(areaContext, clubInfo);
               ((AddContext)
      myClubContext).setTargetContainer(diagram);

               IAddFeature addFeature =
      featureProvider.getAddFeature(myClubContext
      );

                      addFeature.add(myClubContext);
              }




      Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
How is the Club Icon drawn ?
public class AddClubInfoFeature extends

AbstractAddShapeFeature{

     public AddClubInfoFeature(IFeatureProvider fp) {
          super(fp);
     }
     @Override
     public PictogramElement add(IAddContext context) {
         // Get the EMF object from the context object
         ClubInfo addedClubInfo = (ClubInfo) context.getNewObject();
         // Get the parent for this Club Icon
         Diagram parent = (Diagram) context.getTargetContainer();

        // Create a container shape using Graphiti utility classes
       ContainerShape containerShape =
Graphiti.getPeCreateService().createContainerShape(
                      parent, true);
         // Give the imageID which is mentioned in ImageProvider
          String imageID = addedClubInfo.getClubName();
        // Create an Image using Graphiti utility classes
       Image image =
Graphiti.getGaCreateService().createImage(containerShape,
                      imageID);
          // Set the X, Y, Height and Width of this image
         gaService.setLocationAndSize(image, 0, 0, 300, 300);
     }
     @Override
     public boolean canAdd(IAddContext arg0) {
          return true;
     }
}


               Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
ght © 2011 SAP AG, Made   aAny other Feature apart from AddFeature ?

                           Feature
                           Name                    Default Class             Important Methods
                                                                             create(),
                           Create                  AbstractCreateFeature     canCreate()
                                                                             update(),
                           Update                  AbstractUpdateFeature     canUpdate()
                                                                             remove(),
                           Remove                  DefaultRemoveFeature      canRemove()
                                                                             delete(),
                           Delete                  DefaultDeleteFeature      canDelete()
                           Move                    DefaultMoveShapeFeature canMoveShape()
                                                                             canResizeShape(),
                           Resize                  DefaultResizeShapeFeature resizeShape()
                                                                             layout(),
                           Layout                  AbstractLayoutFeature     canLayout()
                                                                             execute(),
                           Custom                  AbstractCustomFeature     canExecute()


                            Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
Graphiti – Where to Get It ?
  Graphiti version 0.7.1 is available 
  www.eclipse.org/graphiti 
     Information around the project and framework 
     Downloads 
         Framework 
         Documentation 
         Tutorial 
      Forum 




              Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
Thanks 

Contenu connexe

Tendances

iOS overview
iOS overviewiOS overview
iOS overviewgupta25
 
Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptmartinlippert
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"GeeksLab Odessa
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developersKai Koenig
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injectionEyal Vardi
 
Serverless Orchestration with AWS Step Functions - DevDay Austin 2017
Serverless Orchestration with AWS Step Functions - DevDay Austin 2017Serverless Orchestration with AWS Step Functions - DevDay Austin 2017
Serverless Orchestration with AWS Step Functions - DevDay Austin 2017Amazon Web Services
 
Javascript Module Patterns
Javascript Module PatternsJavascript Module Patterns
Javascript Module PatternsNicholas Jansma
 
Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Elyse Kolker Gordon
 
Angular 2 NgModule
Angular 2 NgModuleAngular 2 NgModule
Angular 2 NgModuleEyal Vardi
 
Front-end Modular & Autmomated Development
Front-end Modular & Autmomated Development Front-end Modular & Autmomated Development
Front-end Modular & Autmomated Development Joseph Chiang
 
Svcc Java2D And Groovy
Svcc Java2D And GroovySvcc Java2D And Groovy
Svcc Java2D And GroovyAndres Almiray
 
Workshop 25: React Native - Components
Workshop 25: React Native - ComponentsWorkshop 25: React Native - Components
Workshop 25: React Native - ComponentsVisual Engineering
 

Tendances (17)

iOS overview
iOS overviewiOS overview
iOS overview
 
Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScript
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developers
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injection
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
 
Serverless Orchestration with AWS Step Functions - DevDay Austin 2017
Serverless Orchestration with AWS Step Functions - DevDay Austin 2017Serverless Orchestration with AWS Step Functions - DevDay Austin 2017
Serverless Orchestration with AWS Step Functions - DevDay Austin 2017
 
Javascript Module Patterns
Javascript Module PatternsJavascript Module Patterns
Javascript Module Patterns
 
Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017
 
Abc2011 2 yagi
Abc2011 2 yagiAbc2011 2 yagi
Abc2011 2 yagi
 
Solid angular
Solid angularSolid angular
Solid angular
 
Angular 2 NgModule
Angular 2 NgModuleAngular 2 NgModule
Angular 2 NgModule
 
Front-end Modular & Autmomated Development
Front-end Modular & Autmomated Development Front-end Modular & Autmomated Development
Front-end Modular & Autmomated Development
 
Abc2011 yagi
Abc2011 yagiAbc2011 yagi
Abc2011 yagi
 
Svcc Java2D And Groovy
Svcc Java2D And GroovySvcc Java2D And Groovy
Svcc Java2D And Groovy
 
Workshop 25: React Native - Components
Workshop 25: React Native - ComponentsWorkshop 25: React Native - Components
Workshop 25: React Native - Components
 

Similaire à Graphiti presentation

Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersJiaxuan Lin
 
Heroku pop-behind-the-sense
Heroku pop-behind-the-senseHeroku pop-behind-the-sense
Heroku pop-behind-the-senseBen Lin
 
Serverless Orchestration with AWS Step Functions - DevDay Los Angeles 2017
Serverless Orchestration with AWS Step Functions - DevDay Los Angeles 2017Serverless Orchestration with AWS Step Functions - DevDay Los Angeles 2017
Serverless Orchestration with AWS Step Functions - DevDay Los Angeles 2017Amazon Web Services
 
Serverless Orchestration with AWS Step Functions
Serverless Orchestration with AWS Step FunctionsServerless Orchestration with AWS Step Functions
Serverless Orchestration with AWS Step FunctionsAmazon Web Services
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 
Android architecture
Android architecture Android architecture
Android architecture Trong-An Bui
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360RapidValue
 
Rits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce LightningRits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce LightningRight IT Services
 
Raleigh DevDay 2017: Serverless orchestration with AWS step functions
Raleigh DevDay 2017: Serverless orchestration with AWS step functionsRaleigh DevDay 2017: Serverless orchestration with AWS step functions
Raleigh DevDay 2017: Serverless orchestration with AWS step functionsAmazon Web Services
 
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten ZiegelerNew and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegelermfrancis
 
Enhancement Of Facebook Features
Enhancement Of Facebook FeaturesEnhancement Of Facebook Features
Enhancement Of Facebook Featuresshahparin
 
dojox.gfx : the foundation for your crossbrowser advanced visualization.
dojox.gfx : the foundation for your crossbrowser advanced visualization.dojox.gfx : the foundation for your crossbrowser advanced visualization.
dojox.gfx : the foundation for your crossbrowser advanced visualization.pruzand
 
The Google App Engine Oil Framework
The Google App Engine Oil FrameworkThe Google App Engine Oil Framework
The Google App Engine Oil FrameworkEric ShangKuan
 
Deeper into ARKit with CoreML and Turi Create
Deeper into ARKit with CoreML and Turi CreateDeeper into ARKit with CoreML and Turi Create
Deeper into ARKit with CoreML and Turi CreateSoojin Ro
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumAxway Appcelerator
 
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAAppcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAJeff Haynie
 
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D BosschaertLeveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaertmfrancis
 

Similaire à Graphiti presentation (20)

Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for Beginners
 
Heroku pop-behind-the-sense
Heroku pop-behind-the-senseHeroku pop-behind-the-sense
Heroku pop-behind-the-sense
 
Serverless Orchestration with AWS Step Functions - DevDay Los Angeles 2017
Serverless Orchestration with AWS Step Functions - DevDay Los Angeles 2017Serverless Orchestration with AWS Step Functions - DevDay Los Angeles 2017
Serverless Orchestration with AWS Step Functions - DevDay Los Angeles 2017
 
Android Oreo
Android OreoAndroid Oreo
Android Oreo
 
Serverless Orchestration with AWS Step Functions
Serverless Orchestration with AWS Step FunctionsServerless Orchestration with AWS Step Functions
Serverless Orchestration with AWS Step Functions
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Android architecture
Android architecture Android architecture
Android architecture
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360
 
Rits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce LightningRits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce Lightning
 
Raleigh DevDay 2017: Serverless orchestration with AWS step functions
Raleigh DevDay 2017: Serverless orchestration with AWS step functionsRaleigh DevDay 2017: Serverless orchestration with AWS step functions
Raleigh DevDay 2017: Serverless orchestration with AWS step functions
 
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten ZiegelerNew and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
 
Enhancement Of Facebook Features
Enhancement Of Facebook FeaturesEnhancement Of Facebook Features
Enhancement Of Facebook Features
 
dojox.gfx : the foundation for your crossbrowser advanced visualization.
dojox.gfx : the foundation for your crossbrowser advanced visualization.dojox.gfx : the foundation for your crossbrowser advanced visualization.
dojox.gfx : the foundation for your crossbrowser advanced visualization.
 
Gephi Toolkit Tutorial
Gephi Toolkit TutorialGephi Toolkit Tutorial
Gephi Toolkit Tutorial
 
The Google App Engine Oil Framework
The Google App Engine Oil FrameworkThe Google App Engine Oil Framework
The Google App Engine Oil Framework
 
Deeper into ARKit with CoreML and Turi Create
Deeper into ARKit with CoreML and Turi CreateDeeper into ARKit with CoreML and Turi Create
Deeper into ARKit with CoreML and Turi Create
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with Titanium
 
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAAppcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
 
Bo analusis macros
Bo analusis  macrosBo analusis  macros
Bo analusis macros
 
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D BosschaertLeveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
 

Dernier

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 

Dernier (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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...
 

Graphiti presentation

  • 1. Creating Modeler using Graphiti Manikantan Subramanyam SAP Labs India
  • 2. Agenda for this session:  Who Am I?  Introduction to Graphiti  My Business Scenario/data  Demo  Short Discussion on Architecture  Code snippets  Link to useful resources  Our Modeling Tools Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 3. Some buzzzzzz words:  EMF: Eclipse Modeling Framework  Domain Model: Your business data as Java /EMF Objects  Pictogram Model: Graphiti’s data model  Pictorial Elements: UI Shapes created by Graphiti Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 4. What Is Graphiti All About ? “The goal easy creation and edit underlying graphical Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 5. Why Would I Want to Use Graphiti ? Copyright © 2011 SAP AG, Made available under the Eclipse Public License v
  • 6. My Business Data (Domain data) Club ClubInfo PlayerInfo CouncilInfo Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 7. Example of My Data: Club: RCB ClubInfo: clubName: rcb PlayerInfo: playerName: Daniel Vettori CouncilInfo: councilName: BCCI Club: Mumbai Indians ClubInfo: clubName: mi PlayerInfo: playerName: The GOD  CouncilInfo: councilName: BCCI Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 8. Demo Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 9. Sequence Flow… Prepare Business Data Define ImageProvider Define DiagramTypeProvider Define ToolBehaviorProvider Define FeatureProvider Draw FeatureProvider.add() Pictorial Elements Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 10. Prepare Business Data (Domain data) Club RCB = createNewClub(factory, "RCB", "Daniel Vettori"); Club MI = createNewClub(factory, "MI", "Sachin Tendulkar"); private Club createNewClub(MyIPLFactory factory, String clubName, String playerName) { Club newClub = factory.createClub(); ClubInfo clubInfo = factory.createClubInfo(); clubInfo.setClubName(clubName); PlayerInfo playerInfo = factory.createPlayerInfo(); playerInfo.setPlayerName(playerName); Council council = factory.createCouncil(); council.setCouncilName("BCCI"); newClub.setClubInfo(clubInfo); newClub.setPlayerInfo(playerInfo); newClub.setCouncilInfo(council); return newClub; } Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 11. How Does Graphiti Work ? Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 12. What about the Diagram Type Agent ? Custom Features Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 13. Graphiti’s Extesntion Points… Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 14. ImageProvider.. public class MyDiagramImageProvider extends AbstractImageProvider implements IImageProvider { public MyDiagramImageProvider() { } @Override protected void addAvailableImages() { addImageFilePath("rcb", "icons/rcb.jpg"); addImageFilePath("mi", "icons/mi.jpg"); addImageFilePath("rd", "icons/rd.jpg"); addImageFilePath("sd", "icons/sd.jpg"); } } Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 15. ToolBehaviorProvider.. public class ToolBehaviorProvider extends CommonToolBehaviorProvider { public ToolBehaviorProvider(IDiagramTypeProvider diagramTypeProvider) { super(diagramTypeProvider); } // Important Methods of CommonToolBehaviorProvider that can be overridden getContextButtonPad(); getContextMenu(); getPalette(); getToolTip(); } Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 16. DiagramTypeProvider.. public class MyDiagramTypeProvider extends AbstractDiagramTypeProvider implements IDiagramTypeProvider { private IToolBehaviorProvider[] toolBehaviorProviders; public MyDiagramTypeProvider() { super(); setFeatureProvider(new MyDiagramFeatureProvider(this)); } @Override public IToolBehaviorProvider[] getAvailableToolBehaviorProviders() { if (this.toolBehaviorProviders == null) { this.toolBehaviorProviders = new IToolBehaviorProvider[] { new ToolBehaviorProvider(this) }; } return this.toolBehaviorProviders; } } Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 17. FeatureProvider.. public class MyDiagramFeatureProvider extends DefaultFeatureProviderWithPatterns { ICustomFeature[] customFeatures = null; public MyDiagramFeatureProvider(IDiagramTypeProvider dtp) { super(dtp); } @Override public IAddFeature getAddFeature(IAddContext context) { if (context.getNewObject() instanceof ClubInfo) return new AddClubInfoFeature(this); else if (context.getNewObject() instanceof PlayerInfo) return new AddPlayerInfoFeature(this); else if (context.getNewObject() instanceof Council) return new AddBCCIFeature(this); return super.getAddFeature(context); } // Important Methods of DefaultFeatureProviderWithPatterns that can be overridden getCustomFeatures(); getMoveShapeFeature(); getResizeShapeFeature(); getDeleteFeature(); getRemoveFeature(); } Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 18. How to draw the RCB Club Logo ? protected void drawClubInfo(ClubInfo clubInfo) { // Create an area for the Drawing the Club Logo AreaContext areaContext = new AreaContext(); areaContext.setSize(400, 400); IAddContext myClubContext = new AddContext(areaContext, clubInfo); ((AddContext) myClubContext).setTargetContainer(diagram); IAddFeature addFeature = featureProvider.getAddFeature(myClubContext ); addFeature.add(myClubContext); } Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 19. How is the Club Icon drawn ? public class AddClubInfoFeature extends AbstractAddShapeFeature{ public AddClubInfoFeature(IFeatureProvider fp) { super(fp); } @Override public PictogramElement add(IAddContext context) { // Get the EMF object from the context object ClubInfo addedClubInfo = (ClubInfo) context.getNewObject(); // Get the parent for this Club Icon Diagram parent = (Diagram) context.getTargetContainer(); // Create a container shape using Graphiti utility classes ContainerShape containerShape = Graphiti.getPeCreateService().createContainerShape( parent, true); // Give the imageID which is mentioned in ImageProvider String imageID = addedClubInfo.getClubName(); // Create an Image using Graphiti utility classes Image image = Graphiti.getGaCreateService().createImage(containerShape, imageID); // Set the X, Y, Height and Width of this image gaService.setLocationAndSize(image, 0, 0, 300, 300); } @Override public boolean canAdd(IAddContext arg0) { return true; } } Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 20. ght © 2011 SAP AG, Made aAny other Feature apart from AddFeature ? Feature Name Default Class Important Methods create(), Create AbstractCreateFeature canCreate() update(), Update AbstractUpdateFeature canUpdate() remove(), Remove DefaultRemoveFeature canRemove() delete(), Delete DefaultDeleteFeature canDelete() Move DefaultMoveShapeFeature canMoveShape() canResizeShape(), Resize DefaultResizeShapeFeature resizeShape() layout(), Layout AbstractLayoutFeature canLayout() execute(), Custom AbstractCustomFeature canExecute() Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0
  • 21. Graphiti – Where to Get It ?   Graphiti version 0.7.1 is available    www.eclipse.org/graphiti    Information around the project and framework    Downloads    Framework    Documentation    Tutorial   Forum  Copyright © 2011 SAP AG, Made available under the Eclipse Public License v 1.0