финал
This commit is contained in:
parent
7dd4ec395c
commit
f3bf50d05f
@ -247,7 +247,7 @@ public class FormAirplaneCollection {
|
||||
Draw();
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(null, "Не удалось добавить объект", "Информация", JOptionPane.INFORMATION_MESSAGE);
|
||||
|
||||
_logger.warn("Не удалось добавить объект " );
|
||||
}
|
||||
form.frameConfig.dispose();
|
||||
Draw();
|
||||
@ -283,13 +283,18 @@ public class FormAirplaneCollection {
|
||||
String tmp = airplaneNumb.getText();
|
||||
int numb=Integer.parseInt(tmp);
|
||||
try {
|
||||
DrawningAirplane curAirplane = _airplanes.Get(numb);
|
||||
_trashCollection.Push(curAirplane);
|
||||
_airplanes.Remove(numb);
|
||||
_airplanes.ShowAirplanes();
|
||||
JOptionPane.showMessageDialog(null, "Объект удален", "Информация", JOptionPane.INFORMATION_MESSAGE);
|
||||
Draw();
|
||||
_logger.info("Удален объект по позиции " + numb);
|
||||
if (_airplanes.Get(numb)!=null){
|
||||
DrawningAirplane curAirplane = _airplanes.Get(numb);
|
||||
_trashCollection.Push(curAirplane);
|
||||
_airplanes.Remove(numb);
|
||||
_airplanes.ShowAirplanes();
|
||||
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());
|
||||
|
Loading…
Reference in New Issue
Block a user