source: src/main/java/genius/gui/session/ParticipantPanel.java@ 209

Last change on this file since 209 was 127, checked in by Wouter Pasman, 6 years ago

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 1.4 KB
Line 
1package genius.gui.session;
2
3import javax.swing.BoxLayout;
4import javax.swing.JPanel;
5
6import genius.core.repository.ParticipantRepItem;
7import genius.core.repository.ProfileRepItem;
8import genius.gui.panels.ComboboxSelectionPanel;
9import genius.gui.panels.LabelAndComponent;
10import genius.gui.panels.TextPanel;
11import genius.gui.renderer.RepItemListCellRenderer;
12
13/**
14 * Panel where user can edit a participant settings
15 *
16 */
17@SuppressWarnings("serial")
18public class ParticipantPanel extends JPanel {
19
20 private ParticipantModel participantModel;
21
22 public ParticipantPanel(ParticipantModel participantModel) {
23 setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
24 this.participantModel = participantModel;
25 init();
26 }
27
28 private void init() {
29 add(new LabelAndComponent("Party ID",
30 new TextPanel(participantModel.getIdModel())));
31
32 final ComboboxSelectionPanel<ParticipantRepItem> partycombo = new ComboboxSelectionPanel<>(
33 "Party Strategy", participantModel.getPartyModel());
34 partycombo.setCellRenderer(new RepItemListCellRenderer());
35 add(partycombo);
36
37 final ComboboxSelectionPanel<ProfileRepItem> profilecombo = new ComboboxSelectionPanel<ProfileRepItem>(
38 "Preference Profile", participantModel.getProfileModel());
39 profilecombo.setCellRenderer(new RepItemListCellRenderer());
40 add(profilecombo);
41
42 JPanel uncertaintyPanel = new JPanel();
43 add(uncertaintyPanel);
44 }
45}
Note: See TracBrowser for help on using the repository browser.