Rearrange code.
[Persons_Comparator.git] / src / PersonRightPanel.java
index 62067f6689bc2aa4d47e0e0a4c692b34fb9159ac..7cbf331539804e907b1e8790e6f04a3cbc63239a 100644 (file)
@@ -15,18 +15,18 @@ public class PersonRightPanel extends JPanel {
         try {
             this.personImage = ImageIO.read(new File("data/personImage.png"));
         } catch (IOException e) {
-            System.out.println(e.getStackTrace());
+            e.printStackTrace();
         }
     }
 
-    public void setContentText(String contentText) {
-        this.contentText = contentText;
-    }
-
     public String getContentText() {
         return contentText;
     }
 
+    public void setContentText(String contentText) {
+        this.contentText = contentText;
+    }
+
     //FIXME: redraw on resizing
     /*@Override
     public void paint(Graphics g) {
@@ -44,8 +44,12 @@ public class PersonRightPanel extends JPanel {
         int imageWidth = 120;
         int imageHeight = 180;
         g2d.drawImage(this.personImage.getScaledInstance(imageWidth / 2, imageHeight / 2, Image.SCALE_SMOOTH), imageWidth / 4, imageHeight / 4, this);
+        // Eyes
         g2d.setColor(personObj.getEye().getColor());
         g2d.fillOval(50, 50, 6, 3);
         g2d.fillOval(62, 50, 6, 3);
+        // Weight
+        g2d.setColor(Color.black);
+        g2d.fillOval(44, 80, 30, (personObj.getWeight().getWeight() * 30) / 250);
     }
 }