diff --git a/src/DrawingField.java b/src/DrawingField.java
new file mode 100644
index 0000000..b46e965
--- /dev/null
+++ b/src/DrawingField.java
@@ -0,0 +1,63 @@
+import javax.swing.*;
+import java.awt.*;
+import java.util.Random;
+
+public class DrawingField extends JPanel{
+ private final FormWarship Field;
+ DrawingWarship _warship=null;
+ public DrawingField(FormWarship field) {
+ Field = field;
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ super.paintComponent(g);
+ Graphics2D g2 =(Graphics2D)g;
+ if (_warship!=null)
+ _warship.DrawTransport(g2);
+ else return;
+ }
+ public void DirectionButtonAction(Direction side){
+ if(_warship == null)
+ return;
+ _warship.MoveTransport(side);
+ }
+ private void SetData() {
+ Random rand=new Random();
+ _warship.SetPosition(rand.nextInt(100)+10,rand.nextInt(100)+10,getWidth(),getHeight());
+ Field.SpeedLabel.setText("Скорость: "+_warship.GetWarship().GetSpeed());
+ Field.WeightLabel.setText("Вес: "+_warship.GetWarship().GetWeight());
+ Field.BodyColorLabel.setText("Цвет: "+Integer.toHexString(_warship.GetWarship().GetBodyColor().getRGB()).substring(2));
+ }
+ public void CreateButtonAction(){
+ Random rand=new Random();
+ Color color1 = JColorChooser.showDialog(Field, "Выберите цвет тела корабля", null);
+ if(color1==null)
+ color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
+ _warship=new DrawingWarship(rand.nextInt(50)+10,rand.nextInt(3000)+20000,color1,rand.nextInt(3));
+ SetData();
+ }
+ public void CreateModifButtonAction(){
+ Random rand=new Random();
+ Color color1=JColorChooser.showDialog(Field, "Выберите цвет тела корабля",null);
+ Color color2=JColorChooser.showDialog(Field, "Выборите цвет модификаций корабля",null);
+ if(color1==null)
+ color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
+ if (color2==null)
+ color2=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
+ _warship = new DrawingAdvancedWarship(rand.nextInt(50) + 10, rand.nextInt(3000) + 20000, color1,
+ color2, rand.nextBoolean(), rand.nextBoolean(), rand.nextBoolean(),rand.nextInt(3));
+ SetData();
+ }
+ public void ResizeField(){
+ if (_warship!=null)
+ _warship.ChangeBorders(getWidth(),getHeight());
+ else return;
+ }
+
+ public void Draw(Graphics2D graphics) {
+ if (_warship!=null)
+ _warship.DrawTransport(graphics);
+ else return;
+ }
+}
diff --git a/src/FormMap.form b/src/FormMap.form
index 0617004..ebc0e7f 100644
--- a/src/FormMap.form
+++ b/src/FormMap.form
@@ -170,15 +170,6 @@
-