Сданная лаба 4 хард, требуется чистка

This commit is contained in:
Данила Мочалов 2022-11-08 16:50:09 +04:00
parent 2d621bbe70
commit dbfe33b361
2 changed files with 4 additions and 1 deletions

View File

@ -293,6 +293,9 @@ public class FormMapWithSetLocomotives extends JComponent {
//первой лабораторной), передавая туда элемент из коллекции
//удаленных, если там есть
DrawningObjectLocomotive locomotive = _mapsCollection.Get(listBoxMaps.getSelectedValue().toString()).getDeleted();
if (locomotive == null) {
JOptionPane.showMessageDialog(null, "No deleted objects");
}
if (locomotive != null) {
JDialog dialog = new JDialog(formFrame, "Deleted", true);
FormLocomotive formLocomotive = new FormLocomotive(dialog);

View File

@ -48,7 +48,7 @@ public class MapWithSetLocomotivesGeneric
{
T temp = this._setLocomotives.Remove(position);
if (temp == null) return null;
if (temp instanceof DrawningObjectLocomotive) deletedLocomotives.add((DrawningObjectLocomotive) temp);
deletedLocomotives.add((DrawningObjectLocomotive) temp);
return temp;
}
/// Вывод всего набора объектов