From 44a103ee4cb0fd6aa30fc4f08024b810d898dd8f 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: Sun, 12 Nov 2023 22:28:13 +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=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tank/src/FormTankGenerate.java | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Tank/src/FormTankGenerate.java b/Tank/src/FormTankGenerate.java index 3d9c91d..48ecab1 100644 --- a/Tank/src/FormTankGenerate.java +++ b/Tank/src/FormTankGenerate.java @@ -6,24 +6,24 @@ import java.awt.event.ActionListener; public class FormTankGenerate extends JFrame { static int pictureBoxWidth = 560; static int pictureBoxHeight = 560; - public DrawingArmoVehicle _drawingTank; + public DrawingArmoVehicle _drawingVehicle; private class Canvas extends JComponent{ public Canvas() { } public void paintComponent (Graphics g){ - if (_drawingTank == null){ + if (_drawingVehicle == null){ return; } super.paintComponents (g) ; Graphics2D g2d = (Graphics2D)g; - _drawingTank.SetPosition(250, 250); - _drawingTank.DrawTransport(g2d); + _drawingVehicle.SetPosition(250, 250); + _drawingVehicle.DrawTransport(g2d); super.repaint(); } } DoubleParametrized genericTankGenerate; public FormTankGenerate(){ - _drawingTank = null; + _drawingVehicle = null; Canvas canv = new Canvas(); setSize (640, 640); setLayout(null); @@ -37,19 +37,19 @@ public class FormTankGenerate extends JFrame { genericTankGenerate.Add(new DrawingStarOrnament()); genericTankGenerate.Add(new DrawingWheelsCombination()); - JButton creatButton = new JButton("Сгенерировать"); - creatButton.addActionListener( - new ActionListener() { - public void actionPerformed(ActionEvent e){ - _drawingTank = genericTankGenerate.GenerateTank(pictureBoxWidth,pictureBoxHeight); - canv.repaint(); - } - } + JButton createButton = new JButton("Сгенерировать"); + createButton.addActionListener( + new ActionListener() { + public void actionPerformed(ActionEvent e){ + _drawingVehicle = genericTankGenerate.GenerateTank(pictureBoxWidth,pictureBoxHeight); + canv.repaint(); + } + } ); - creatButton.setBounds(pictureBoxWidth/2 - 40, pictureBoxHeight-20, 180, 20); + createButton.setBounds(pictureBoxWidth/2 - 40, pictureBoxHeight-20, 180, 20); add(canv); - add(creatButton); + add(createButton); setVisible(true); } } \ No newline at end of file