финал

This commit is contained in:
antoc0der 2023-12-22 09:27:41 +03:00
parent 7dd4ec395c
commit f3bf50d05f

View File

@ -247,7 +247,7 @@ public class FormAirplaneCollection {
Draw();
} else {
JOptionPane.showMessageDialog(null, "Не удалось добавить объект", "Информация", JOptionPane.INFORMATION_MESSAGE);
_logger.warn("Не удалось добавить объект " );
}
form.frameConfig.dispose();
Draw();
@ -283,6 +283,7 @@ public class FormAirplaneCollection {
String tmp = airplaneNumb.getText();
int numb=Integer.parseInt(tmp);
try {
if (_airplanes.Get(numb)!=null){
DrawningAirplane curAirplane = _airplanes.Get(numb);
_trashCollection.Push(curAirplane);
_airplanes.Remove(numb);
@ -290,6 +291,10 @@ public class FormAirplaneCollection {
JOptionPane.showMessageDialog(null, "Объект удален", "Информация", JOptionPane.INFORMATION_MESSAGE);
Draw();
_logger.info("Удален объект по позиции " + numb);
} else{
throw new AirplaneNotFoundException(numb);
}
} catch (AirplaneNotFoundException ex) {
JOptionPane.showMessageDialog(null, ex.getMessage());
_logger.warn("Не удалось удалить объект" + ex.getMessage());