Compare commits
2 Commits
e60990067a
...
ccab9cd620
Author | SHA1 | Date | |
---|---|---|---|
ccab9cd620 | |||
5c582f70b3 |
@ -157,12 +157,14 @@ public class FormMapWithSetArtilleries extends JFrame {
|
|||||||
buttonShowDeleted.addActionListener(e -> {
|
buttonShowDeleted.addActionListener(e -> {
|
||||||
if (!deletedObjects.empty()) {
|
if (!deletedObjects.empty()) {
|
||||||
DrawingObjectArtillery deleted = (DrawingObjectArtillery) deletedObjects.pop();
|
DrawingObjectArtillery deleted = (DrawingObjectArtillery) deletedObjects.pop();
|
||||||
FormArtillery dialog = new FormArtillery(deleted == null ? null : deleted.getArtillery());
|
FormArtillery dialog = new FormArtillery(deleted.getArtillery());
|
||||||
dialog.setSize(800, 500);
|
dialog.setSize(800, 500);
|
||||||
dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
|
dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
|
||||||
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||||
|
|
||||||
dialog.setVisible(true);
|
dialog.setVisible(true);
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, "Стек удалённых объектов пуст", "Провал", JOptionPane.INFORMATION_MESSAGE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ public class MapWithSetArtilleriesGeneric<T extends IDrawingObject, U extends Ab
|
|||||||
public final int _pictureHeight;
|
public final int _pictureHeight;
|
||||||
public final int _placeSizeWidth = 210;
|
public final int _placeSizeWidth = 210;
|
||||||
public final int _placeSizeHeight = 90;
|
public final int _placeSizeHeight = 90;
|
||||||
private final SetArtilleriesGeneric<T> _setArtilleries;
|
public final SetArtilleriesGeneric<T> _setArtilleries;
|
||||||
private final U _map;
|
private final U _map;
|
||||||
|
|
||||||
public MapWithSetArtilleriesGeneric(int picWidth, int picHeight, U map) {
|
public MapWithSetArtilleriesGeneric(int picWidth, int picHeight, U map) {
|
||||||
|
@ -30,4 +30,12 @@ public class MapsCollection {
|
|||||||
public MapWithSetArtilleriesGeneric<IDrawingObject, AbstractMap> getMap(String name) {
|
public MapWithSetArtilleriesGeneric<IDrawingObject, AbstractMap> getMap(String name) {
|
||||||
return _mapsStorage.getOrDefault(name, null);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user