Make the main window a singleton to permit to query it from other views and update...
[Persons_Comparator.git] / src / Eye.java
index edaea1bb467c07f00a510e155804a25c7b952114..5177333340ccaae5405fce6264d927319ef3aa16 100644 (file)
@@ -1,12 +1,13 @@
 import java.awt.Color;
 import java.util.Arrays;
 
-public class Eye implements Comparable<Eye> {
+public class Eye {
     private String strColor;
     private Color color;
     private String[] colorsList = {"black", "blue", "brown", "green"};
 
     Eye() {
+        //this.color = Color.white;
         sortColorList();
     }
 
@@ -81,8 +82,7 @@ public class Eye implements Comparable<Eye> {
      * @param eye
      * @return
      */
-    @Override
-    public int compareTo(Eye eye) {
+    public int distanceTo(Eye eye) {
         double r_diff = this.getColor().getRed() - eye.getColor().getRed();
         double g_diff = this.getColor().getGreen() - eye.getColor().getGreen();
         double b_diff = this.getColor().getBlue() - eye.getColor().getBlue();