3 import java
.awt
.event
.ActionEvent
;
4 import java
.awt
.event
.ActionListener
;
6 public class PersonView
extends JPanel
implements ActionListener
{
7 private int width
= 400;
8 private int height
= 600;
9 private Person personObj
;
10 private FirstnameView firstnameView
;
11 private OriginView originView
;
12 private SizeView sizeView
;
13 private WeightView weightView
;
14 private EyeView eyeView
;
15 private JPanel personPanel
= new JPanel();
16 private JButton compareButton
= new JButton("Compare");
17 /*private ImageIcon originImage;
18 private ImageIcon personImage;*/
20 PersonView(Person personObj
) {
21 setPersonObj(personObj
);
22 setFirstnameView(new FirstnameView(15, this.personObj
.getFirstname()));
23 setOriginView(new OriginView(this.personObj
.getOrigin()));
24 setSizeView(new SizeView(this.personObj
.getPersonSize()));
25 setWeightView(new WeightView(this.personObj
.getWeight()));
26 setEyeView(new EyeView(this.personObj
.getEye()));
28 this.compareButton
.addActionListener(this);
29 JLabel personLabel
= new JLabel("Closest person found");
30 personPanel
.add(personLabel
);
31 setPreferredSize(new Dimension(this.width
, this.height
));
32 setLayout(new GridLayout(7, 1, 0, 4));
42 public Person
getPersonObj() {
46 public void setPersonObj(Person personObj
) {
47 this.personObj
= personObj
;
53 public FirstnameView
getFirstnameView() {
58 * @param firstnameView
60 public void setFirstnameView(FirstnameView firstnameView
) {
61 this.firstnameView
= firstnameView
;
67 public OriginView
getOriginView() {
74 public void setOriginView(OriginView originView
) {
75 this.originView
= originView
;
81 public SizeView
getSizeView() {
88 public void setSizeView(SizeView sizeView
) {
89 this.sizeView
= sizeView
;
95 public WeightView
getWeightView() {
102 public void setWeightView(WeightView weightView
) {
103 this.weightView
= weightView
;
109 public void setEyeView(EyeView eyeView
) {
110 this.eyeView
= eyeView
;
116 public EyeView
getEyeView() {
121 public void actionPerformed(ActionEvent actionEvent
) {