[1] | 1 | package genius.gui.session;
|
---|
| 2 |
|
---|
| 3 | import javax.swing.BoxLayout;
|
---|
| 4 | import javax.swing.JPanel;
|
---|
| 5 |
|
---|
| 6 | import genius.core.repository.ParticipantRepItem;
|
---|
| 7 | import genius.core.repository.ProfileRepItem;
|
---|
| 8 | import genius.gui.panels.ComboboxSelectionPanel;
|
---|
| 9 | import genius.gui.panels.LabelAndComponent;
|
---|
| 10 | import genius.gui.panels.TextPanel;
|
---|
| 11 | import genius.gui.renderer.RepItemListCellRenderer;
|
---|
| 12 |
|
---|
| 13 | /**
|
---|
| 14 | * Panel where user can edit a participant settings
|
---|
| 15 | *
|
---|
| 16 | */
|
---|
| 17 | @SuppressWarnings("serial")
|
---|
| 18 | public 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() {
|
---|
[80] | 29 | add(new LabelAndComponent("Party ID",
|
---|
| 30 | new TextPanel(participantModel.getIdModel())));
|
---|
[1] | 31 |
|
---|
[80] | 32 | final ComboboxSelectionPanel<ParticipantRepItem> partycombo = new ComboboxSelectionPanel<>(
|
---|
| 33 | "Party Strategy", participantModel.getPartyModel());
|
---|
[1] | 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);
|
---|
[80] | 41 |
|
---|
[1] | 42 | JPanel uncertaintyPanel = new JPanel();
|
---|
| 43 | add(uncertaintyPanel);
|
---|
| 44 | }
|
---|
| 45 | } |
---|