This commit is contained in:
DozorovaA.A 2022-12-14 13:03:36 +04:00
parent 760c2721aa
commit 1e3c316731
2 changed files with 3 additions and 2 deletions

View File

@ -586,7 +586,7 @@ private void ReloadMaps() {
int result = fs.showSaveDialog(null);
if (result == JFileChooser.APPROVE_OPTION) {
File selectedFile = fs.getSelectedFile();
if (_mapCollection.SaveData(selectedFile.getPath()))
if (_mapCollection.SaveData(selectedFile.getPath()+".txt"))
{
JOptionPane.showMessageDialog(null, "Сохранение прошло успешно", "Результат",JOptionPane.INFORMATION_MESSAGE);
}

View File

@ -217,10 +217,11 @@ public class MapsCollection {
map = new HorizontalMap();
break;
}
_mapStorages.put(elem[0], new MapWithSetMachineGeneric<IDrawingObject, AbstractMap>(_pictureWidth, _pictureHeight, map));
if(_mapStorages.containsKey(elem[0])){
_mapStorages.get(elem[0]).Clear();
}
else _mapStorages.put(elem[0], new MapWithSetMachineGeneric<IDrawingObject, AbstractMap>(_pictureWidth, _pictureHeight, map));
while((str = br.readLine()) != null) {
_mapStorages.get(elem[0]).LoadData(str.split(separatorData + "\n?"));
}