diff --git a/Tank/src/DrawingTank.java b/Tank/src/DrawingTank.java index edcc883..1dffe39 100644 --- a/Tank/src/DrawingTank.java +++ b/Tank/src/DrawingTank.java @@ -4,10 +4,11 @@ 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); - _TankWidth = ((EntityTank) ArmoVehicle).BodyKit ? 169 : 83; + _TankWidth = ((EntityTank)ArmoVehicle).BodyKit ? 169 : 83; this.OrnamentAdd = ornamentAdd; } @@ -20,8 +21,8 @@ public class DrawingTank extends DrawingArmoVehicle { } public void SetPosition(int x, int y) { - _startPosX = Math.min(x, _pictureWidth - _TankWidth); - _startPosY = Math.min(y, _pictureHeight - _TankHeight); + _startPosX = Math.min(x, _pictureWidth-_TankWidth); + _startPosY = Math.min(y, _pictureHeight-_TankHeight); } private boolean setOrnamentAdd() { diff --git a/Tank/src/FormTankCollection.java b/Tank/src/FormTankCollection.java index d902c7f..3c893fd 100644 --- a/Tank/src/FormTankCollection.java +++ b/Tank/src/FormTankCollection.java @@ -158,8 +158,8 @@ public class FormTankCollection { } ); - JButton toForm4GenericDopClass = new JButton("Генерация"); - toForm4GenericDopClass.addActionListener( + JButton toFormTankGenerate = new JButton("Генерация"); + toFormTankGenerate.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { FormTankGenerate formTankGenerate = new FormTankGenerate(); @@ -214,7 +214,7 @@ public class FormTankCollection { TextBoxNumber.setBounds(pictureBoxWidth - 10, 50, 170, 30); ButtonRemoveTank.setBounds(pictureBoxWidth - 10, 90, 170, 30); ButtonRefreshCollection.setBounds(pictureBoxWidth - 10, 130, 170, 30); - toForm4GenericDopClass.setBounds(pictureBoxWidth - 10, 170, 170, 30); + toFormTankGenerate.setBounds(pictureBoxWidth - 10, 170, 170, 30); buttonAddSet.setBounds(pictureBoxWidth - 10, 210, 170, 20); textBoxSetName.setBounds(pictureBoxWidth - 10, 240, 170, 20); @@ -228,15 +228,12 @@ public class FormTankCollection { Frame.add(ButtonRemoveTank); Frame.add(ButtonRefreshCollection); Frame.add(TextBoxNumber); - Frame.add(toForm4GenericDopClass); - + Frame.add(toFormTankGenerate); Frame.add(buttonAddSet); Frame.add(textBoxSetName); Frame.add(jListStorage); Frame.add(buttonRemoveSet); - Frame.add(buttonGetRemoved); - Frame.setVisible(true); } } \ No newline at end of file diff --git a/Tank/src/SetGeneric.java b/Tank/src/SetGeneric.java index 5877684..7ab88d6 100644 --- a/Tank/src/SetGeneric.java +++ b/Tank/src/SetGeneric.java @@ -8,7 +8,7 @@ public class SetGeneric { // Максимальное количество объектов в списке private final int _maxCount; - // Конструктор + // Конструктор public SetGeneric(int count) { _maxCount = count; _places = new ArrayList(count); diff --git a/Tank/src/TanksGenericCollections.java b/Tank/src/TanksGenericCollections.java index ef95d9a..427d83d 100644 --- a/Tank/src/TanksGenericCollections.java +++ b/Tank/src/TanksGenericCollections.java @@ -3,7 +3,7 @@ import java.awt.image.BufferedImage; public class TanksGenericCollections { - // Ширина и высота окна прорисовки + // Высота и ширина окна прорисовки private int _pictureWidth; private int _pictureHeight; @@ -15,11 +15,11 @@ public class TanksGenericCollections _collection; // Конструтор - public TanksGenericCollections(int picWidth, int picHeight) { - int width = picWidth / _placeSizeWidth; - int height = picHeight / _placeSizeHeight; - _pictureWidth = picWidth; - _pictureHeight = picHeight; + public TanksGenericCollections(int pictureWidth, int pictureHeight) { + int width = pictureWidth / _placeSizeWidth; + int height = pictureHeight / _placeSizeHeight; + _pictureWidth = pictureWidth; + _pictureHeight = pictureHeight; _collection = new SetGeneric(width * height); }