]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ui/src/org/simantics/district/network/ui/breakdown/Input.java
Add refresh to context menu in district network breakdown view
[simantics/district.git] / org.simantics.district.network.ui / src / org / simantics / district / network / ui / breakdown / Input.java
index dd80c2a657500a8c99fc141eec7738f73a42fcd5..6d9ae8b67cd39f0e4cdf67ed1173aa0a8a30d0a6 100644 (file)
@@ -14,9 +14,35 @@ public class Input {
 
     public static class NetworkDiagrams extends Bean {
         public List<NetworkDiagram> diagrams = new ArrayList<>();
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = super.hashCode();
+            result = prime * result + ((diagrams == null) ? 0 : diagrams.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (!super.equals(obj))
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            NetworkDiagrams other = (NetworkDiagrams) obj;
+            if (diagrams == null) {
+                if (other.diagrams != null)
+                    return false;
+            } else if (!diagrams.equals(other.diagrams))
+                return false;
+            return true;
+        }
     }
 
     public static class NetworkDiagram extends Bean {
+
         public String name;
         public Resource diagram;
 
@@ -24,6 +50,37 @@ public class Input {
             this.name = name;
             this.diagram = diagram;
         }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = super.hashCode();
+            result = prime * result + ((diagram == null) ? 0 : diagram.hashCode());
+            result = prime * result + ((name == null) ? 0 : name.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (!super.equals(obj))
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            NetworkDiagram other = (NetworkDiagram) obj;
+            if (diagram == null) {
+                if (other.diagram != null)
+                    return false;
+            } else if (!diagram.equals(other.diagram))
+                return false;
+            if (name == null) {
+                if (other.name != null)
+                    return false;
+            } else if (!name.equals(other.name))
+                return false;
+            return true;
+        }
     }
 
     public static class Subgraph {
@@ -38,6 +95,46 @@ public class Input {
             this.vertices = vertices;
             this.edges = edges;
         }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((edges == null) ? 0 : edges.hashCode());
+            result = prime * result + index;
+            result = prime * result + ((parent == null) ? 0 : parent.hashCode());
+            result = prime * result + ((vertices == null) ? 0 : vertices.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            Subgraph other = (Subgraph) obj;
+            if (edges == null) {
+                if (other.edges != null)
+                    return false;
+            } else if (!edges.equals(other.edges))
+                return false;
+            if (index != other.index)
+                return false;
+            if (parent == null) {
+                if (other.parent != null)
+                    return false;
+            } else if (!parent.equals(other.parent))
+                return false;
+            if (vertices == null) {
+                if (other.vertices != null)
+                    return false;
+            } else if (!vertices.equals(other.vertices))
+                return false;
+            return true;
+        }
     }
 
 }