From b79b037e9e092b719555c024d328b9fb9d3c06ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=91=D0=B5=D0=BB?= =?UTF-8?q?=D1=8F=D0=BD=D0=B8=D0=BD?= Date: Thu, 30 Nov 2023 20:28:42 +0400 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=BE=D1=82=D0=BE=D0=B2=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=BD?= =?UTF-8?q?=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tank/Tank.iml | 11 +++++++++++ Tank/src/DrawingTank.java | 2 ++ Tank/src/FormTankCollection.java | 28 ++++++++++++++-------------- 3 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 Tank/Tank.iml diff --git a/Tank/Tank.iml b/Tank/Tank.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Tank/Tank.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Tank/src/DrawingTank.java b/Tank/src/DrawingTank.java index 14d971c..1e319fa 100644 --- a/Tank/src/DrawingTank.java +++ b/Tank/src/DrawingTank.java @@ -4,6 +4,7 @@ public class DrawingTank extends DrawingArmoVehicle { protected IOrnamentForm OrnamentsForm; private boolean OrnamentAdd; + // Конструктор (Инициализация характеристик) public DrawingTank(int speed, double weight, Color bodyColor, int _numWheel, Color additionalColor, boolean bodyKit, boolean caterpillar, boolean tower, int width, int height, boolean ornamentAdd) { super(speed, weight, bodyColor, _numWheel, width, height); ArmoVehicle = new EntityTank(speed, weight, bodyColor, _numWheel, additionalColor, bodyKit, caterpillar, tower); @@ -12,6 +13,7 @@ public class DrawingTank extends DrawingArmoVehicle { this.OrnamentAdd = ornamentAdd; } + // Ещё один конструктор public DrawingTank(int speed, float weight, Color bodyColor, int _numWheel, Color additionalColor, boolean bodyKit, boolean caterpillar, boolean tower, int width, int height) { super(speed, weight, bodyColor, _numWheel, width, height); ArmoVehicle=new EntityTank(speed,weight,bodyColor,_numWheel, additionalColor,bodyKit,caterpillar, tower); diff --git a/Tank/src/FormTankCollection.java b/Tank/src/FormTankCollection.java index f0aa8b5..a0b96b0 100644 --- a/Tank/src/FormTankCollection.java +++ b/Tank/src/FormTankCollection.java @@ -152,14 +152,14 @@ public class FormTankCollection { JButton ButtonRefreshCollection = new JButton("Обновить коллекцию"); ButtonRefreshCollection.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(ActionEvent e){ Draw(); } } ); - JButton FormTankGenerate = new JButton("Генерация"); - FormTankGenerate.addActionListener( + JButton toFormTankGenerate = new JButton("Генерировать технику"); + toFormTankGenerate.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { FormTankGenerate formTankGenerate = new FormTankGenerate(); @@ -210,25 +210,25 @@ public class FormTankCollection { Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Frame.setLayout(null); canv.setBounds(0, 0, pictureBoxWidth, pictureBoxHeight); - ButtonAddVehicle.setBounds(pictureBoxWidth, 0, 160, 20); - TextBoxNumber.setBounds(pictureBoxWidth, 30, 160, 20); - ButtonRemoveTank.setBounds(pictureBoxWidth, 60, 160, 20); - ButtonRefreshCollection.setBounds(pictureBoxWidth, 90, 160, 20); - FormTankGenerate.setBounds(pictureBoxWidth, 120, 160, 20); + ButtonAddVehicle.setBounds(pictureBoxWidth - 10, 10, 170, 30); + TextBoxNumber.setBounds(pictureBoxWidth - 10, 50, 170, 30); + ButtonRemoveTank.setBounds(pictureBoxWidth - 10, 90, 170, 30); + ButtonRefreshCollection.setBounds(pictureBoxWidth - 10, 130, 170, 30); + toFormTankGenerate.setBounds(pictureBoxWidth - 10, 170, 170, 30); - buttonAddSet.setBounds(pictureBoxWidth, 150, 160, 20); - textBoxSetName.setBounds(pictureBoxWidth, 180, 160, 20); - jListStorage.setBounds(pictureBoxWidth, 210, 160, 80); - buttonRemoveSet.setBounds(pictureBoxWidth, 300, 160, 20); + buttonAddSet.setBounds(pictureBoxWidth - 10, 210, 170, 20); + textBoxSetName.setBounds(pictureBoxWidth - 10, 240, 170, 20); + jListStorage.setBounds(pictureBoxWidth - 10, 270, 170, 80); + buttonRemoveSet.setBounds(pictureBoxWidth - 10, 360, 170, 20); - buttonGetRemoved.setBounds(pictureBoxWidth, 330, 160, 20); + buttonGetRemoved.setBounds(pictureBoxWidth - 10, 390, 170, 20); Frame.add(canv); Frame.add(ButtonAddVehicle); Frame.add(ButtonRemoveTank); Frame.add(ButtonRefreshCollection); Frame.add(TextBoxNumber); - Frame.add(FormTankGenerate); + Frame.add(toFormTankGenerate); Frame.add(buttonAddSet); Frame.add(textBoxSetName);