package utility;

import file.ImageManager;
import object.NetworkManager;
import object.Pump;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class ScreenPanel extends JPanel {

    private int screenWidth;
    private int screenHeight;
    private NetworkManager networkManager;

    public ScreenPanel() {
        initializeScreen();
        setBorder(BorderFactory.createLineBorder(Color.black));
        addMouseListener();

        ImageManager.initImages();
        networkManager = new NetworkManager();
    }

    private void addMouseListener() {
        addMouseListener(new MouseAdapter() {
            public void mousePressed(MouseEvent e) {
                networkManager.add(new Pump(e.getX() - 200, e.getY()));

                repaint();
            }
        });
    }

    protected void paintComponent(Graphics gr) {
        super.paintComponent(gr);

        gr.setColor(Color.RED);
        gr.drawString("ello bois", 10, 20);

        networkManager.drawAllObjects(gr);
    }

    public Dimension getPreferredSize() {
        return new Dimension(screenWidth, screenHeight);
    }

    private void initializeScreen() {
        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice device = env.getScreenDevices()[0];
        Rectangle screenRectangle = device.getDefaultConfiguration().getBounds();
        screenWidth = screenRectangle.width;
        screenHeight = screenRectangle.height;
    }
}

@@ -776,14 +776,8 @@
 tX()
- - 200
 , e.
@@ -783,24 +783,76 @@
 .getY()));%0A%0A
+                System.out.println(askForInput());%0A%0A
             
@@ -1056,24 +1056,24 @@
 , 10, 20);%0A%0A
-
         netw
@@ -1106,24 +1106,481 @@
 gr);%0A    %7D%0A%0A
+    public String askForInput() %7B%0A        return (String)JOptionPane.showInputDialog(%0A                this,%0A                %22Specify flow and capacity:%5Cn%22%0A                        + %22examples: %5C%228/10%5C%22 or %5C%2210%5C%22 (short for 10/10)%22,%0A                %22Properties%22, // window title%0A                JOptionPane.QUESTION_MESSAGE,%0A                UIManager.getIcon(%22FileChooser.detailsViewIcon%22),%0A                null,%0A                %2210%22); // default text%0A    %7D%0A%0A
     public D

Add properties input dialog