SymbolTarget st = null;
if (container instanceof Context) {
st = (TextLine) ((Context) container).getLabel();
if (st == null) {
st = new TextLine();
((Context) container).setLabel((TextLine) st);
}
} else if (container instanceof SymbolTarget) {
st = (Glyph) container;
} else if (container instanceof Link) {
// add to a label, eventually.
}
// add the symbol to the container
if ((st != null) && (!st.getSymbols().contains(out))) {
st.getSymbols().add((Symbol) out);
}
}
return out;
}
public DiagramElement returnTextLine(Glyph container,
Object representing, String text) {
DiagramElement out = representing == null ? null : contents
.get(representing);
if (out == null) {
TextLine tl = new TextLine(text);
contents.put(representing, tl);
container.getText().add(tl);
return tl;
}
return out;