Last change
on this file since 209 was 1, checked in by Wouter Pasman, 6 years ago |
Initial import : Genius 9.0.0
|
File size:
1.1 KB
|
Line | |
---|
1 | package genius.gui.tournament;
|
---|
2 |
|
---|
3 | import genius.core.listener.Listener;
|
---|
4 | import genius.gui.panels.CheckboxPanel;
|
---|
5 | import genius.gui.panels.VflowPanelWithBorder;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * Panel that shows options only available when you do bilateral negotiations (2
|
---|
9 | * agents per session).
|
---|
10 | */
|
---|
11 | @SuppressWarnings("serial")
|
---|
12 | public class BilateralOptionsPanel extends VflowPanelWithBorder {
|
---|
13 |
|
---|
14 | private BilateralOptionsModel model;
|
---|
15 | private PartiesAndProfilesPanel agentsProfilesPanel;
|
---|
16 |
|
---|
17 | public BilateralOptionsPanel(BilateralOptionsModel model) {
|
---|
18 | super("Special bilateral options");
|
---|
19 | this.model = model;
|
---|
20 | add(new CheckboxPanel("Agents play both sides", model.getPlayBothSides()));
|
---|
21 |
|
---|
22 | agentsProfilesPanel = new PartiesAndProfilesPanel(model.getPartyModelB(), model.getProfileModelB());
|
---|
23 | add(agentsProfilesPanel);
|
---|
24 |
|
---|
25 | model.getPlayBothSides().addListener(new Listener<Boolean>() {
|
---|
26 |
|
---|
27 | @Override
|
---|
28 | public void notifyChange(Boolean data) {
|
---|
29 | updateVisibility();
|
---|
30 | }
|
---|
31 |
|
---|
32 | });
|
---|
33 | updateVisibility();
|
---|
34 | }
|
---|
35 |
|
---|
36 | private void updateVisibility() {
|
---|
37 | agentsProfilesPanel.setVisible(!model.getPlayBothSides().getValue());
|
---|
38 | }
|
---|
39 |
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.