/** * Returns a string like 'source -> destination' * * @return String */ public String toString() { StringBuffer buffer = new StringBuffer("GraphModelConnection: "); buffer.append(sourceNode != null ? sourceNode.getText() : "null"); buffer.append(isDirected() ? " --> " : " --- "); buffer.append(destinationNode != null ? destinationNode.getText() : "null"); buffer.append(" (weight=").append(getWeightInLayout()).append(")"); return buffer.toString(); }