[1] | 1 | package genius.gui.session;
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 | import javax.swing.BoxLayout;
|
---|
| 6 | import javax.swing.JPanel;
|
---|
| 7 |
|
---|
| 8 | import genius.core.repository.ParticipantRepItem;
|
---|
| 9 | import genius.core.repository.ProfileRepItem;
|
---|
| 10 | import genius.gui.panels.ComboboxSelectionPanel;
|
---|
| 11 | import genius.gui.panels.ExtendedCheckboxPanel;
|
---|
| 12 | import genius.gui.panels.LabelAndComponent;
|
---|
| 13 | import genius.gui.panels.TextPanel;
|
---|
| 14 | import genius.gui.renderer.RepItemListCellRenderer;
|
---|
| 15 |
|
---|
| 16 | /**
|
---|
| 17 | * Panel where user can edit a participant settings
|
---|
| 18 | *
|
---|
| 19 | */
|
---|
| 20 | @SuppressWarnings("serial")
|
---|
| 21 | public class ParticipantPanel extends JPanel {
|
---|
| 22 |
|
---|
| 23 | private ParticipantModel participantModel;
|
---|
| 24 |
|
---|
| 25 | public ParticipantPanel(ParticipantModel participantModel) {
|
---|
| 26 | setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
|
---|
| 27 | this.participantModel = participantModel;
|
---|
| 28 | init();
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | private void init() {
|
---|
| 32 | add(new LabelAndComponent("Party ID", new TextPanel(participantModel.getIdModel())));
|
---|
| 33 |
|
---|
| 34 | final ComboboxSelectionPanel<ParticipantRepItem> partycombo = new ComboboxSelectionPanel<>("Party Strategy",
|
---|
| 35 | participantModel.getPartyModel());
|
---|
| 36 | partycombo.setCellRenderer(new RepItemListCellRenderer());
|
---|
| 37 | add(partycombo);
|
---|
| 38 |
|
---|
| 39 | final ComboboxSelectionPanel<ProfileRepItem> profilecombo = new ComboboxSelectionPanel<ProfileRepItem>(
|
---|
| 40 | "Preference Profile", participantModel.getProfileModel());
|
---|
| 41 | profilecombo.setCellRenderer(new RepItemListCellRenderer());
|
---|
| 42 | add(profilecombo);
|
---|
| 43 |
|
---|
| 44 | JPanel uncertaintyPanel = new JPanel();
|
---|
| 45 | ExtendedCheckboxPanel uncertaintyOptionBox = new ExtendedCheckboxPanel("Add Uncertainty", participantModel.getUncertaintyOptionBox());
|
---|
| 46 | uncertaintyPanel.add(uncertaintyOptionBox);
|
---|
| 47 | uncertaintyOptionBox.setVisible(false); //Will be changed in later versions
|
---|
| 48 | add(uncertaintyPanel);
|
---|
| 49 | }
|
---|
| 50 | } |
---|