// Change the color of the icon to green.
_circle2.fillColor.setToken("{0.0, 1.0, 0.0, 1.0}");
CompositeEntity container = (CompositeEntity) getContainer();
Entity destNode = container.getEntity(destination);
Locatable destLocation = (Locatable) destNode.getAttribute(
"_location", Locatable.class);
Locatable myLocation = (Locatable) this.getAttribute(
"_location", Locatable.class);
if ((destLocation == null) || (myLocation == null)) {
throw new IllegalActionException(
"Cannot determine location for node "
+ destNode.getName() + ".");
}
Iterator nodes = _connectedNodes.iterator();
double minDistance = _distanceBetween(destLocation, myLocation);
String to = " ";
boolean multi = ((BooleanToken) doublePath.getToken())
.booleanValue();
double nextMinDistance = _distanceBetween(destLocation,
myLocation);
String to2 = " ";
while (nodes.hasNext()) {
Entity node = (Entity) nodes.next();
Locatable location = (Locatable) node.getAttribute(
"_location", Locatable.class);
if (location == null) {
throw new IllegalActionException(
"Cannot determine location for node "