подготовка к пулу

This commit is contained in:
Zakharov_Rostislav 2023-10-28 06:35:03 +04:00
parent 0ea7fea345
commit ee5ebc2b81
5 changed files with 8 additions and 11 deletions

View File

@ -1,4 +1,4 @@
package enums;
package drawing_objects;
public enum BlocksNumber {
TWO,

View File

@ -1,4 +1,4 @@
package enums;
package drawing_objects;
public enum DirectionType {
UP,

View File

@ -1,7 +1,6 @@
package drawing_objects;
import entities.EntityBattleship;
import enums.DirectionType;
import java.awt.*;

View File

@ -1,7 +1,5 @@
package drawing_objects;
import enums.BlocksNumber;
import java.awt.*;
public class DrawingBlocks {
@ -20,10 +18,10 @@ public class DrawingBlocks {
if (number == BlocksNumber.FOUR || number == BlocksNumber.SIX){
graphics2D.fillRect(_startX+62, _startY+12, 6, 6);
graphics2D.fillRect(_startX+62, _startY+32, 6, 6);
}
if (number == BlocksNumber.SIX){
graphics2D.fillRect(_startX+42, _startY+12, 6, 6);
graphics2D.fillRect(_startX+42, _startY+32, 6, 6);
if (number == BlocksNumber.SIX){
graphics2D.fillRect(_startX+42, _startY+12, 6, 6);
graphics2D.fillRect(_startX+42, _startY+32, 6, 6);
}
}
}
}

View File

@ -1,7 +1,7 @@
package frames;
import drawing_objects.DrawingBattleship;
import enums.DirectionType;
import drawing_objects.DirectionType;
import javax.imageio.ImageIO;
import javax.swing.*;
@ -27,12 +27,12 @@ public class FrameBattleship extends JFrame {
super.repaint();
}
};
pictureBox.setBounds( 0, 0, getContentPane().getWidth(), getContentPane().getHeight());
JButton createButton = new JButton("Создать");
JButton rightButton = new JButton(new ImageIcon(ImageIO.read(new File("images/right.png"))));
JButton leftButton = new JButton(new ImageIcon(ImageIO.read(new File("images/left.png"))));
JButton upButton = new JButton(new ImageIcon(ImageIO.read(new File("images/up.png"))));
JButton downButton = new JButton(new ImageIcon(ImageIO.read(new File("images/down.png"))));
pictureBox.setBounds( 0, 0, getContentPane().getWidth(), getContentPane().getHeight());
//ActionListeners and ActionCommand addition
createButton.addActionListener(e -> buttonCreateClick());
rightButton.setActionCommand("right");