From ead0ac06029b015d15f22ff61ca8b39a9aa34dc6 Mon Sep 17 00:00:00 2001 From: ksenianeva <95441235+ksenianeva@users.noreply.github.com> Date: Wed, 21 Dec 2022 19:25:39 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B2=D0=B0=D1=8F=20=D1=83?= =?UTF-8?q?=D1=81=D0=BB=D0=BE=D0=B6=D0=BD=D0=B5=D0=BD=D0=BD=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=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ContainerShip/src/containership/Decks.java | 15 ++ .../src/containership/Direction.java | 16 ++ ContainerShip/src/containership/DownArrow.png | Bin 0 -> 2507 bytes .../src/containership/DrawingDecks.java | 93 ++++++++++ .../src/containership/DrawingShip.java | 112 ++++++++++++ .../src/containership/EntityShip.java | 42 +++++ .../src/containership/JFrame_Ship.form | 155 +++++++++++++++- .../src/containership/JFrame_Ship.java | 166 +++++++++++++++++- ContainerShip/src/containership/LeftArrow.png | Bin 0 -> 2432 bytes ContainerShip/src/containership/MyCanvas.java | 29 +++ .../src/containership/Rightarrow.png | Bin 0 -> 2426 bytes ContainerShip/src/containership/UpArrow.png | Bin 0 -> 2476 bytes 12 files changed, 623 insertions(+), 5 deletions(-) create mode 100644 ContainerShip/src/containership/Decks.java create mode 100644 ContainerShip/src/containership/Direction.java create mode 100644 ContainerShip/src/containership/DownArrow.png create mode 100644 ContainerShip/src/containership/DrawingDecks.java create mode 100644 ContainerShip/src/containership/DrawingShip.java create mode 100644 ContainerShip/src/containership/EntityShip.java create mode 100644 ContainerShip/src/containership/LeftArrow.png create mode 100644 ContainerShip/src/containership/MyCanvas.java create mode 100644 ContainerShip/src/containership/Rightarrow.png create mode 100644 ContainerShip/src/containership/UpArrow.png diff --git a/ContainerShip/src/containership/Decks.java b/ContainerShip/src/containership/Decks.java new file mode 100644 index 0000000..6105f0b --- /dev/null +++ b/ContainerShip/src/containership/Decks.java @@ -0,0 +1,15 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package containership; + +/** + * + * @author ateks + */ +public enum Decks { + ONE, + TWO, + THREE +} diff --git a/ContainerShip/src/containership/Direction.java b/ContainerShip/src/containership/Direction.java new file mode 100644 index 0000000..31e1a60 --- /dev/null +++ b/ContainerShip/src/containership/Direction.java @@ -0,0 +1,16 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package containership; + +/** + * + * @author ateks + */ +public enum Direction { + UP, + DOWN, + LEFT, + RIGHT +} \ No newline at end of file diff --git a/ContainerShip/src/containership/DownArrow.png b/ContainerShip/src/containership/DownArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..dab78c870ec3d27f9e2d905dc4f306afa5ac8ca9 GIT binary patch literal 2507 zcmcImYg7|w8Xll3wFRl{5v)s@4O*p;%uL9Iq{avV0X2Xakth}?GZQi;nF%uki3kO? zTkle7wTde&N0*DBwH&ksN>h(0^rE#`OLaL5#e=qckwxoji^_h(ZF}~#u75Tslli`x z=X<{Aecxx^%=Xme1i$IePlq7LFDWrD4V=To!`B=9?rojx4?$jP+F(eHAz2FrrzOO~ z3owl)Ivj!)?A=%DS$a10H(Nb(;?Gs3`}X%a=dVb$UpccYY3&X;qux+P5li>sH&(oHC!;?9^4=3S zKf4-aJ>XrEeBe*{^?6Xh{M`27-a+4zZe!~$#rff4d1&=gpRo0hnKVz8Wy2q%QfIG9YDf-8;i`Qm1nx(9%!u76xRMT;+A4yEGp^%Vl{j4_TK}vZl=c zEAy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QZnK(-2_0zY6?=KDa*=h9KD;dqN^3BZ017 zPw~wgHy#aL?*Jo1Y;0>wi#a31_xV`(hrYg>UsRgS2j4uo`N-|tjlc>sY47(`4*}I+ zuV-L@a^|dAyLMamvT|d= _pictureWidth ? rd.nextInt(0, _pictureWidth - 1 - _shipWidth) : x; + _startPosY = y + _shipHeight >= _pictureHeight ? rd.nextInt(0, _pictureHeight - 1 - _shipHeight) : y; + } + + public void MoveTransport(Direction direction) + { + if (_pictureWidth == null || _pictureHeight == null) + { + return; + } + switch (direction) + { + case RIGHT: + if (_startPosX + _shipWidth + Ship.Step < _pictureWidth) + { + _startPosX += Ship.Step; + } + break; + case LEFT: + if (_startPosX - Ship.Step > 0) + { + _startPosX -= Ship.Step; + } + break; + case UP: + if (_startPosY - Ship.Step > 0) + { + _startPosY -= Ship.Step; + } + break; + case DOWN: + if (_startPosY + _shipHeight + Ship.Step < _pictureHeight-13) + { + _startPosY += Ship.Step; + } + break; + } + } + + public void DrawTransport(Graphics2D g) + { + if (_startPosX < 0 || _startPosY < 0 + || _pictureHeight == null || _pictureWidth == null) + { + return; + } + int _startPosXInt = (int)_startPosX; + int _startPosYInt = (int)_startPosY; + drawingDecks.drawDecks(g, _startPosXInt, _startPosYInt, Ship.getBodyColor()); + } + public void ChangeBorders(int width, int height) + { + _pictureWidth = width; + _pictureHeight = height; + if (_pictureWidth <= _shipWidth || _pictureHeight <= _shipHeight) + { + _pictureWidth = null; + _pictureHeight = null; + return; + } + if (_startPosX + _shipWidth > _pictureWidth) + { + _startPosX = _pictureWidth - _shipWidth; + } + if (_startPosY + _shipHeight > _pictureHeight) + { + _startPosY = _pictureHeight - _shipHeight; + } + } +} diff --git a/ContainerShip/src/containership/EntityShip.java b/ContainerShip/src/containership/EntityShip.java new file mode 100644 index 0000000..dbc2590 --- /dev/null +++ b/ContainerShip/src/containership/EntityShip.java @@ -0,0 +1,42 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package containership; +import java.awt.Color; +import java.util.Random; +/** + * + * @author ateks + */ +public class EntityShip { + private int Speed; + + private float Weight; + + private Color BodyColor; + + public float Step; + + public int getSpeed() { + return Speed; + } + + public float getWeight() { + return Weight; + } + + public Color getBodyColor() { + return BodyColor; + } + + + + public void Init(int speed, float weight, Color bodyColor){ + Random rnd = new Random(); + Speed = speed <= 0 ? rnd.nextInt(50, 150) : speed; + Weight = weight <= 0 ? rnd.nextInt(40, 70) : weight; + Step = Speed * 100 / Weight; + BodyColor = bodyColor; + } +} diff --git a/ContainerShip/src/containership/JFrame_Ship.form b/ContainerShip/src/containership/JFrame_Ship.form index 769eecd..772a7aa 100644 --- a/ContainerShip/src/containership/JFrame_Ship.form +++ b/ContainerShip/src/containership/JFrame_Ship.form @@ -23,13 +23,164 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ContainerShip/src/containership/JFrame_Ship.java b/ContainerShip/src/containership/JFrame_Ship.java index 92350be..4652f93 100644 --- a/ContainerShip/src/containership/JFrame_Ship.java +++ b/ContainerShip/src/containership/JFrame_Ship.java @@ -3,6 +3,9 @@ * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template */ package containership; +import java.awt.*; +import javax.swing.*; +import java.util.Random; /** * @@ -16,7 +19,7 @@ public class JFrame_Ship extends javax.swing.JFrame { public JFrame_Ship() { initComponents(); } - + private DrawingShip _ship; /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -26,22 +29,170 @@ public class JFrame_Ship extends javax.swing.JFrame { // //GEN-BEGIN:initComponents private void initComponents() { + ShipCanvas = new containership.MyCanvas(); + labelAmountOfDeks = new javax.swing.JLabel(); + comboBoxAmountOfDecks = new javax.swing.JComboBox<>(); + buttonCreate = new javax.swing.JButton(); + statusLabel = new javax.swing.JLabel(); + buttonLeft = new javax.swing.JButton(); + buttonDown = new javax.swing.JButton(); + buttonRight = new javax.swing.JButton(); + buttonUp = new javax.swing.JButton(); + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + ShipCanvas.addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentResized(java.awt.event.ComponentEvent evt) { + ShipCanvasComponentResized(evt); + } + }); + + labelAmountOfDeks.setText("Количество палуб"); + + comboBoxAmountOfDecks.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Одна", "Две", "Три" })); + + buttonCreate.setText("Создать"); + buttonCreate.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonCreateActionPerformed(evt); + } + }); + + statusLabel.setText("Скорость: Вес: Цвет: Палубы:"); + + buttonLeft.setIcon(new javax.swing.ImageIcon(getClass().getResource("/containership/LeftArrow.png"))); // NOI18N + buttonLeft.setName("buttonLeft"); // NOI18N + buttonLeft.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + moveButtonActionPerformed(evt); + } + }); + + buttonDown.setIcon(new javax.swing.ImageIcon(getClass().getResource("/containership/DownArrow.png"))); // NOI18N + buttonDown.setName("buttonDown"); // NOI18N + buttonDown.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + moveButtonActionPerformed(evt); + } + }); + + buttonRight.setIcon(new javax.swing.ImageIcon(getClass().getResource("/containership/Rightarrow.png"))); // NOI18N + buttonRight.setActionCommand(""); + buttonRight.setName("buttonRight"); // NOI18N + buttonRight.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + moveButtonActionPerformed(evt); + } + }); + + buttonUp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/containership/UpArrow.png"))); // NOI18N + buttonUp.setToolTipText(""); + buttonUp.setName("buttonUp"); // NOI18N + buttonUp.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + moveButtonActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 400, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(buttonCreate) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 381, Short.MAX_VALUE) + .addComponent(buttonLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(labelAmountOfDeks) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(comboBoxAmountOfDecks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(buttonDown, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonRight, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(buttonUp, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(23, 23, 23)) + .addGroup(layout.createSequentialGroup() + .addComponent(statusLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + .addComponent(ShipCanvas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 300, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(ShipCanvas, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(labelAmountOfDeks) + .addComponent(comboBoxAmountOfDecks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(buttonCreate)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(buttonUp, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(buttonLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(buttonDown, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(buttonRight, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(18, 18, 18) + .addComponent(statusLabel) + .addContainerGap()) ); + labelAmountOfDeks.getAccessibleContext().setAccessibleName(""); + pack(); }// //GEN-END:initComponents + private void buttonCreateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCreateActionPerformed + Random rnd = new Random(); + _ship = new DrawingShip(); + _ship.Init(rnd.nextInt(100, 300), rnd.nextInt(1000, 2000), new Color(rnd.nextInt(0, 256), rnd.nextInt(0, 256), rnd.nextInt(0, 256)), (comboBoxAmountOfDecks.getSelectedIndex() + 1)); + _ship.SetPosition(rnd.nextInt(10, 100), rnd.nextInt(10, 100), ShipCanvas.getWidth(), ShipCanvas.getHeight()); + statusLabel.setText("Скорость: " + _ship.getShip().getSpeed() + " Вес: " + (int) _ship.getShip().getWeight() + " Цвет: " + _ship.getShip().getBodyColor() + " Палубы: " + _ship.drawingDecks.getNumberOfDecks()); + ShipCanvas.setShip(_ship); + Draw(); + }//GEN-LAST:event_buttonCreateActionPerformed + + private void moveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moveButtonActionPerformed + if (_ship == null) return; + String name = ((JButton) evt.getSource()).getName(); + switch (name) + { + case "buttonUp": + _ship.MoveTransport(Direction.UP); + break; + case "buttonDown": + _ship.MoveTransport(Direction.DOWN); + break; + case "buttonLeft": + _ship.MoveTransport(Direction.LEFT); + break; + case "buttonRight": + _ship.MoveTransport(Direction.RIGHT); + break; + } + Draw(); + }//GEN-LAST:event_moveButtonActionPerformed + + private void ShipCanvasComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_ShipCanvasComponentResized + if (_ship == null) return; + _ship.ChangeBorders(ShipCanvas.getWidth(), ShipCanvas.getHeight()); + }//GEN-LAST:event_ShipCanvasComponentResized + + private void Draw(){ + ShipCanvas.repaint(); + } /** * @param args the command line arguments */ @@ -78,5 +229,14 @@ public class JFrame_Ship extends javax.swing.JFrame { } // Variables declaration - do not modify//GEN-BEGIN:variables + private containership.MyCanvas ShipCanvas; + private javax.swing.JButton buttonCreate; + private javax.swing.JButton buttonDown; + private javax.swing.JButton buttonLeft; + private javax.swing.JButton buttonRight; + private javax.swing.JButton buttonUp; + private javax.swing.JComboBox comboBoxAmountOfDecks; + private javax.swing.JLabel labelAmountOfDeks; + private javax.swing.JLabel statusLabel; // End of variables declaration//GEN-END:variables } diff --git a/ContainerShip/src/containership/LeftArrow.png b/ContainerShip/src/containership/LeftArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..3e1449350860f8237404251ecb3405d8393e5b71 GIT binary patch literal 2432 zcmcIle^?Xe9lwBe2$lhB6`?$whXvc3!e(8|W3i(@P^nn0C=a^&l(lPRR4HpI57e%*_aJ0__O#A_mM3@j z-g}?-^M1bH&-cE!E8md)cxX&0f*_CQ=4cDyH9;nIkoRy7;`ni8>mX>%d2wquRIT0@ zexrEU*nJWd_k597ZnrRZ@zrvX-5PK67ss4y7miVd`i!P1wYX+9DXH~>$fK8M}u zCVgsbl9z;IVOolzlMsG`8k;h-NS}{tSQkJQ5<*PlIF2e*5`~E}(`I}TD#K-jl)$A# zvKYrnIYG*lsQ-t-?OcqREY$wozZtw!V^*H$NU7B8^-8?S64qsr!fH`TahX&m6GMd9 zUGC&5pV;Y6m}bxdH|?@vdVyyPnh0}p#y6oT&eecGw~X%vcaPDDp1= zT8am147w&06T;s}C`nueU3(6flQ=#F)x$zyD4u#WFw5A?<&Of@>&aZFo2Q&K$knPb zC`w|pF{E5ho0Dk@7b{?KiDk50C8lJ+EKZio%>c;FDJCU7sSB>xvb0A?pRj(aZW)$_ z9DxjxW=g@RWJIc%z$v8|XXIwF5+pNXpdw^cDy1Z7MSyL&%LZQ^%Km*;K@|fT0h5|6 zGbt!BkmCw*s!~vus=&n*fGSmrWF-y=3}tB2%(@&DtP`7qvH&UPv|#9e)M!{c>(a9f z%z3g<&5#{Nkz;d1>&pG_#|p5~KeF4<$)Y1ETBvn3Mhhkb2J=tbejs~~rgMtcYXy+> zA?8oP+^m`RQZA5TftmiF#U=eQ@ouW@;nE+?`2VAHe_ClP<+K3UIi;8oj8tebQ>IA& z+po!I-)l$HaMPydwEr>?`>8)AT zRoZm1FQ)K%SjJh@k$Kj5?b+s)hJ}(ALrYJ$v7U^*TS%;_UR@jhWK7!|e~=WH%8Z#i zN}*7w=oCYr1~)Xrq;X z|HuvRH?G9}#m{ePwEgbnokhACFVvj8qum%?HFMk8?(?5Ky?7$ALf6!k9`wt0YpB5g2csq1|l1($0imYi5Zasgeq%`&5vSnBG=E{lvLwVV< z*$Ghvd1mieaMCOotZn=9AFbE=D~~QOz)s(sGrx0?zj8S(ar>V?bi6R{_X8I%CWT;5`#DiVaIiw5 z=zq0)MboACk01>YyXHN7PhH)r#0w{au3EIGdJBJDfA5XY-?@F=vzhw1c~{(1o%3`% zZ(8Md1`Z#1X_Iffx^er?(TcUdv4~E5I7E{7FXd-;>W;}$MkA_1w+@Vt$7*IpUcItq z?@MZ=VaegKPd{A@Czc&6#G{dhBg$7!s&+(Sb3&_YBh!((&x&8{iT~(NThV(%o1d7G mu`hE@Q+&-tWy-|Xufr_nCr6skgtZDE_}namwl#D8)_()P-gox^ literal 0 HcmV?d00001 diff --git a/ContainerShip/src/containership/MyCanvas.java b/ContainerShip/src/containership/MyCanvas.java new file mode 100644 index 0000000..7d95be1 --- /dev/null +++ b/ContainerShip/src/containership/MyCanvas.java @@ -0,0 +1,29 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package containership; +import javax.swing.*; +import java.awt.*; +/** + * + * @author ateks + */ +public class MyCanvas extends JComponent { + public MyCanvas(){ + super(); + } + + private DrawingShip _ship = null; + + public void setShip(DrawingShip _ship) { + this._ship = _ship; + } + + @Override + public void paintComponent(Graphics g){ + super.paintComponent(g); + Graphics2D g2d = (Graphics2D) g; + if (_ship != null) _ship.DrawTransport(g2d); + } +} diff --git a/ContainerShip/src/containership/Rightarrow.png b/ContainerShip/src/containership/Rightarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..17163f7c34ef1fa10b15818d944d03db4917bac3 GIT binary patch literal 2426 zcmcIldsGv579PL{P+&vL`T}%1pwc6gnM?wCXsVF#NNO-ZRwFGflbH!blbLa5AOYsm{Fuq2PtJ;$G7huw7*t+MWFm7Rf*_Uvh0|Jj_( z%gtZ-sIiKuV9C`UK?Ce6TySMXo)AQ><`$5B|Lngyk$CGrk z|DJ3Eo&3U=FNe?0>&&_pwJPG1rdJGWV#dFA>CUc8+NAEVMn~VS+QQn~_JdWQH8c;L z?Vs%29v&#zzPIXNB_Nx zd65g!^^=!o`S!^DznU_4^EJmwc52)pUSlKM)og3n6RkN%OJ4nM(!4l7aQwug2e*so zpAs_}#pW;N0l?HF9bpG@*8K|r#-DcC?1J60P)9HxIWFZ_?(?uB8UW_a_pvy!oDx6> zRqmqo&|rH91iDB)v?RlVT37>B;mWV!sN$Le8&R{I(2~&nXTf7fx`ow$~6BM>+O5ti$r(Sq77R?xt36sVRfU;;%^P_31#9k`QlqUj)pVhTioA_^sp zqB@mAhiSmz4-(yRq*GU9%ndpdcY3Ho5Lg|8c)eb^S1D(>azyMFErMbQhQT5N=BsG| z_rWxuGR9z}c!G1Wf{UR+i4k`&m4Y4;rH;nnVMDYuAIy`OF~oDD@(eI-iHjx~FaM0BC}=<#ae>l9 zV%0EMA^mL%jSki5l$trHN{6DOP>a|IBrf2O2WCi@v-)wM7K_eA^8!v2l*y=vL{V~= zi_|Fap!Ij$ujx?PPC!}82LxfahiiCo#d+f z(nl136vi`7!HaWLR=Jqz|Jhu~&xz;psz*zIyu$wbBXwri8tHd zGi>sIbG2!D=ND}54b87t0=Y?mEKl?kS0wW(`T)?E49&Fu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