Compare commits

..

No commits in common. "e1c0918dba47f3808f78aeb3085e6aecd2c8ac71" and "680274195d55ba6c6aeaa29b893cd899a68b77fb" have entirely different histories.

3 changed files with 2 additions and 12 deletions

View File

@ -154,14 +154,12 @@ public class FormMapWithSetArtilleries extends JFrame {
buttonShowDeleted.addActionListener(e -> {
if (!deletedObjects.empty()) {
DrawingObjectArtillery deleted = (DrawingObjectArtillery) deletedObjects.pop();
FormArtillery dialog = new FormArtillery(deleted.getArtillery());
FormArtillery dialog = new FormArtillery(deleted == null ? null : deleted.getArtillery());
dialog.setSize(800, 500);
dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} else {
JOptionPane.showMessageDialog(this, "Стек удалённых объектов пуст", "Провал", JOptionPane.INFORMATION_MESSAGE);
}
});

View File

@ -7,7 +7,7 @@ public class MapWithSetArtilleriesGeneric<T extends IDrawingObject, U extends Ab
public final int _pictureHeight;
public final int _placeSizeWidth = 210;
public final int _placeSizeHeight = 90;
public final SetArtilleriesGeneric<T> _setArtilleries;
private final SetArtilleriesGeneric<T> _setArtilleries;
private final U _map;
public MapWithSetArtilleriesGeneric(int picWidth, int picHeight, U map) {

View File

@ -30,12 +30,4 @@ public class MapsCollection {
public MapWithSetArtilleriesGeneric<IDrawingObject, AbstractMap> getMap(String name) {
return _mapsStorage.getOrDefault(name, null);
}
public IDrawingObject getArtillery(String mapName, int index) {
var map = _mapsStorage.getOrDefault(mapName, null);
if (map != null) {
return map._setArtilleries.get(index);
}
return null;
}
}