Готовая лабораторная работа 3
This commit is contained in:
parent
4fa99338a4
commit
3707bb2cab
@ -37,7 +37,7 @@ public class DrawingArmoVehicle {
|
||||
OrnamentsForm.setDigit(_numWheel);
|
||||
}
|
||||
|
||||
public DrawingArmoVehicle(EntityArmoVehicle vehicle, IOrnamentForm ornamentsForm, int width, int height) {
|
||||
protected DrawingArmoVehicle(EntityArmoVehicle vehicle, IOrnamentForm ornamentsForm, int width, int height) {
|
||||
if (height < _pictureHeight || width < _pictureWidth)
|
||||
return;
|
||||
_pictureWidth = width;
|
||||
|
@ -3,9 +3,8 @@ import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
|
||||
public class FormTankCollection {
|
||||
private class Canvas extends JComponent{
|
||||
private class Canvas extends JComponent {
|
||||
public TanksGenericCollections<DrawingArmoVehicle, DrawingObjectTank> _tank;
|
||||
public Canvas() {
|
||||
}
|
||||
@ -42,8 +41,7 @@ public class FormTankCollection {
|
||||
if (_tank.Add(form._drawingTank) != -1) {
|
||||
JOptionPane.showMessageDialog(null, "Объект добавлен", "Информация", JOptionPane.INFORMATION_MESSAGE);
|
||||
Draw();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(null, "Не удалось добавить объект", "Информация", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
form.Frame.dispose();
|
||||
@ -76,8 +74,7 @@ public class FormTankCollection {
|
||||
if (_tank.remove(pos) != null) {
|
||||
JOptionPane.showMessageDialog(null, "Объект удален", "Информация", JOptionPane.INFORMATION_MESSAGE);
|
||||
Draw();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(null, "Не удалось удалить объект", "Информация", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
}
|
||||
@ -96,7 +93,7 @@ public class FormTankCollection {
|
||||
JButton toFormTankGenerate = new JButton("Генерировать технику");
|
||||
toFormTankGenerate.addActionListener(
|
||||
new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e){
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
FormTankGenerate formTankGenerate = new FormTankGenerate();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user