But all person displaying related information into the View and add a panel for the...
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 12 Jan 2019 12:46:45 +0000 (13:46 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 12 Jan 2019 12:46:45 +0000 (13:46 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/MainWindowsView.java
src/PersonView.java

index 58a37fb435f4a011af37a213a5adcdab9f9004c1..85470ff4636bc67730f5ca54eff5d8e34cc38af9 100644 (file)
@@ -11,7 +11,7 @@ public class MainWindowsView extends JFrame {
     MainWindowsView(String title, JPanel panel) {
         //Create and set up the window.
         setTitle(title);
-        setSize(400, 300);
+        setSize(panel.getPreferredSize());
         setLocationRelativeTo(null);
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
index 53816af3db23ea902dda6fd5b99fe45f5dd3c756..675f37f3ab7f72b17dabbaec15feee6a5f17a1bc 100644 (file)
@@ -1,26 +1,39 @@
 import javax.swing.*;
+import java.awt.*;
 
 public class PersonView extends JPanel {
+    private int width = 400;
+    private int height = 600;
     private Person personObj;
     private FirstnameView firstnameView;
     private OriginView originView;
     private SizeView sizeView;
     private WeightView weightView;
     private EyeView eyeView;
+    private JPanel personPanel = new JPanel();
+    private JButton compareButton = new JButton("Compare");
+    /*private ImageIcon originImage;
+    private ImageIcon personImage;*/
 
     PersonView(Person personObj) {
         setPersonObj(personObj);
-        setFirstnameView(new FirstnameView(10, this.personObj.getFirstname()));
+        setFirstnameView(new FirstnameView(15, this.personObj.getFirstname()));
         setOriginView(new OriginView(this.personObj.getOrigin()));
         setSizeView(new SizeView(this.personObj.getPersonSize()));
         setWeightView(new WeightView(this.personObj.getWeight()));
         setEyeView(new EyeView(this.personObj.getEye()));
 
+        JLabel personLabel = new JLabel("Closest person found");
+        personPanel.add(personLabel);
+        setPreferredSize(new Dimension(this.width, this.height));
+        setLayout(new GridLayout(7, 1, 0, 4));
         add(firstnameView);
         add(originView);
         add(sizeView);
         add(weightView);
         add(eyeView);
+        add(compareButton);
+        add(personPanel);
     }
 
     public Person getPersonObj() {