package uk.ac.ebi.quickgo.graphics.ontology;

import java.awt.*;

/**
 * Holds stylistic information for a Terms graph.
 * Refactored by Tony Wardell
 */
public class GraphPresentation {

    public final static int fontSize = 11;
    public final static boolean FILL = true;
    private static final String fontName = "Arial";
    public static final Font FONT = new Font(fontName, Font.PLAIN, fontSize);
    static boolean defaultShowKey = true;
    static boolean defaultShowTermIds = true;
    static int defaultWidth = 85;
    static int defaultHeight = 55;
    static boolean defaultShowSlimColours = false;
    static boolean defaultShowChildren = false;
    //changeable
    public final boolean termIds;
    public final boolean key;
    public final boolean subsetColours;
    public final boolean showChildren;
    public final int width;
    public final int height;

    private GraphPresentation(boolean termIds, boolean key, boolean subsetColours, boolean showChildren, int width,
            int height) {
        this.termIds = termIds;
        this.key = key;
        this.subsetColours = subsetColours;
        this.showChildren = showChildren;
        this.width = width;
        this.height = height;
    }

    public static class Builder {
        private boolean showIDs = defaultShowTermIds;
        private boolean showKey = defaultShowKey;
        private boolean showSlimColours = defaultShowSlimColours;
        private boolean showChildren = defaultShowChildren;
        private int width = defaultWidth;
        private int height = defaultHeight;

        public Builder() {
        }

        public Builder showKey(boolean val) {
            this.showKey = val;
            return this;
        }

        public Builder showIDs(boolean val) {
            this.showIDs = val;
            return this;
        }

        public Builder showSlimColours(boolean val) {
            this.showSlimColours = val;
            return this;
        }

        public Builder showChildren(boolean val) {
            this.showChildren = val;
            return this;
        }

        public Builder termBoxWidth(int val) {
            this.width = val;
            return this;
        }

        public Builder termBoxHeight(int val) {
            this.height = val;
            return this;
        }

        public GraphPresentation build() {
            return new GraphPresentation(
                    this.showIDs,
                    this.showKey,
                    this.showSlimColours,
                    this.showChildren,
                    this.width,
                    this.height);
        }
    }
}

@@ -57,16 +57,42 @@
 a.awt.*;
+%0Aimport java.util.Objects;
 %0A%0A/**%0A *
@@ -425,24 +425,31 @@
 tSize);%0A    
+public 
 static boole
@@ -474,24 +474,31 @@
 = true;%0A    
+public 
 static boole
@@ -527,24 +527,31 @@
 = true;%0A    
+public 
 static int d
@@ -568,24 +568,31 @@
 h = 85;%0A    
+public 
 static int d
@@ -610,24 +610,31 @@
 t = 55;%0A    
+public 
 static boole
@@ -672,16 +672,23 @@
 se;%0A    
+public 
 static b
@@ -2704,11 +2704,1028 @@
  %7D%0A    %7D
+%0A%0A    @Override public boolean equals(Object o) %7B%0A        if (this == o) %7B%0A            return true;%0A        %7D%0A        if (o == null %7C%7C getClass() != o.getClass()) %7B%0A            return false;%0A        %7D%0A        GraphPresentation that = (GraphPresentation) o;%0A        return termIds == that.termIds &&%0A                key == that.key &&%0A                subsetColours == that.subsetColours &&%0A                showChildren == that.showChildren &&%0A                width == that.width &&%0A                height == that.height;%0A    %7D%0A%0A    @Override public int hashCode() %7B%0A%0A        return Objects.hash(termIds, key, subsetColours, showChildren, width, height);%0A    %7D%0A%0A    @Override public String toString() %7B%0A        return %22GraphPresentation%7B%22 +%0A                %22termIds=%22 + termIds +%0A                %22, key=%22 + key +%0A                %22, subsetColours=%22 + subsetColours +%0A                %22, showChildren=%22 + showChildren +%0A                %22, width=%22 + width +%0A                %22, height=%22 + height +%0A                '%7D';%0A    %7D
 %0A%7D%0A

Add toString(), hashcode() and equals(). Make default values public so they can be used in testing.