protected void updateRelationshipCell(Relationship rel) { if (rel.getSourceEntity() != null && rel.getTargetEntity() != null) { DefaultEdge edge = relCells.get(getQualifiedName(rel)); if (edge != null) { updateRelationshipLabels(edge, rel, rel.getReverseRelationship()); Map nested = new HashMap(); nested.put(edge, edge.getAttributes()); edit(nested); } else { insertRelationshipCell(rel); } } }
protected DefaultEdge createRelationshipCell(Relationship rel) { if (!relCells.containsKey(getQualifiedName(rel))) { Relationship reverse = rel.getReverseRelationship(); DefaultEdge edge = new DefaultEdge(); // GraphConstants.setLineStyle(edge.getAttributes(), // GraphConstants.STYLE_ORTHOGONAL); // GraphConstants.setRouting(edge.getAttributes(), // GraphConstants.ROUTING_SIMPLE); GraphConstants.setEditable(edge.getAttributes(), false); GraphConstants.setLabelAlongEdge(edge.getAttributes(), true); GraphConstants.setSelectable(edge.getAttributes(), false); GraphConstants.setFont(edge.getAttributes(), EDGE_FONT); updateRelationshipLabels(edge, rel, reverse); relCells.put(getQualifiedName(rel), edge); if (reverse != null) { relCells.put(getQualifiedName(reverse), edge); } return edge; } return null; }