package seedu.address.commons.core;

import java.awt.Point;
import java.io.Serializable;
import java.util.Objects;

/**
 * A Serializable class that contains the GUI settings.
 */
public class GuiSettings implements Serializable {

    private static final double DEFAULT_HEIGHT = 600;
    private static final double DEFAULT_WIDTH = 740;

    private Double windowWidth;
    private Double windowHeight;
    private Point windowCoordinates;

    public GuiSettings() {
        windowWidth = DEFAULT_WIDTH;
        windowHeight = DEFAULT_HEIGHT;
        windowCoordinates = null; // null represent no coordinates
    }

    public GuiSettings(Double windowWidth, Double windowHeight, int xPosition, int yPosition) {
        this.windowWidth = windowWidth;
        this.windowHeight = windowHeight;
        windowCoordinates = new Point(xPosition, yPosition);
    }

    public Double getWindowWidth() {
        return windowWidth;
    }

    public Double getWindowHeight() {
        return windowHeight;
    }

    public Point getWindowCoordinates() {
        return windowCoordinates;
    }

    @Override
    public boolean equals(Object other) {
        if (other == this) {
            return true;
        }
        if (!(other instanceof GuiSettings)) { //this handles null as well.
            return false;
        }

        GuiSettings o = (GuiSettings) other;

        return Objects.equals(windowWidth, o.windowWidth)
                && Objects.equals(windowHeight, o.windowHeight)
                && Objects.equals(windowCoordinates.x, o.windowCoordinates.x)
                && Objects.equals(windowCoordinates.y, o.windowCoordinates.y);
    }

    @Override
    public int hashCode() {
        return Objects.hash(windowWidth, windowHeight, windowCoordinates);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Width : " + windowWidth + "\n");
        sb.append("Height : " + windowHeight + "\n");
        sb.append("Position : " + windowCoordinates);
        return sb.toString();
    }
}

@@ -337,33 +337,33 @@
 0;%0A%0A    private 
-D
+d
 ouble windowWidt
@@ -377,17 +377,17 @@
 private 
-D
+d
 ouble wi
@@ -636,17 +636,17 @@
 ettings(
-D
+d
 ouble wi
@@ -656,17 +656,17 @@
 wWidth, 
-D
+d
 ouble wi
@@ -862,33 +862,33 @@
   %7D%0A%0A    public 
-D
+d
 ouble getWindowW
@@ -942,17 +942,17 @@
  public 
-D
+d
 ouble ge
@@ -1382,31 +1382,16 @@
  return 
-Objects.equals(
 windowWi
@@ -1393,17 +1393,19 @@
 dowWidth
-,
+ ==
  o.windo
@@ -1410,17 +1410,16 @@
 dowWidth
-)
 %0A       
@@ -1426,39 +1426,24 @@
          && 
-Objects.equals(
 windowHeight
@@ -1442,17 +1442,19 @@
 owHeight
-,
+ ==
  o.windo
@@ -1460,17 +1460,16 @@
 owHeight
-)
 %0A       

use `double` instead of `Double`