--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Kotlin2JsCompilerArguments">
+ <option name="sourceMapEmbedSources" />
+ </component>
+</project>
\ No newline at end of file
public void setColor(String color) {
if (validateColor(color)) {
- if (color != "brown")
- this.color = Color.getColor(color);
- else
+ if (color.equals("brown"))
this.color = new Color(88, 41, 0);
+ else
+ this.color = Color.getColor(color);
+
} else {
throw new IllegalArgumentException("Color must be " + colorList.toString());
}
--- /dev/null
+public class EyeView {
+ private Eye eyeObj;
+
+ EyeView(Eye eyeObj) {
+ setEyeObj(eyeObj);
+ }
+
+ public Eye getEyeObj() {
+ return eyeObj;
+ }
+
+ public void setEyeObj(Eye eyeObj) {
+ this.eyeObj = eyeObj;
+ }
+}
@Override
public int compareTo(Firstname firstname) {
+ //return StringUtils.getLevenshteinDistance(this.getFirstname(), firstname.getFirstname());
return 0;
}
}
--- /dev/null
+public class FirstnameView {
+ private Firstname firstnameObj;
+
+ FirstnameView(Firstname firstnameObj) {
+ setFirstnameObj(firstnameObj);
+ }
+
+ public Firstname getFirstnameObj() {
+ return firstnameObj;
+ }
+
+ public void setFirstnameObj(Firstname firstnameObj) {
+ this.firstnameObj = firstnameObj;
+ }
+}
--- /dev/null
+public class OriginView {
+ private Origin originObj;
+
+ OriginView(Origin originObj) {
+ setOriginObj(originObj);
+ }
+
+ public Origin getOriginObj() {
+ return originObj;
+ }
+
+ public void setOriginObj(Origin originObj) {
+ this.originObj = originObj;
+ }
+}
-import javax.swing.*;
+import java.util.Comparator;
-public class Person extends JPanel implements Comparable<Person> {
+public class Person implements Comparable<Person>, Comparator<Person> {
private Firstname firstname;
private Origin origin;
private Size size;
private Weight weight;
private Eye eye;
- Person(Firstname firstname) {
+ Person(Firstname firstname, Origin origin, Size size, Weight weight, Eye eye) {
setFirstname(firstname);
+ setOrigin(origin);
+ setPersonSize(size);
+ setWeight(weight);
+ setEye(eye);
}
public void setFirstname(Firstname firstname) {
+ this.size.compareTo(person.getPersonSize()) + this.weight.compareTo(person.getWeight())
+ this.eye.compareTo(person.getEye());
}
+
+ @Override
+ public int compare(Person person, Person t1) {
+ return 0;
+ }
}
--- /dev/null
+import javax.swing.*;
+
+public class PersonView extends JPanel {
+ private FirstnameView firstnameView;
+ private OriginView originView;
+ private SizeView sizeView;
+ private WeightView weightView;
+ private EyeView eyeView;
+
+ public FirstnameView getFirstnameView() {
+ return firstnameView;
+ }
+
+ public void setFirstnameView(FirstnameView firstnameView) {
+ this.firstnameView = firstnameView;
+ }
+
+ public OriginView getOriginView() {
+ return originView;
+ }
+
+ public void setOriginView(OriginView originView) {
+ this.originView = originView;
+ }
+
+ public SizeView getSizeView() {
+ return sizeView;
+ }
+
+ public void setSizeView(SizeView sizeView) {
+ this.sizeView = sizeView;
+ }
+
+ public WeightView getWeightView() {
+ return weightView;
+ }
+
+ public void setWeightView(EyeView eyeView) {
+ this.eyeView = eyeView;
+ }
+
+ public void setEyeView(EyeView eyeView) {
+ this.eyeView = eyeView;
+ }
+
+ public EyeView getEyeView() {
+ return eyeView;
+ }
+}
--- /dev/null
+public class SizeView {
+ private Size sizeObj;
+
+ SizeView(Size sizeObj) {
+ setSizeObj(sizeObj);
+ }
+
+ public Size getSizeObj() {
+ return sizeObj;
+ }
+
+ public void setSizeObj(Size sizeObj) {
+ this.sizeObj = sizeObj;
+ }
+}
--- /dev/null
+public class WeightView {
+ private Weight weightObj;
+
+ WeightView(Weight weightObj) {
+ setWeightObj(weightObj);
+ }
+
+ public Weight getWeightObj() {
+ return weightObj;
+ }
+
+ public void setWeightObj(Weight weightObj) {
+ this.weightObj = weightObj;
+ }
+}