PostProcessing

The PostProcessing facilities of GenGMF are useful to express the variability of different nodes and edges which derive from the same template. GenGMF uses the script language XTend for this task. The signature for the filter extensions looks like:

[FilterType] filter[NodeName][FilterType]
        ([FilterType] fd, [NodeType] cd)
: [YOUR FILTER CODE]
-> fd
;

where [FilterType] is one of

  • GMFGraph post processing:
    • Compartment (only CompartmentDesc)
    • Connection (only EdgeDesc)
    • DiagramLabel
    • FigureDescriptor
    • Node (only AbstractNodeDesc)
  • GMFMap post processing:
    • TopNodeReference (only AbstractNodeDesc with containment feature set)
    • LinkMapping (only EdgeDesc)

and [NodeType] is one of:

  • FigureDesc (NodeDesc, CompartmentDesc and EdgeDesc)
  • AbstractNodeDesc (NodeDesc and CompartmentDesc)
  • NodeDesc
  • CompartmentDesc
  • EdgeDesc

The [NodeName] is the name of the FigureDesc element in your GenGMF model.

As an Example – to change the background Color of an Element named Node to a light red, you could write:

/**
 * A Node element should be displayed in red
 */
FigureDescriptor filterNodeAFigureDescriptor
        (FigureDescriptor fd, NodeDesc cd)
:   let rgb = new RGBColor
:   rgb.setRed(255)
->  rgb.setGreen(128)
->  rgb.setBlue(128)
->  fd.actualFigure.setForegroundColor(rgb)
->  fd
;

Comments are closed.