Closed JoelGaechter closed 4 years ago
I suggest the following changes in LinkLayer
:
ICoordinate lastCoord
paint
put the following:
if (Objects.nonNull(lastCoord)) {
Point p = amodeusComponent.getMapPosition(lastCoord.getLat(), lastCoord.getLon());
if (Objects.nonNull(p)) {
graphics.setColor(Color.ORANGE);
graphics.fillRect(p.x - 1, p.y - 1, 3, 3);
graphics.setColor(Color.WHITE);
graphics.drawString(String.format("[lng=%.6f, lat=%.6f]", lastCoord.getLon(), lastCoord.getLat()), p.x + 10, p.y - 10); // TODO format nicer
}
}
LayzMouseListener::lazyClicked
only needs lastCoord = amodeusComponent.getPosition(mouseEvent.getPoint());
drawLabel == false
using else jTextArea.setText("");
remark: Currently the marked links drawn in paint
change if the map is moved. Maybe it would make sense to also make them depending on lastCoord
.
@JoelGaechter Could you please review whether what I have added to the
@Override public void lazyClicked(MouseEvent mouseEvent)
function, corresponds to what was the task described in the corresponding TODO?I have asked Claudio for review and guidance as it was not entirely clear to me - he mentioned I should check with you and ask for your review. (Also, I am not yet able to build the amodeus code myself - I am still missing some dependencies it seems.)