@Override
public void addLayer(Layer layer, int pos) {
if (layer instanceof OsmDataLayer) {
editLayer = (OsmDataLayer) layer;
Main.ds = editLayer.data;
editLayer.listenerModified.add(new ModifiedChangedListener() {
public void modifiedChanged(boolean value, OsmDataLayer source) {
JOptionPane.getFrameForComponent(Main.parent).setTitle(
(value ? "*" : "")
+ tr("Java OpenStreetMap Editor"));
}