for (PXEdge uiEdge : getEdges()) {
if (uiEdge instanceof ElasticEdge) {
ElasticEdge elasticEdge = (ElasticEdge) uiEdge;
WorldObject startNode = uiEdge.getStartNode();
WorldObject endNode = uiEdge.getEndNode();
// Find the Elastic Objects which are ancestors of the start and
// end
// nodes
while (startNode.getParent() != this && startNode != null) {
startNode = startNode.getParent();
if (startNode == null) {
break;
}
}
while (endNode.getParent() != this && endNode != null) {
endNode = endNode.getParent();
if (endNode == null) {
break;
}
}
if (startNode == null || endNode == null) {
Util.Assert(false, "Edge nodes do not exist on this ground");
} else if (!(startNode instanceof ElasticObject || endNode instanceof ElasticGround)) {
/*
* The parent nodes are not elastic, we can ignore them
*/
} else if (startNode.getParent() == this && endNode.getParent() == this) {
ElasticVertex startVertex = myVertexMap.get(startNode);
ElasticVertex endVertex = myVertexMap.get(endNode);
if (!(startVertex != null && endVertex != null)) {
Util.Assert(false, "Could not find vertice");