Java Reference
In-Depth Information
from the gmfmap model first, and then update the source gmfgraph and
regenerate the mirror. New elements will appear at the end of the con-
tainment lists and, therefore, not break anything.
At this point, we're ready to change our scenario.gmfmap model to use
the mirrored.gmfgraph now located in our org.eclipse.bpmn.figures
project. Unfortunately, GMF does not provide a Migrate to Standalone Figures
utility GMF, so we're left to make the changes manually in a text editor. In our
case, it's a straightforward search and replace of all bpmn.gmfgraph occur-
rences with platform:/resource/org.eclipse.bpmn.figures/
models/mirrored.gmfgraph ; we can use Validate to ensure that we didn't
make a mistake. Note that we use the platform:/resource/ ... URI type and
not the usual relative path. If we were referencing a deployed plug-in in our envi-
ronment or target, we'd use platform:/plugin/ ... instead, which should
make updating this mapping model easy if we deploy these figures.
We have to do a couple more things before we regenerate our diagram.
Recall that we previously had figures generated during the gmfmap
gmfgen
transformation, so our figures are currently located in our EditPart s as inner
classes. First, we want to relocate our custom CircleDecoration class into our
new figures plug-in, but in a new src-custom source folder. This makes our
regeneration easier because we don't have to worry about deleting this custom
class. Also, this class will be available to other diagrams that want to use the dec-
oration for other links. In fact, we can go back to our Mindmap diagram and ref-
erence this decoration. After we copy the class into the /src-custom/org/
eclipse/bpmn/figures folder, our generated figures code will compile with-
out error.
The second thing we do is move the bpmn.gmfgraph model to our gener-
ated figures plug-in. This keeps the original source model near its mirror and
makes the source figures available to those who are creating diagrams and want
to extend them instead of using only the mirror's custom figure elements. We can
later modify the graphical definition and regenerate the figures code into this
same project.
BEST PRACTICE
When using generated figure plug-ins and mirrored.gmfgraph models,
it's a good idea to include the original graphical definition in the generated
plug-in for later regeneration and to make it available for source-level reuse
of the figures. Note that subsequent regeneration of the figures plug-in
 
Search WWH ::




Custom Search