1 / 10

Spraying The Natural Way of Creating Graphiti

Spraying The Natural Way of Creating Graphiti. Jos Warmer, Independent jos.warmer@openmodeling.nl Karsten Thoms, Itemis karsten.thoms@itemis.de. Graphiti Approach. No code generation but: Uses a runtime engine Programmed using a Java API Easy (relatively) to understand code. But ….

bandele
Télécharger la présentation

Spraying The Natural Way of Creating Graphiti

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Spraying The Natural Way of Creating Graphiti Jos Warmer, Independent jos.warmer@openmodeling.nl Karsten Thoms, Itemis karsten.thoms@itemis.de

  2. Graphiti Approach • No code generation but: • Uses a runtime engine • Programmed using a Java API • Easy (relatively) to understand code

  3. But … • Programming the editor in Java is much (often simple but repetitive) work. • E.g. for one shape for one metaclass: • At least five feature classes: AddFeature, CreateFeature, DeleteFeature, LayoutFeature, UpdateFeature • Features all need to be configured in the FeatureProvider • Need to configure palette in the ToolBehaviourProvider • Need to configure used images in ImageProvider • Repeat this for e.g. ten metaclasses ……….

  4. The Spray Graphiti Generator • Started a research project • Got a government grant • Became useful before being finished • Project for Visual Insurance Product Modeling language • Spray had to be adapted to the PMW project • Became partly generic, partly project specific • Resulting Editors are used by non IT users in production • Works well (at least for PMW )

  5. The Spray Graphiti Generator • Spray has become open source in July • At: http://code.google.com/a/eclipselabs.org/p/spray/ • Version 0.1 was the generalized version used for PMW • EPL License • Current status • Spray is in startup phase • Much work done on infrastructure • Plans • … growing Spray by adding more features as we go ….. • … getting more users and more feedback …..

  6. Define visualization for metaclassBusinessClass Icon shown in palette The Spray DSL Contents of the container References to properties of metaclass classBusinessClassicon “class.gif": container(fill = dark_green ) [ text( ) { "<<“ + eClass.name + ">> "+ name}; line(color = black width = 2); reference propertiesattribute dataType; line(color= RGB(255,138,141)); text( )"::"+ description; ] references[ superclass : connection(); ] behavior[ createpalette"Shapes" ; doWithBusinessClass"Do It With“ ; ] List of referred objects Behaviour for Product shape References of businessclass shown as connections Will be in palette to create in named compartment Custom behavior

  7. Define visualization for metaclass Association The Spray DSL class Association icon “association.gif“ : connection(width = 2) [ from source to target fromTexttext()source.name toTexttext()targetMultiplicity.name ] Shown as a connection (line) Source and target are references in class Association Text to show at the “’from’ and ‘to’ to” side, also options for middle of connection

  8. Spray Generator • Using textual model to define graphical editor  • Xtext 2, Xtend 2, Xbase • Mixing generated and handwritten code by design • Uses Generation Gap pattern • Allows full access to Graphiti API • Managed by simply moving a generated file from “src-gen” to “src” folder • Generation of code from Spray DSL remains possible in full project life-cycle.

  9. Spray Vision Making developing graphical DSL’s as easy as it is to develop textual DSL’s with e.g. Xtext.

  10. Demo • Karsten will show a short demo by creating a simple Graphiti editor from scratch

More Related