endLayer.setOffset( layer.getBounds().x, layer.getBounds().y);
    public void mouseReleased(MouseEvent event) {        mouseButton = MouseEvent.NOBUTTON;        bMouseIsDown = false;        if (paintEdit != null) {            MapLayer layer = currentMap.getLayer(currentLayer);            if (layer != null) {	            try {                    MapLayer endLayer = paintEdit.getStart().createDiff(layer);                    endLayer.setId(layer.getId());                    endLayer.setOffset(                            layer.getBounds().x, layer.getBounds().y);                    paintEdit.end(endLayer);                    undoSupport.postEdit(paintEdit);                } catch (Exception e) {                    e.printStackTrace();                }            }            paintEdit = null;        }    }