public void disconnectEdge(Object eventSource, Object edge) {
if (!(getEdgeModel(edge) instanceof MutableEdgeModel)) {
return;
}
MutableEdgeModel model = (MutableEdgeModel) getEdgeModel(edge);
Object head = model.getHead(edge);
Object tail = model.getTail(edge);
model.setTail(edge, null);
model.setHead(edge, null);
if (head != null) {
GraphEvent e = new GraphEvent(eventSource,
GraphEvent.EDGE_HEAD_CHANGED, edge, head);
dispatchGraphEvent(e);