From bbffa9f7306293c125e306419f1bc51cecca4455 Mon Sep 17 00:00:00 2001 From: DjonniStorm Date: Sun, 17 Mar 2024 18:39:01 +0400 Subject: [PATCH 1/2] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=20=E2=84=961=20(1=20=D1=87=D0=B0=D1=81=D1=82=D1=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectCleaningCar/.idea/uiDesigner.xml | 124 ++++++++++++++++++ ProjectCleaningCar/ProjectCleaningCar.iml | 1 + ProjectCleaningCar/Resources/Arrow_Down.png | Bin 0 -> 3464 bytes ProjectCleaningCar/Resources/Arrow_Left.png | Bin 0 -> 3479 bytes ProjectCleaningCar/Resources/Arrow_Right.png | Bin 0 -> 3471 bytes ProjectCleaningCar/Resources/Arrow_Up.png | Bin 0 -> 3031 bytes ProjectCleaningCar/src/DirectionType.java | 6 + .../src/DrawningCleaningCar.java | 115 ++++++++++++++++ ProjectCleaningCar/src/EntityCleaningCar.java | 45 +++++++ ProjectCleaningCar/src/FormCleaningCar.form | 84 ++++++++++++ ProjectCleaningCar/src/FormCleaningCar.java | 101 ++++++++++++++ ProjectCleaningCar/src/Main.java | 22 ++-- 12 files changed, 486 insertions(+), 12 deletions(-) create mode 100644 ProjectCleaningCar/.idea/uiDesigner.xml create mode 100644 ProjectCleaningCar/Resources/Arrow_Down.png create mode 100644 ProjectCleaningCar/Resources/Arrow_Left.png create mode 100644 ProjectCleaningCar/Resources/Arrow_Right.png create mode 100644 ProjectCleaningCar/Resources/Arrow_Up.png create mode 100644 ProjectCleaningCar/src/DirectionType.java create mode 100644 ProjectCleaningCar/src/DrawningCleaningCar.java create mode 100644 ProjectCleaningCar/src/EntityCleaningCar.java create mode 100644 ProjectCleaningCar/src/FormCleaningCar.form create mode 100644 ProjectCleaningCar/src/FormCleaningCar.java diff --git a/ProjectCleaningCar/.idea/uiDesigner.xml b/ProjectCleaningCar/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/ProjectCleaningCar/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProjectCleaningCar/ProjectCleaningCar.iml b/ProjectCleaningCar/ProjectCleaningCar.iml index c90834f..d5b343a 100644 --- a/ProjectCleaningCar/ProjectCleaningCar.iml +++ b/ProjectCleaningCar/ProjectCleaningCar.iml @@ -3,6 +3,7 @@ + diff --git a/ProjectCleaningCar/Resources/Arrow_Down.png b/ProjectCleaningCar/Resources/Arrow_Down.png new file mode 100644 index 0000000000000000000000000000000000000000..4c2c5d97d3c523a150032dca4617c2cdce4e72c1 GIT binary patch literal 3464 zcmZ`+2{6=u8~?GiD@WFqvt8?qmR&@agXXf+F=kv@n-FhIlgo2$2SWh!_CaJ*FaN0Kgvw0Dn6I0456nPJ8FRx6nLJ zoVaOXfCY~JIZx}0(vBH6Z^P>p0O0!kPcVJ;dON8!-OR3V0N}7R z!s=MLjxY%B9(Mgcht3_ffj1;C$18T*S)59U|D#`G{5`1<5+5aC=n7;!SA!V4L}o`q0jfKQJsSXl6+V)w6KF_s`1C?7Kw zf^FThL1#glZK#m28zA_Xifpy})Q^M&vmDj20hcG26*B9b?)V`cAGYv4Y{A}Dd z)Mb>nve>?`@Y+(Ja@+^Rgs1@aDk_4Kfq&WSEk_f!S4DX>9taQ!gplMdvAtV@_l2NP zs39u{6d;yR0fIc@d24k9zzr>-d@~1YYHIHHOGrp`_U4# zOCqx9EH?503()?Cg_f%Qh2FyfO@Kpqs%P-Lf>8SA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T3MLnI{FlJfi*(C5`2Pza7ht}}0@?pm@Vn(nruaE|djAiN(!Yy* Ut5iH*r2xR_@)c~Uu4B}{0EzxaQvd(} literal 0 HcmV?d00001 diff --git a/ProjectCleaningCar/Resources/Arrow_Left.png b/ProjectCleaningCar/Resources/Arrow_Left.png new file mode 100644 index 0000000000000000000000000000000000000000..c37001bb4e2ccb15aeb2990734ca80c4f63e72a8 GIT binary patch literal 3479 zcmZ`+3oz7g+x}r=*P>nLq?V1G*+pBSELJ&FDMSwIkaD(i$Z2gW>$E~dR#r|?QbZ0p zv;1=|R>@)gBSoUWGqLZ!-#7Ekd^7Jm&)m;Fb3NB}-_JZV*E4e`+E`r_)Y6#mI}colOFZV$a4Y}_ z;7xG`w%*gr*L{4QdhQ$y<~F3w6O=B%OwXC6*BPZ>dSM^>cp}K-EyM?#^>Z}Ip4*KdK74q_ zt+Env^r+)`J-v6IoFtsdz8L7t*4VMI$=~zlkJQx=l9Jzp2ho6OM)C0I=o=2@0y#$J07>L%Dml#N7S#^>5WZVgM)z+0VHW zhgNhk?P*yVUvqP_Bx0zryu94sm9?)S!Jm1D1Xfig@|qZR-2)Rð*mY|iTetS@p5U;^Vl6w!eeJeU8CB?Nn zNo+Uu^z`=9!GTuntib19obtNE@tKb8kNT>t*4WD5VUgMbSPNI5zq`NP-A4jgN5`YK zNfzpl)-vTry7B1`tCfeb^f;+jN}ERemLYH)5C#UNYCbttS(B4aOxF5HJkHA-Z`u3R zG{gvUik$6;SBJ9*$J#m_1#Z7-p9tl#2Q;;``WK*D6W3Lpl-!$3!3tK=Jgn94?rClw z+j>dehRZ)bmSIGnKC_Z`&CmQM5Bar&Cttro65%4t0>#oNa(X96$Ksn>m{50B8X<77 z!yf8mao5u6`lBOyVmH9VVuNd-K?sdN1PnEeY`Xcc`*@Imjk$X{aDqUO_>L2oNQ0?j z$*W(`f&_egp8u}u-)9)+8vE-L$n6+_IGQxC;tze-$b>E=G`hy;5KkSm${y|h?ks4+ za?JwJK=3U%_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hw574E&y05}Uf^LkSc+W!EFAUV7M literal 0 HcmV?d00001 diff --git a/ProjectCleaningCar/Resources/Arrow_Up.png b/ProjectCleaningCar/Resources/Arrow_Up.png new file mode 100644 index 0000000000000000000000000000000000000000..0d7fa85dab2e17ff162d17ffa000fad59e28b9d4 GIT binary patch literal 3031 zcmV;|3n=u7P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3v5Y5K~!i%-CBEa z71bI4&c5#6M{*MqNJ2s^L7p)IQf!NgI9R9!+m6`A3R8#9sI8BgQfTXdt%|MF&NyxD zw4I34I{l+kYEc7>GqlvUn1GcI4vMCNAmoyp_nX}3?w-@{+q=Y&2E)C(j10fb$(}uX z&e`)jzwbNe+uh5A5OB3Xa*kI8E~_%wx7O3sQx}iN!vzHe9hi<$apvk}0Fk*|$uNxK zM;>|PUrUxOi8VAd`~l0<@pZgRm&?qkUm5$?ySuydyE;1q0|Wi}Sf)DZvfTHwnAz#m zr&qr6@=Ny&4Gx9>`nP{Bi*~dY)Yeo-mfdvAA)oH!>(;INbxBFdzn$vdVZ2mcq^72( zZ_U1TmZ+#G6{Y2sqHIPPufSvFj7m{cQ)9NYwA?vSJGaR*xv?{J_U^jY*4E{yObrLd zeX38~c%32EeAa~8SzJhH2b>El5{b+|bLPx4G{HJ-Drb6d56{djolci**|KHV>#sL0 zOe7N8z_~%KC@&2STLBi&G2zeuP~pc73{0*;VL?G$(=@(z?b;@6a~C!r$@Jn5UMNE| z>%$c2=^hGqw|C^FMg}#%kAq(a@T&&sN*Z)oKtMGiq$FWzurJuz70nwS9tu%AOn#>y zS8%P&i4!N*?B2cmo3Yq%aNoZDOWUHY;g!oIvF=L@G(|v7^*IO!4QM+Xgb!L27*1=@ zuv3P2BWX5&-h!?bE0(_*^y%rl?_U4&($X?_i^6&5$u+(D>Z_Y)&YUS`R9qv0HKQxP{$P38Plm>V5BH#${robqvgMB_b8g}i=6DK9TA=hJ6Q7ZsHiqWZd8niE${tjvJnr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W;G$ z@(EQdG#-2Whuf=W&V0wTXf+@qYzN{JlMM-j25gFV6*7)XrEwM)7f0vKoA)wW4cfB< zBI72#_S$RrRaISUUB7r5Ke4w+h_^}vZz&MG7mcuw3A0P)W+x@ZeiTTztDL_b7UD>; zIQV?Am_4hE*VZmdzSq+7m5KV#CQTXvOa@x*2w7QJ#wkW&nx=%0-S}MU4z9_d%-Qjn z0643RqX{{uIm0y>8VE@|Ij9b%QBg7(S}8FxPCnuit~)?@(FaZn#yBqFg)%a!q2p;OL#)Y$-0AUD&F{v zH)K5M#WSCAJ+bt#;}V{bakB1kr6}WM-Qj9d=8A{_E=nfbpVYHI# zZya=U@)>;i7Yaz3SEDZAi82B$#ImeQ@?~40OwRt228;x;-(`#!ENgh74E`5LMh4TQ z?#7I10(P`H3VZMp2zpg!`H_?Y7<*?bxPWUi+C*e7n zA|=XWnf+r1+f8WCrAty;Q?-7(#04(#4gSUP;)^dn_~1j|{%t5I^R+i~QCcW5jtdjl z9MiFPkMs9nAj?>oP=OY;(;Wi#9%52{xai!jzr1{Vb#?XYPQ{$yn#|6fJ0H6L{(FBD z2>QV==~qiQ_4ZOtGoGoFxdr{pkg>n8qiIT*R}~4u;c$G{uEy2X3#uplzJIB3O=i!Y zJ@;1Kev9)oVf?7 zJXg3TGcqzVt+%(g%--h5A+v1b$enwPKPOO`BuQf0v}tEFP5ap2#!Lp+WUeHTU0fvq Z_#e+fDnxPZ _pictureWidth) + { + _startPosX = -_drawningCarWidth + _pictureWidth; + } + else if (_startPosX < 0) + { + _startPosX = 0; + } + if (_startPosY + _drawningCarHeight > _pictureHeight) + { + _startPosY = -_drawningCarHeight + _pictureHeight; + } + else if (_startPosY < 0) + { + _startPosY = 0; + } + } + return true; + } + public void SetPosition(int x, int y) { + if (_pictureHeight == null || _pictureWidth == null) return; + if (x + _drawningCarWidth > _pictureWidth) { + _startPosX = _pictureWidth - _drawningCarWidth; + } else if (x < 0) { + _startPosX = 0; + } + else { + _startPosX = x; + } + if (y + _drawningCarHeight > _pictureHeight) { + _startPosY = _pictureHeight - _drawningCarHeight; + } else if (y < 0) { + _startPosY = 0; + } else { + _startPosY = y; + } + } + public boolean MoveTransport(DirectionType directionType) { + if (EntityCleaningCar == null || _startPosX == null || _startPosY == null) { + return false; + } + switch (directionType) { + case Left: + if (_startPosX - EntityCleaningCar.Step() > 0) { + _startPosX -= (int) EntityCleaningCar.Step(); + } + return true; + case Right: + if (_startPosX + _drawningCarWidth + EntityCleaningCar.Step() < _pictureWidth) { + _startPosX += (int) EntityCleaningCar.Step(); + } + return true; + case Up: + if (_startPosY - EntityCleaningCar.Step() > 0) { + _startPosY -= (int) EntityCleaningCar.Step(); + } + return true; + case Down: + if (_startPosY + _drawningCarHeight + EntityCleaningCar.Step() < _pictureHeight) { + _startPosY += (int) EntityCleaningCar.Step(); + } + return true; + default: + return false; + } + } + public void DrawTransport(Graphics g) { + if (EntityCleaningCar == null || _startPosX == null || _startPosY == null) { + return; + } + Graphics2D g2d = (Graphics2D) g; + if (EntityCleaningCar.getTank()) { + g2d.setColor(EntityCleaningCar.getAdditionalColor()); + g2d.drawRect(_startPosX, _startPosY, 100, 38); + g2d.fillRect(_startPosX, _startPosY, 100, 38); + } + if (EntityCleaningCar.getSweepingBrush()) { + g2d.setColor(EntityCleaningCar.getAdditionalColor()); + } + if (EntityCleaningCar.getFlashLight()) { + g2d.setColor(EntityCleaningCar.getAdditionalColor()); + } + g2d.setColor(EntityCleaningCar.getBodyColor()); + g2d.fillRect(_startPosX, _startPosY + 40, 125, 10); + g2d.fillRect(_startPosX + 100, _startPosY + 10, 20, 30); + + } +} diff --git a/ProjectCleaningCar/src/EntityCleaningCar.java b/ProjectCleaningCar/src/EntityCleaningCar.java new file mode 100644 index 0000000..34e84cf --- /dev/null +++ b/ProjectCleaningCar/src/EntityCleaningCar.java @@ -0,0 +1,45 @@ +import java.awt.*; + +public class EntityCleaningCar { + private int Speed; + public int getSpeed() { + return Speed; + } + private double Weight; + public double getWeight() { + return Weight; + } + private Color BodyColor; + public Color getBodyColor() { + return BodyColor; + } + private Color AdditionalColor; + public Color getAdditionalColor() { + return AdditionalColor; + } + private boolean Tank; + public boolean getTank() { + return Tank; + } + private boolean SweepingBrush; + public boolean getSweepingBrush() { + return SweepingBrush; + } + private boolean FlashLight; + public boolean getFlashLight() { + return FlashLight; + } + public double Step() { + return Speed * 200 / Weight; + } + public void Init(int speed, double weight, Color bodyColor, Color additionalColor, boolean tank, boolean sweepingBrush, boolean flashLight) { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + AdditionalColor = additionalColor; + Tank = tank; + SweepingBrush = sweepingBrush; + FlashLight = flashLight; + } + +} diff --git a/ProjectCleaningCar/src/FormCleaningCar.form b/ProjectCleaningCar/src/FormCleaningCar.form new file mode 100644 index 0000000..55e2f3f --- /dev/null +++ b/ProjectCleaningCar/src/FormCleaningCar.form @@ -0,0 +1,84 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/ProjectCleaningCar/src/FormCleaningCar.java b/ProjectCleaningCar/src/FormCleaningCar.java new file mode 100644 index 0000000..17e1600 --- /dev/null +++ b/ProjectCleaningCar/src/FormCleaningCar.java @@ -0,0 +1,101 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Random; +import java.util.List; +import java.util.LinkedList; + +public class FormCleaningCar extends JFrame { + protected DrawningCleaningCar _drawningCleaningCar = new DrawningCleaningCar(); + JPanel pictureBox; + private JButton buttonCreate; + private JButton buttonRight; + private JButton buttonLeft; + private JButton buttonDown; + private JButton buttonUp; + private List controls; + + public FormCleaningCar() { + buttonUp.setName("buttonUp"); + buttonDown.setName("buttonDown"); + buttonLeft.setName("buttonLeft"); + buttonRight.setName("buttonRight"); + InitializeControlsRepaintList(); + + buttonCreate.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + Random random = new Random(); + _drawningCleaningCar.Init(random.nextInt(100, 300), random.nextInt(1000, 3000), + new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)), + new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)), + random.nextBoolean(), + random.nextBoolean(), + random.nextBoolean()); + _drawningCleaningCar.SetPictureSize(pictureBox.getWidth(), pictureBox.getHeight()); + _drawningCleaningCar.SetPosition(random.nextInt(0, 200), random.nextInt(0, 200)); + Draw(); + } + }); + ActionListener buttonMoveClickedListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + String buttonName = ((JButton) e.getSource()).getName(); + boolean result = false; + + switch (buttonName) { + case "buttonUp": { + result = _drawningCleaningCar.MoveTransport(DirectionType.Up); + } + break; + case "buttonDown": { + result = _drawningCleaningCar.MoveTransport(DirectionType.Down); + } + break; + case "buttonLeft": { + result = _drawningCleaningCar.MoveTransport(DirectionType.Left); + } + break; + case "buttonRight": { + result = _drawningCleaningCar.MoveTransport(DirectionType.Right); + } + break; + + } + if (result) + Draw(); + + } + }; + buttonRight.addActionListener(buttonMoveClickedListener); + buttonDown.addActionListener(buttonMoveClickedListener); + buttonLeft.addActionListener(buttonMoveClickedListener); + buttonUp.addActionListener(buttonMoveClickedListener); + } + private void Draw() { + if (_drawningCleaningCar.getEntityCleaningCar() == null || + pictureBox.getWidth() == 0 || pictureBox.getHeight() == 0) + return; + Graphics g = pictureBox.getGraphics(); + g.setColor(pictureBox.getBackground()); + g.fillRect(0,0, pictureBox.getWidth(), pictureBox.getHeight()); + _drawningCleaningCar.DrawTransport(g); + + RepaintControls(); + + } + private void RepaintControls() { + for (JComponent control : controls) { + control.repaint(); + } + } + private void InitializeControlsRepaintList() { + controls = new LinkedList<>(); + controls.add(buttonCreate); + controls.add(buttonUp); + controls.add(buttonDown); + controls.add(buttonLeft); + controls.add(buttonRight); + } +} \ No newline at end of file diff --git a/ProjectCleaningCar/src/Main.java b/ProjectCleaningCar/src/Main.java index 930198c..76b742d 100644 --- a/ProjectCleaningCar/src/Main.java +++ b/ProjectCleaningCar/src/Main.java @@ -1,15 +1,13 @@ -//TIP To Run code, press or -// click the icon in the gutter. -public class Main { +import javax.swing.*; +class Main { public static void main(String[] args) { - //TIP Press with your caret at the highlighted text - // to see how IntelliJ IDEA suggests fixing it. - System.out.printf("Hello and welcome!"); - - for (int i = 1; i <= 5; i++) { - //TIP Press to start debugging your code. We have set one breakpoint - // for you, but you can always add more by pressing . - System.out.println("i = " + i); - } + JFrame.setDefaultLookAndFeelDecorated(false); + JFrame frame = new JFrame("Project Cleaning Car"); + frame.setContentPane(new FormCleaningCar().pictureBox); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setLocation(200, 200); + frame.pack(); + frame.setSize(1000, 600); + frame.setVisible(true); } } \ No newline at end of file -- 2.25.1 From 27a627d610a7df8b33216bac05a776832ca66cea Mon Sep 17 00:00:00 2001 From: DjonniStorm Date: Sun, 17 Mar 2024 23:22:09 +0400 Subject: [PATCH 2/2] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=20=E2=84=961=20(2=20=D1=87=D0=B0=D1=81=D1=82=D1=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectCleaningCar/src/CountWheels.java | 12 +++++++ .../src/DrawningCleaningCar.java | 35 ++++++++++++++++--- ProjectCleaningCar/src/DrawningWheels.java | 25 +++++++++++++ 3 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 ProjectCleaningCar/src/CountWheels.java create mode 100644 ProjectCleaningCar/src/DrawningWheels.java diff --git a/ProjectCleaningCar/src/CountWheels.java b/ProjectCleaningCar/src/CountWheels.java new file mode 100644 index 0000000..0b4114c --- /dev/null +++ b/ProjectCleaningCar/src/CountWheels.java @@ -0,0 +1,12 @@ +public enum CountWheels { + One(1), + Two(2), + Three(3); + public final int count; + CountWheels(int count) { + this.count = count; + } + public int getCountWheels() { + return count; + } +} diff --git a/ProjectCleaningCar/src/DrawningCleaningCar.java b/ProjectCleaningCar/src/DrawningCleaningCar.java index e47c4fc..486434c 100644 --- a/ProjectCleaningCar/src/DrawningCleaningCar.java +++ b/ProjectCleaningCar/src/DrawningCleaningCar.java @@ -1,4 +1,6 @@ import java.awt.*; +import java.util.Random; + public class DrawningCleaningCar { private EntityCleaningCar EntityCleaningCar; public EntityCleaningCar getEntityCleaningCar() { @@ -8,8 +10,9 @@ public class DrawningCleaningCar { private Integer _pictureHeight; private Integer _startPosX; private Integer _startPosY; - private final Integer _drawningCarWidth = 135; - private final Integer _drawningCarHeight = 60; + private final Integer _drawningCarWidth = 138; + private final Integer _drawningCarHeight = 68; + public DrawningWheels drawningWheels; public void Init(int speed, double weight, Color bodyColor, Color additionalColor, boolean tank, boolean sweepingBrush, boolean flashlight) { EntityCleaningCar = new EntityCleaningCar(); @@ -18,6 +21,10 @@ public class DrawningCleaningCar { _pictureHeight = null; _startPosX = null; _startPosY = null; + + drawningWheels = new DrawningWheels(); + Random random = new Random(); + drawningWheels.setCountWheels(random.nextInt(1, 4)); } public boolean SetPictureSize(int width, int height) { if (width < _drawningCarWidth || height < _drawningCarHeight) {return false;} @@ -98,18 +105,36 @@ public class DrawningCleaningCar { Graphics2D g2d = (Graphics2D) g; if (EntityCleaningCar.getTank()) { g2d.setColor(EntityCleaningCar.getAdditionalColor()); - g2d.drawRect(_startPosX, _startPosY, 100, 38); g2d.fillRect(_startPosX, _startPosY, 100, 38); + g2d.setColor(Color.black); + g2d.drawRect(_startPosX, _startPosY, 100, 38); + g2d.setColor(EntityCleaningCar.getBodyColor()); + g2d.fillRect(_startPosX, _startPosY + 20, 100, 10); } if (EntityCleaningCar.getSweepingBrush()) { g2d.setColor(EntityCleaningCar.getAdditionalColor()); + g2d.fillOval(_startPosX + 120, _startPosY + 50, 20, 20); + g2d.setColor(EntityCleaningCar.getBodyColor()); + g2d.fillOval(_startPosX + 125, _startPosY + 55, 10, 10); + g2d.setColor(Color.black); + g2d.drawOval(_startPosX + 120, _startPosY + 50, 19, 19); + g2d.drawOval(_startPosX + 125, _startPosY + 55, 9, 9); + g2d.drawLine(_startPosX + 122, _startPosY + 48, _startPosX + 130, _startPosY + 60); } if (EntityCleaningCar.getFlashLight()) { g2d.setColor(EntityCleaningCar.getAdditionalColor()); + g2d.fillRect(_startPosX + 108, _startPosY + 3, 5, 8); } g2d.setColor(EntityCleaningCar.getBodyColor()); - g2d.fillRect(_startPosX, _startPosY + 40, 125, 10); - g2d.fillRect(_startPosX + 100, _startPosY + 10, 20, 30); + g2d.fillRect(_startPosX, _startPosY + 40, 122, 10); + g2d.fillRect(_startPosX + 102, _startPosY + 10, 20, 30); + drawningWheels.DrawCleaningCarWheels(g, EntityCleaningCar.getBodyColor(), EntityCleaningCar.getAdditionalColor(), _startPosX, _startPosY); + g2d.setColor(Color.black); + + g2d.drawRect(_startPosX, _startPosY + 40, 122, 10); + g2d.drawRect(_startPosX + 102, _startPosY + 10, 20, 30); + + g2d.fillRect(_startPosX + 112, _startPosY + 15, 10, 12); } } diff --git a/ProjectCleaningCar/src/DrawningWheels.java b/ProjectCleaningCar/src/DrawningWheels.java new file mode 100644 index 0000000..652b97c --- /dev/null +++ b/ProjectCleaningCar/src/DrawningWheels.java @@ -0,0 +1,25 @@ +import java.awt.*; + +public class DrawningWheels { + private CountWheels countWheels; + public void setCountWheels(int numWheels) { + for (CountWheels value : CountWheels.values()) { + if (value.getCountWheels() == numWheels) { + countWheels = value; + return; + } + } + } + public void DrawCleaningCarWheels(Graphics g, Color bodyColor, Color additionalColor, int startPosX, int startPosY) { + Graphics2D g2d = (Graphics2D) g; + for (int i = 0; i < countWheels.getCountWheels(); i++) { + g2d.setColor(bodyColor); + g2d.fillOval(startPosX + 10 + 40 * i, startPosY + 50, 20, 20); + g2d.setColor(additionalColor); + g2d.fillOval(startPosX + 15 + 40 * i, startPosY + 55, 10, 10); + g2d.setColor(Color.black); + g2d.drawOval(startPosX + 10 + 40 * i, startPosY + 50, 19, 19); + g2d.drawOval(startPosX + 15 + 40 * i, startPosY + 55, 9, 9); + } + } +} -- 2.25.1