if (!(p instanceof HistoryNode)) return;
if (!(opposite instanceof HistoryNode)) return;
HistoryNode node = (HistoryNode)p;
HistoryNode oppositeNode = (HistoryNode) opposite;
LatLon coord = node.getCoords();
LatLon oppositeCoord = oppositeNode.getCoords();
// display the coordinates
//
lblLat.setText(coord != null ? coord.latToString(CoordinateFormat.DECIMAL_DEGREES) : tr("(none)"));
lblLon.setText(coord != null ? coord.lonToString(CoordinateFormat.DECIMAL_DEGREES) : tr("(none)"));
// update background color to reflect differences in the coordinates
//
if (coord == oppositeCoord ||
(coord != null && oppositeCoord != null && coord.lat() == oppositeCoord.lat())) {
lblLat.setBackground(Color.WHITE);
} else {
lblLat.setBackground(BGCOLOR_DIFFERENCE);
}
if (coord == oppositeCoord ||
(coord != null && oppositeCoord != null && coord.lon() == oppositeCoord.lon())) {
lblLon.setBackground(Color.WHITE);
} else {
lblLon.setBackground(BGCOLOR_DIFFERENCE);
}
}