From d252f672e7ed73d9f4e588f855d20f042f2e2df8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 16 Jan 2019 13:13:42 +0100 Subject: [PATCH] Reorganize the PersonView : MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * Use BorderLayout for the PersonView; * Add four panels to the PersonView : north, south, east, west; * Add PersonPanel class for the center in the layout and use it in the PersonView. Signed-off-by: Jérôme Benoit --- data/personImage.png | Bin 0 -> 20111 bytes src/MainWindowsView.java | 14 ++++++--- src/PersonPanel.java | 59 +++++++++++++++++++++++++++++++++++ src/PersonView.java | 65 +++++++++++++++++++++++++++------------ src/Utils.java | 4 +-- 5 files changed, 116 insertions(+), 26 deletions(-) create mode 100644 data/personImage.png create mode 100644 src/PersonPanel.java diff --git a/data/personImage.png b/data/personImage.png new file mode 100644 index 0000000000000000000000000000000000000000..f174952c1090aa467941504652283258e58e3537 GIT binary patch literal 20111 zcmaI7Wk6KV7cfjnm$bCR0!x>4h_JvexpX5Xppi&(kUzrg3=``ibzN-2uK^m z($dX)`TgJL`S|Roy?4%>o-^mnnfuy6Pm_X_nG^>HhXSglZis_}>xP4aH%3edyfHM5 z_Qb)_GliDb)_JXjcyK;Yyi(^lY z__1sX-@VkLqUWzZMNmo}cr&w*ON(Vs)|s|i%9Z3BsB1m4;16619l3;? zc0R2?3cu)7U8rk(W>$Cp!^>>_zJ#s(Lz#$ed|#{6#yQ;jI_nF(3!DqwQ2bDwPFw{X zg{hCn(OJ=EPp5s+MrcWN`o9p?Q^Gy|J@c-@rQWsN*F_w~j5l`S9CbR?xUZA62YvI> zek!A*(Q{F1(P~jL>fl{=XGL(~>uDqOOSBDoI(qKU=u*OmBK>*en7SqiRNHaWfW}wU z)+B%^9bsqy-4B{^G&e~N*i*`L%B)eE4;WFM2yt%z;_wF{h zNn&=u?r;nS>6#OaVZ6ZU$FIQe*HGPU&WYrM%ogNE@mYvoJV-lvR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*df3>TksImaP~IB zo*ktfNGgjDPyj9mo~7)mm>0GwDCrh>FXsZ=QGTkUdW2GsmLJwB-#PT*TZA(%OO#k@ zQuax^4J+To3am;E>6-Z)$w}Z!~#2@ z`J$$@m$3P0p(f?EHEEZ4pBGZ*UL{3Kn%KMUMER+X)EI9B9*OsABrQo;Hv#uj=6i~6 zysviy`!Sd-prkXYoU2+g^iTJDDJ|V&S2o*u&k*($-%#iXE2TVk1I~;;7hV6mh1^3A zcx~)mp?qnj=eE8josuk0VgO&Q{ahj`<-$SYFnN#u7J?#a&mx5Cs-OL}- z9Pk?8eY7Lhks8|dz>}Ddmd$tOGr;qNZEQ;&arJ6JTG2!2oIm?%gq(C6QXQ!xt}kRH zB;yTYIt-SGm+G$$VP@BE6q@oVp^>j@(Xc;_6gCtb9m!~;%=Luh)k>X;*8}#6!CH}l zORhIm-Du^^n!rkKbREJn@EcpyG0AZC)dW6 zr8>4FoMl+l!&rc%*R|-LWpt^4RCi`E%br2fwQvo;0EAJgj8Ya>78$vG}6vV z(n(G`0H2DH=63NOwy9mq;?=E0qSfzb7VzKZ`(1~{<&ihWVdkbSeE$;g4Db|TF6)!= rdMaM`0}szr4kC-?B?j~CB@_M+09o1V0EQBe00000NkvXXu0mjf^Sj8m literal 0 HcmV?d00001 diff --git a/src/MainWindowsView.java b/src/MainWindowsView.java index 85470ff..df6839f 100644 --- a/src/MainWindowsView.java +++ b/src/MainWindowsView.java @@ -8,10 +8,11 @@ import java.util.ArrayList; public class MainWindowsView extends JFrame { - MainWindowsView(String title, JPanel panel) { + MainWindowsView(String title, PersonView view) { + Container panel = getContentPane(); //Create and set up the window. setTitle(title); - setSize(panel.getPreferredSize()); + setSize(view.getDimension()); setLocationRelativeTo(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -28,7 +29,11 @@ public class MainWindowsView extends JFrame { panel.add(component); } - setContentPane(panel); + panel.add(view.getNorthPanel(), BorderLayout.NORTH); + panel.add(view.getSouthPanel(), BorderLayout.SOUTH); + panel.add(view.getEastPanel(), BorderLayout.EAST); + panel.add(view.getWestPanel(), BorderLayout.WEST); + panel.add(view.getPersonPanel(), BorderLayout.CENTER); } /** @@ -77,7 +82,8 @@ public class MainWindowsView extends JFrame { * event-dispatching thread. */ public void showGUI() { - + System.out.println("Created GUI on EDT? " + + SwingUtilities.isEventDispatchThread()); //Display the window. //this.pack(); this.setVisible(true); diff --git a/src/PersonPanel.java b/src/PersonPanel.java new file mode 100644 index 0000000..7c8e241 --- /dev/null +++ b/src/PersonPanel.java @@ -0,0 +1,59 @@ +import javax.imageio.ImageIO; +import javax.swing.*; +import java.awt.*; +import java.awt.geom.Ellipse2D; +import java.awt.geom.Point2D; +import java.io.File; +import java.io.IOException; + +public class PersonPanel extends JPanel { + private boolean debug = true; + private String titleText = new String(); + private JLabel personLabel = new JLabel(); + private String contentText = new String(); + private Image personImage; + + public PersonPanel(String title) { + setTitleText(title); + personLabel.setText(this.getTitleText()); + add(personLabel); + try { + this.personImage = ImageIO.read(new File("data/personImage.png")); + } catch (IOException e) { + System.out.println(e.getStackTrace()); + } + } + + public void setTitleText(String titleText) { + this.titleText = titleText; + } + + public String getTitleText() { + return titleText; + } + + public void setContentText(String contentText) { + this.contentText = contentText; + } + + public String getContentText() { + return contentText; + } + + public void paintComponent(Graphics g) { + super.paintComponent(g); + + // Draw + g.setColor(Color.black); + if (debug) + // Below the JLabel + g.drawString(this.getContentText(), 5, 35); + Graphics2D g2d = (Graphics2D) g; + g2d.drawImage(this.personImage.getScaledInstance(getWidth() / 2, getHeight() / 2, Image.SCALE_SMOOTH), getWidth() / 4, getHeight() / 4, this); + } + + private static Ellipse2D getCircleByCenter(Point2D center, double radius) { + Ellipse2D.Double myCircle = new Ellipse2D.Double(center.getX() - radius, center.getY() - radius, 2 * radius, 2 * radius); + return myCircle; + } +} diff --git a/src/PersonView.java b/src/PersonView.java index 8cee3e2..6823579 100644 --- a/src/PersonView.java +++ b/src/PersonView.java @@ -4,9 +4,9 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; -public class PersonView extends JPanel implements ActionListener { - private int width = 400; - private int height = 600; +public class PersonView extends JComponent implements ActionListener { + private int width = 800; + private int height = 500; private Person personObj; private ArrayList personArrayList; private FirstnameView firstnameView; @@ -14,10 +14,12 @@ public class PersonView extends JPanel implements ActionListener { private SizeView sizeView; private WeightView weightView; private EyeView eyeView; - private JPanel personPanel = new JPanel(); + private JPanel northPanel = new JPanel(); + private JPanel southPanel = new JPanel(); + private JPanel eastPanel = new JPanel(); + private JPanel westPanel = new JPanel(); + private PersonPanel personPanel = new PersonPanel("Person comparison"); private JButton compareButton = new JButton("Compare"); - /*private ImageIcon originImage; - private ImageIcon personImage;*/ PersonView(Person personObj, ArrayList personArrayList) { setPersonObj(personObj); @@ -29,17 +31,18 @@ public class PersonView extends JPanel implements ActionListener { setPersonArrayList(personArrayList); this.compareButton.addActionListener(this); - 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); + northPanel.setBorder(BorderFactory.createRaisedSoftBevelBorder()); + northPanel.add(firstnameView); + southPanel.setBorder(BorderFactory.createRaisedSoftBevelBorder()); + southPanel.add(compareButton); + eastPanel.setLayout(new BoxLayout(this.eastPanel, BoxLayout.Y_AXIS)); + eastPanel.setBorder(BorderFactory.createRaisedSoftBevelBorder()); + eastPanel.add(sizeView); + eastPanel.add(weightView); + eastPanel.add(eyeView); + westPanel.setLayout(new BoxLayout(this.westPanel, BoxLayout.Y_AXIS)); + westPanel.setBorder(BorderFactory.createRaisedSoftBevelBorder()); + westPanel.add(originView); } public Person getPersonObj() { @@ -128,6 +131,30 @@ public class PersonView extends JPanel implements ActionListener { this.personArrayList = personArrayList; } + public Dimension getDimension() { + return new Dimension(this.width, this.height); + } + + public JPanel getNorthPanel() { + return northPanel; + } + + public JPanel getSouthPanel() { + return southPanel; + } + + public JPanel getEastPanel() { + return eastPanel; + } + + public JPanel getWestPanel() { + return westPanel; + } + + public PersonPanel getPersonPanel() { + return personPanel; + } + @Override public void actionPerformed(ActionEvent actionEvent) { //TODO: one can implement a smarter way of getting all inputs values inside the main panel. @@ -155,9 +182,7 @@ public class PersonView extends JPanel implements ActionListener { personArrayList.sort(getPersonObj()); //Utils.displayArrayList(personArrayList); Person closestPerson = personArrayList.get(personArrayList.indexOf(this.getPersonObj()) + 1); - JLabel closestPersonLabel = new JLabel(); - closestPersonLabel.setText(closestPerson.toString()); - this.personPanel.add(closestPersonLabel); + personPanel.setContentText(closestPerson.toString()); } } } diff --git a/src/Utils.java b/src/Utils.java index b551cb1..e7a5d2d 100644 --- a/src/Utils.java +++ b/src/Utils.java @@ -4,9 +4,9 @@ import java.util.ListIterator; public class Utils { public static void displayArrayList(ArrayList arrayList) { ListIterator iter = arrayList.listIterator(); - Integer i = 0; + int i = 0; while (iter.hasNext()) { - System.out.println(i.toString() + " " + iter.next()); + System.out.println(i + " " + iter.next()); i++; } } -- 2.34.1