Database Icons

This commit is contained in:
Noah
2021-12-15 10:54:37 +01:00
parent 7bdf1d146c
commit 85f7ce5b01
10 changed files with 201999 additions and 12 deletions
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

-1
View File
@@ -277,7 +277,6 @@ public class Control {
y = (int) ((float) (mouseY - offset) / (800f / ((float) ySize)));
} else {
x = (int) ((float) (mouseX - offset) / (800f / ((float) xSize)));
y = (int) ((float) (mouseY - offset) / (800f / ((float) ySize * ratio)));
+6 -1
View File
@@ -13,6 +13,11 @@ import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.*;
/**
* In this class the Control Window is implemented. In the Control Window you are able to change some game variables and enable the drawing mode.
* @author Noah Kessinger
*/
public class ControlWindow extends GUI {
private final int width = 400, height = 800;
@@ -55,7 +60,7 @@ public class ControlWindow extends GUI {
controlWindow.setLocation(control.getGameWindowPos().x - (width + offset), control.getGameWindowPos().y);
controlWindow.setLayout(null);
ImageIcon imageIcon = new ImageIcon("src/assets/icons/Icon.png");
ImageIcon imageIcon = new ImageIcon(iconPath);
controlWindow.setIconImage(imageIcon.getImage());
controlWindow.addWindowListener(new WindowAdapter() {
+13 -6
View File
@@ -4,14 +4,21 @@ import gamecontrol.Control;
import gui.fundamental.Hover;
import gui.fundamental.RoundedBorder;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.util.List;
import java.util.Objects;
/**
* This class is the Window to access the Data from the Database and delete some entries.
* @author Noah Kessinger
*/
public class DatabaseWindow extends GUI {
private JFrame databaseWindow;
@@ -44,7 +51,7 @@ public class DatabaseWindow extends GUI {
databaseWindow.setTitle(this.title + " Database Control");
ImageIcon imageIcon = new ImageIcon("src/assets/icons/Icon.png");
ImageIcon imageIcon = new ImageIcon(iconPath);
databaseWindow.setIconImage(imageIcon.getImage());
@@ -57,7 +64,7 @@ public class DatabaseWindow extends GUI {
databaseWindow.setSize(1400, getAllGrids().size() * 75 + 200);
databaseWindow.setResizable(true);
databaseWindow.setResizable(false);
databaseWindow.addWindowListener(new WindowAdapter() {
@Override
@@ -129,8 +136,8 @@ public class DatabaseWindow extends GUI {
max_cellcounts[i].setForeground(Color.decode("#121212"));
max_cellcounts[i].setVisible(true);
deleteButtons[i] = new JButton();
deleteButtons[i].setText("Delete");
Icon icon = new ImageIcon(deleteIconPath);
deleteButtons[i] = new JButton(icon);
deleteButtons[i].setFont(text);
deleteButtons[i].setForeground(Color.decode("#121212"));
deleteButtons[i].setBorderPainted(true);
@@ -138,8 +145,7 @@ public class DatabaseWindow extends GUI {
deleteButtons[i].setContentAreaFilled(false);
deleteButtons[i].setBounds(1300, 75 * i + 150, 50, 30);
deleteButtons[i].setVisible(true);
deleteButtons[i].addMouseListener(new Hover());
deleteButtons[i].setBorder(new RoundedBorder(25));
deleteButtons[i].setBorder(null);
deleteButtons[i].addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -223,6 +229,7 @@ public class DatabaseWindow extends GUI {
}
public void setVisibility(boolean value) {
update();
databaseWindow.setVisible(value);
databaseWindow.requestFocus();
}
+3
View File
@@ -8,6 +8,9 @@ import java.util.List;
public abstract class GUI {
protected final String title = "Conway's game if Live";
protected final String iconPath = "src/assets/icons/Icon.png";
protected final String picturePath = "src/assets/pictures/Preview.png";
protected final String deleteIconPath = "src/assets/icons/delete.png";
protected final int offset = 20;
protected Control control;
protected Font head;
+5 -1
View File
@@ -7,6 +7,10 @@ import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
* In this class the game is shown.
* @author Noah Kessinger
*/
public class GameWindow extends GUI {
private final JFrame gameWindow;
@@ -34,7 +38,7 @@ public class GameWindow extends GUI {
gameWindow.getContentPane().setPreferredSize(new Dimension(width + (2 * offset), height + (2 * offset)));
gameWindow.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
ImageIcon imageIcon = new ImageIcon("src/assets/icons/Icon.png");
ImageIcon imageIcon = new ImageIcon(iconPath);
gameWindow.setIconImage(imageIcon.getImage());
gameWindow.addWindowListener(new WindowAdapter() {
+7 -3
View File
@@ -14,6 +14,10 @@ import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.*;
/**
* This Class is the Menu window in wich you can set up the basic Game Variables.
* @author Noah Kessinger
*/
public class MenuWindow extends GUI {
@@ -57,7 +61,7 @@ public class MenuWindow extends GUI {
menuWindow.setTitle(this.title);
ImageIcon imageIcon = new ImageIcon("src/assets/icons/Icon.png");
ImageIcon imageIcon = new ImageIcon(iconPath);
menuWindow.setIconImage(imageIcon.getImage());
@@ -68,7 +72,7 @@ public class MenuWindow extends GUI {
menuWindow.setLayout(null);
menuWindow.setSize(752, 424);
menuWindow.setResizable(true);
menuWindow.setResizable(false);
menuWindow.addKeyListener(new KeyListener() {
@@ -396,7 +400,7 @@ public class MenuWindow extends GUI {
private void initIMG(){
preview = new ImageIcon("src/assets/pictures/Preview.png");
preview = new ImageIcon(picturePath);
previewLabel = new JLabel(preview);
previewLabel.setBounds(450, 45, 203, 302);
}