for (int i = 0; i < cells.length; i++) {
if (graphModel.isEdge(cells[i])) {
CellView cellView = graphLayoutCache.getMapping(
cells[i], false);
if (cellView instanceof EdgeView) {
EdgeView edgeView = (EdgeView) cellView;
if (edgeView.getSource() == null) {
Point2D pt = edgeView.getPoint(0);
if (pt != null) {
if (ret == null)
ret = new Rectangle2D.Double(pt.getX(),
pt.getY(), 0, 0);
else
Rectangle2D.union(ret,
new Rectangle2D.Double(pt
.getX(), pt.getY(), 0,
0), ret);
}
}
if (edgeView.getTarget() == null) {
Point2D pt = edgeView.getPoint(edgeView
.getPointCount() - 1);
if (pt != null) {
if (ret == null)
ret = new Rectangle2D.Double(pt.getX(),
pt.getY(), 0, 0);