Java Reference
In-Depth Information
To allow our WrapLabel to wrap, we need to slightly modify the
createContents() method as follows:
/**
* Modified to enable text wrapping
*
* @generated NOT
*/
private void createContents() {
fFigureTopicNameFigure = new WrappingLabel();
fFigureTopicNameFigure.setText("");
fFigureTopicNameFigure.setTextWrap(true);
fFigureTopicNameFigure.setAlignment(PositionConstants.LEFT);
this.add(fFigureTopicNameFigure);
}
Figure 4-9 shows our diagram. Note the relationship stack of tools in the
palette and note that the mindmap.ecore literal values for our relationship
Type enum have been changed to lowercase. Alternatively, we could have
changed the case within our label code, or even shortened the literal values to be
just d , e , or i .
Figure 4-9
Mindmap relationship links
Adding Custom Layout
A major requirement for a mindmap diagram is good layout, preferably auto-
matic. A fixed layout is fine for our needs, although more advanced layout strate-
gies that are pseudo-fixed are possible. Mindmaps should be arranged in a tree,
typically with both left-to-right and right-to-left flows to the sides of the central
Topic . The default layout for GMF-generated diagrams is top-to-bottom. The
Search WWH ::




Custom Search