SlideShare a Scribd company logo
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 

More Related Content

What's hot

iOS overview
iOS overviewiOS overview
iOS overview
gupta25
 
Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScript
martinlippert
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"
GeeksLab Odessa
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
Keith Bloomfield
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developers
Kai Koenig
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injection
Eyal Vardi
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
Barcamp Saigon
 
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
Amazon Web Services
 
Javascript Module Patterns
Javascript Module PatternsJavascript Module Patterns
Javascript Module Patterns
Nicholas 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 2017
Elyse Kolker Gordon
 
Abc2011 2 yagi
Abc2011 2 yagiAbc2011 2 yagi
Abc2011 2 yagi
Toshihiro Yagi
 
Solid angular
Solid angularSolid angular
Solid angular
Nir Kaufman
 
Angular 2 NgModule
Angular 2 NgModuleAngular 2 NgModule
Angular 2 NgModule
Eyal Vardi
 
Front-end Modular & Autmomated Development
Front-end Modular & Autmomated Development Front-end Modular & Autmomated Development
Front-end Modular & Autmomated Development
Joseph Chiang
 
Abc2011 yagi
Abc2011 yagiAbc2011 yagi
Abc2011 yagi
Toshihiro Yagi
 
Svcc Java2D And Groovy
Svcc Java2D And GroovySvcc Java2D And Groovy
Svcc Java2D And Groovy
Andres Almiray
 
Workshop 25: React Native - Components
Workshop 25: React Native - ComponentsWorkshop 25: React Native - Components
Workshop 25: React Native - Components
Visual Engineering
 

What's hot (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
 

Similar to 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 Beginners
Jiaxuan Lin
 
Heroku pop-behind-the-sense
Heroku pop-behind-the-senseHeroku pop-behind-the-sense
Heroku pop-behind-the-sense
Ben 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 2017
Amazon Web Services
 
Android Oreo
Android OreoAndroid Oreo
Android Oreo
Siddharth Yadav
 
Serverless Orchestration with AWS Step Functions
Serverless Orchestration with AWS Step FunctionsServerless Orchestration with AWS Step Functions
Serverless Orchestration with AWS Step Functions
Amazon Web Services
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
jojule
 
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 360
RapidValue
 
Rits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce LightningRits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce Lightning
Right 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 functions
Amazon 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 Ziegeler
mfrancis
 
Enhancement Of Facebook Features
Enhancement Of Facebook FeaturesEnhancement Of Facebook Features
Enhancement Of Facebook Features
shahparin
 
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
 
Gephi Toolkit Tutorial
Gephi Toolkit TutorialGephi Toolkit Tutorial
Gephi Toolkit Tutorial
Gephi Consortium
 
The Google App Engine Oil Framework
The Google App Engine Oil FrameworkThe Google App Engine Oil Framework
The Google App Engine Oil Framework
Eric 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 Create
Soojin Ro
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with Titanium
Axway 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, CA
Jeff Haynie
 
Bo analusis macros
Bo analusis  macrosBo analusis  macros
Bo analusis macros
Yogeeswar Reddy
 
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
mfrancis
 

Similar to 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
 

Recently uploaded

9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 

Recently uploaded (20)

9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 

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