repositories
/
Persons_Comparator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Only draw eyes on selection and the full closest person on validation.
[Persons_Comparator.git]
/
src
/
PersonRightPanel.java
diff --git
a/src/PersonRightPanel.java
b/src/PersonRightPanel.java
index 28099b249fcfb0e1d61f99458a2fb94ed000183e..0cf73436b5c8090f9ec1d84f1697a703ed6e356b 100644
(file)
--- a/
src/PersonRightPanel.java
+++ b/
src/PersonRightPanel.java
@@
-31,15
+31,17
@@
public class PersonRightPanel extends JPanel {
return personImage;
}
return personImage;
}
- public void
paintComponent(Graphics g
) {
-
super.paintComponent(g
);
+ public void
drawPerson(Person personObj
) {
+
Graphics g = this.getGraphics(
);
// Draw
// Draw
- g.setColor(Color.black);
- g.drawString(getContentText(), 5, 35);
+ g.drawString(getContentText(), 12, 35);
Graphics2D g2d = (Graphics2D) g;
int imageWidth = 120;
int imageHeight = 180;
g2d.drawImage(this.personImage.getScaledInstance(imageWidth / 2, imageHeight / 2, Image.SCALE_SMOOTH), imageWidth / 4, imageHeight / 4, this);
Graphics2D g2d = (Graphics2D) g;
int imageWidth = 120;
int imageHeight = 180;
g2d.drawImage(this.personImage.getScaledInstance(imageWidth / 2, imageHeight / 2, Image.SCALE_SMOOTH), imageWidth / 4, imageHeight / 4, this);
+ g.setColor(personObj.getEye().getColor());
+ g.fillOval(50, 50, 6, 3);
+ g.fillOval(62, 50, 6, 3);
}
}
}
}