source: src/main/java/genius/gui/tournament/PartiesAndProfilesPanel.java@ 346

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

Initial import : Genius 9.0.0

File size: 1.3 KB
Line 
1package genius.gui.tournament;
2
3import java.awt.GridLayout;
4
5import javax.swing.JPanel;
6import javax.swing.ListCellRenderer;
7
8import genius.core.repository.ParticipantRepItem;
9import genius.core.repository.ProfileRepItem;
10import genius.gui.panels.SubsetSelectionModel;
11import genius.gui.panels.SubsetSelectionPanelPlus;
12import genius.gui.renderer.RepItemListCellRenderer;
13
14/**
15 * Panel that shows agents and profiles panels side by side. Both panels get
16 * half of the width.
17 */
18@SuppressWarnings("serial")
19public class PartiesAndProfilesPanel extends JPanel {
20
21 @SuppressWarnings("unchecked")
22 public PartiesAndProfilesPanel(SubsetSelectionModel<ParticipantRepItem> partyModel,
23 SubsetSelectionModel<ProfileRepItem> profileModel) {
24 setLayout(new GridLayout(1, 2));
25
26 SubsetSelectionPanelPlus<ParticipantRepItem> leftPanel = new SubsetSelectionPanelPlus<>("Parties", partyModel);
27 // ugly cast, RepItemListCellRenderer has incorrect typing...
28 leftPanel.setCellRenderer(
29 (ListCellRenderer<ParticipantRepItem>) (ListCellRenderer) new RepItemListCellRenderer());
30 SubsetSelectionPanelPlus<ProfileRepItem> rightPanel = new SubsetSelectionPanelPlus<>("Profiles", profileModel);
31 rightPanel.setCellRenderer((ListCellRenderer<ProfileRepItem>) (ListCellRenderer) new RepItemListCellRenderer());
32 add(leftPanel);
33 add(rightPanel);
34 }
35
36}
Note: See TracBrowser for help on using the repository browser.