newTileInstanceProperties[y][x] = getTileInstancePropertiesAt(x - dx, y - dy);
Properties tip = getTileInstancePropertiesAt(x - dx, y - dy); if (tip != null) { newTileInstanceProperties.put(new Point(x, y), tip); }
    public void resize(int width, int height, int dx, int dy) {        if (!canEdit())            return;        Tile[][] newMap = new Tile[height][width];        Properties[][] newTileInstanceProperties = new Properties[height][width];        int maxX = Math.min(width, bounds.width + dx);        int maxY = Math.min(height, bounds.height + dy);        for (int x = Math.max(0, dx); x < maxX; x++) {            for (int y = Math.max(0, dy); y < maxY; y++) {                newMap[y][x] = getTileAt(x - dx, y - dy);                newTileInstanceProperties[y][x] = getTileInstancePropertiesAt(x - dx, y - dy);            }        }        map = newMap;        tileInstanceProperties = newTileInstanceProperties;        bounds.width = width;        bounds.height = height;    }