}
g.setFont(g.getFont().deriveFont((float) LOCATION_NAME_TEXT_SIZE));
g.setColor(TangoColorFactory.PLUM_2);
List<Visit> visitList = travelingSalesmanTour.getVisitList();
for (Visit visit : visitList) {
Location location = visit.getLocation();
int x = translator.translateLongitudeToX(location.getLongitude());
int y = translator.translateLatitudeToY(location.getLatitude());
g.fillRect(x - 1, y - 1, 3, 3);
if (location.getName() != null && visitList.size() <= 500) {
g.drawString(location.getName(), x + 3, y - 3);
}
}
g.setColor(TangoColorFactory.ALUMINIUM_4);
Domicile domicile = travelingSalesmanTour.getDomicile();
Location domicileLocation = domicile.getLocation();
int domicileX = translator.translateLongitudeToX(domicileLocation.getLongitude());
int domicileY = translator.translateLatitudeToY(domicileLocation.getLatitude());
g.fillRect(domicileX - 2, domicileY - 2, 5, 5);
if (domicileLocation.getName() != null && visitList.size() <= 500) {
g.drawString(domicileLocation.getName(), domicileX + 3, domicileY - 3);
}
Set<Visit> needsBackToDomicileLineSet = new HashSet<Visit>(visitList);
for (Visit trailingVisit : visitList) {
if (trailingVisit.getPreviousStandstill() instanceof Visit) {
needsBackToDomicileLineSet.remove(trailingVisit.getPreviousStandstill());
}
}
g.setColor(TangoColorFactory.CHOCOLATE_1);
for (Visit visit : visitList) {
if (visit.getPreviousStandstill() != null) {
Location previousLocation = visit.getPreviousStandstill().getLocation();
Location location = visit.getLocation();
translator.drawRoute(g, previousLocation.getLongitude(), previousLocation.getLatitude(),
location.getLongitude(), location.getLatitude(),
location instanceof AirLocation);
// Back to domicile line
if (needsBackToDomicileLineSet.contains(visit)) {
translator.drawRoute(g, location.getLongitude(), location.getLatitude(),
domicileLocation.getLongitude(), domicileLocation.getLatitude(),
location instanceof AirLocation);
}
}
}