public static PropositionFormat asTextLines(final InsertionInterface ii) {
return new PropositionFormat() {
public void write(NounPart context, Relationship key, NounPart value) {
PropositionBinding pb = new PropositionBinding(context, key, value);
SimpleNoun from = getExistingNounOnDiagram(context, ii);
DiagramElement de = ii.returnExisting(from);
String fromLabel = getLabel(context, from, ii);
String toLabel = getLabel(value, null, ii);
String text = (fromLabel.length() == 0 ? "" : (fromLabel + " "))
+ (key == null ? "" : key.getName() + ": ") + toLabel;
DiagramElement out = null;
if (de instanceof Glyph) {
// add a text line to the glyph
out = ii.returnTextLine((Glyph) de, pb, text);
} else if (de instanceof TextLine) {