Java Reference
In-Depth Information
8.1.1 Artwork
The most impactful thing we can do at this point is add icons and other artwork
to the diagram, edit, and editor plug-ins we've generated. The default generated
icons do little to convey meaning, so we can replace them with ones that do—or
just remove them altogether. Remember, just because we can add icons doesn't
mean we should.
I'm not a graphic artist, so let's look for another source of icons. Thousands
of icons ship with Eclipse, so we can try to reuse these, although I don't recom-
mend this for a real product. Before plug-ins were bundled in .jar files, it was
simple to see all the icons that shipped with Eclipse. It's still easy to do with a
simple Ant script that extracts all *.gif images from each of the **/*.jar files
in the plug-ins directory. Start with a complete install of all Eclipse projects, and
then prepare to scroll through thousands of icons in your file browser.
After collecting some candidate icons, we begin to replace those found in our
generated plug-in projects. This is most easily accomplished by simply renaming
your new icons to match the names found in the /icons/full/obj16/ direc-
tory (or similar directory). Most diagram element icons are found in their corre-
sponding *.model.edit plug-in , and the Diagram Wizard icon is found in
the *.diagram plug-in. In the case of our Requirements editor, we need to
replace the image in its EMF-generated *.editor plug-in. This gets us close, but
some missing ones still will require path information to be entered into our mod-
els. It's a good idea to back up the plug-in icon directories at this point, to avoid
losing them upon regeneration.
Reference-based links in our diagrams are missing icons because they do not
correspond to a domain model class element, as is the case with our Mindmap
subtopic link. To specify the icon to use for the subtopic link, we can open the
mindmap.gmftool model and navigate to our Subtopic Creation Tool . The
tooling model wizard adds a large and small Default Image element to each
creation tool, which normally points to the corresponding *.edit plug-in icon.
We can delete these children from our Subtopic tool and create a new Small
Icon Bundle Image . For the Bundle property, we can point to our
org.eclipse.mindmap.model.edit plug-in and specify icons/full/
obj16/Subtopic.gif for the Path property. Of course, we need to add this
image to the *.edit plug-in because it was not provided. After this, we can re-
create the mindmap.gmfgen model from the mindmap.gmfmap model and
regenerate the Mindmap diagram. You'll find the new icon used in the palette,
which just leaves updating the remainder of the tooling models for similar cases.
Search WWH ::




Custom Search