Skip to main content
Jump to: navigation, search

Graphical Modeling Framework/Models/GMFGraph

< Graphical Modeling Framework
Revision as of 08:49, 19 September 2006 by (Talk | contribs) (How can I use CustomLayout and what is purpose of the CustomAttribute)


Scalable/resizable figures

Newsgroup post

How can I start with CustomFigures

Newsgroup thread

How can I use CustomLayout and what is purpose of the CustomAttribute

From the newsgroup thread

gmfgraph.CustomLayout is just a gate to the custom implementation of the org.eclipse.draw2d.LayoutManager class. Thus there is in fact 2 questions -- how to write draw2d Layout manager and how to plug it into the gmfgraph. This covers only the latter.

Imagine you have class in the plugin. The SuperLayout class has method setBoolParam(boolean) and public instance field int myIntParam; It also expects the instanceof superLayoutData that has setter setStringParam(String s).

To plug this into gmfgraph you need:

  1. Create separate ResourceGallery, set implementation bundle to ""
  2. Create figures structure.
  3. In the container node create CustomLayout, set fqn = "". Note that bundleName property of CustomLayout is deprecated and not used, it does not make sense to change it.
  4. In the just created Custom Layout create custom attribute, set name = boolParam (or BoolParam -- it doesnot make sense) -- the name is derived from setter name, value = (say) "false" or "42 / 2 >= 21".
  5. Create one more custom attribute, name = "myIntParam" (derived from field name), value = "42", isDirectAccess = true.
  6. In the child figure create CustomLayoutData, set fqn = "", repeat step 4 for custom attribute "StringParam" if needed.

Note that values set at the steps 4, 5 are considered opaque and just generated into the setter call or assignment statement as is. Thus, to set the string value "MG" for custom attribute StringParam you need to set value = "MG" (with quotes).

There's a legacy GEF figure code and I'd like to use it with GMF

tbd (check for MapMode, etc)

I need a figure that is similar to UML package

There's no need to use custom figure, just use some GMFGraph magic...tbd TODO put link to newsgroup discussion If you like to have custom anchor behaviour (e.g. no link attaching to package title box), you need to hand code it (there was a posting in the newsgroup).

How to create several figures at once

I.e. when creating some element, few additional should be created as well. tbd Need to find better place for this, as it's not gmfgraph topic

Back to the top