@Override
public void update(Observable o, Object arg) {
lblInfo.setText(getInfoText());
HistoryOsmPrimitive primitive = getPrimitive();
Changeset cs = primitive.getChangeset();
if (!model.isLatest(primitive)) {
User user = primitive.getUser();
String url = AbstractInfoAction.getBaseBrowseUrl() + "/changeset/" + primitive.getChangesetId();
lblChangeset.setUrl(url);
lblChangeset.setDescription(Long.toString(primitive.getChangesetId()));
String username = "";
if (user != null) {
username = user.getName();
}
lblUser.setDescription(username);
try {
if (user != null && user != User.getAnonymous()) {
lblUser.setUrl(getUserUrl(username));
} else {
lblUser.setUrl(null);
}
} catch(UnsupportedEncodingException e) {
Main.error(e);
lblUser.setUrl(null);
}
} else {
String username = JosmUserIdentityManager.getInstance().getUserName();
if (username == null) {
lblUser.setDescription(tr("anonymous"));
lblUser.setUrl(null);
} else {
lblUser.setDescription(username);
try {
lblUser.setUrl(getUserUrl(username));
} catch(UnsupportedEncodingException e) {
Main.error(e);
lblUser.setUrl(null);
}
}
lblChangeset.setDescription(tr("none"));
lblChangeset.setUrl(null);
}
final Changeset oppCs = model.getPointInTime(pointInTimeType.opposite()).getChangeset();
updateText(cs, "comment", lblChangesetComment, null, oppCs, lblChangesetComment);
updateText(cs, "source", lblChangesetSource, lblSource, oppCs, pnlChangesetSource);
}