setSeatDesignation(dummySeatDesignation);
}
public void setSeatDesignation(SeatDesignation seatDesignation) {
removeAll();
Guest guest = seatDesignation.getGuest();
if (guest == null) {
add(new JLabel("Empty seat"), BorderLayout.CENTER);
return;
}
JButton button = new JButton(new SeatDesignationAction(seatDesignation));
button.setMargin(new Insets(0, 0, 0, 0));
Seat seat = seatDesignation.getSeat();
if (seat != null) {
button.setToolTipText("Guest " + guest.getCode()
+ " @ " + "Seat " + seat.getSeatIndexInTable());
}
add(button, BorderLayout.WEST);
JPanel infoPanel = new JPanel(new GridLayout(0, 1));
infoPanel.setOpaque(false);
infoPanel.add(new JLabel(guest.getName()));
JPanel jobPanel = new JPanel();
jobPanel.setLayout(new BoxLayout(jobPanel, BoxLayout.Y_AXIS));
jobPanel.setOpaque(false);
jobPanel.add(new JLabel(guest.getJob().getJobType().getCode()));
JLabel jobLabel = new JLabel(" " + guest.getJob().getName());
jobLabel.setFont(jobLabel.getFont().deriveFont(jobLabel.getFont().getSize() - 2.0F));
jobPanel.add(jobLabel);
infoPanel.add(jobPanel);
add(infoPanel, BorderLayout.CENTER);
JPanel hobbyPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
hobbyPanel.setOpaque(false);
hobbyPanel.setAlignmentX(CENTER_ALIGNMENT);
for (HobbyPractician hobbyPractician : guest.getHobbyPracticianList()) {
Hobby hobby = hobbyPractician.getHobby();
JLabel hobbyLabel = new JLabel(hobbyImageIconMap.get(hobby));
hobbyLabel.setToolTipText(hobby.getLabel());
hobbyPanel.add(hobbyLabel);
}