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);