MCPcopy Create free account
hub / github.com/PCGen/pcgen / RaceInfoTab

Class RaceInfoTab

code/src/java/pcgen/gui2/tabs/RaceInfoTab.java:72–595  ·  view source on GitHub ↗

The Class RaceInfoTab is the component used in the Race tab.

Source from the content-addressed store, hash-verified

70 * The Class {@code RaceInfoTab} is the component used in the Race tab.
71 */
72public final class RaceInfoTab extends FlippingSplitPane implements CharacterInfoTab
73{
74
75 private static final TabTitle TITLE = new TabTitle(Tab.RACE);
76 private final FilteredTreeViewTable<Object, Race> raceTable;
77 private final FilteredTreeViewTable<Object, Race> selectedTable;
78 private final InfoPane infoPane;
79 private final JButton selectRaceButton;
80 private final JButton removeButton;
81 private final FilterButton<Object, Race> qFilterButton;
82 private final FilterButton<Object, Race> noRacialHdFilterButton;
83 private final QualifiedTreeCellRenderer qualifiedRenderer;
84
85 RaceInfoTab()
86 {
87 this.raceTable = new FilteredTreeViewTable<>();
88 this.selectedTable = new FilteredTreeViewTable<>();
89 this.infoPane = new InfoPane(LanguageBundle.getString("in_irRaceInfo")); //$NON-NLS-1$
90 this.selectRaceButton = new JButton();
91 this.removeButton = new JButton();
92 this.qFilterButton = new FilterButton<>("RaceQualified");
93 this.noRacialHdFilterButton = new FilterButton<>("RaceNoHD");
94 this.qualifiedRenderer = new QualifiedTreeCellRenderer();
95
96 FlippingSplitPane topPane = new FlippingSplitPane();
97 setTopComponent(topPane);
98 setOrientation(VERTICAL_SPLIT);
99
100 JPanel availPanel = new JPanel(new BorderLayout());
101 FilterBar<Object, Race> bar = new FilterBar<>();
102 bar.addDisplayableFilter(new SearchFilterPanel());
103 noRacialHdFilterButton.setText(LanguageBundle.getString("in_irNoRacialHd")); //$NON-NLS-1$
104 noRacialHdFilterButton.setToolTipText(LanguageBundle.getString("in_irNoRacialHdTip")); //$NON-NLS-1$
105 bar.addDisplayableFilter(noRacialHdFilterButton);
106 qFilterButton.setText(LanguageBundle.getString("in_igQualFilter")); //$NON-NLS-1$
107 bar.addDisplayableFilter(qFilterButton);
108 raceTable.setDisplayableFilter(bar);
109 availPanel.add(bar, BorderLayout.NORTH);
110
111 raceTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
112 raceTable.setTreeCellRenderer(qualifiedRenderer);
113 availPanel.add(new JScrollPane(raceTable), BorderLayout.CENTER);
114
115 Box box = Box.createHorizontalBox();
116 box.add(Box.createHorizontalGlue());
117 selectRaceButton.setHorizontalTextPosition(SwingConstants.LEADING);
118
119 box.add(selectRaceButton);
120 box.add(Box.createHorizontalStrut(5));
121 box.setBorder(new EmptyBorder(0, 0, 5, 0));
122 availPanel.add(box, BorderLayout.SOUTH);
123
124 topPane.setLeftComponent(availPanel);
125
126 JPanel selPanel = new JPanel(new BorderLayout());
127 FilterBar<Object, Race> filterBar = new FilterBar<>();
128 filterBar.addDisplayableFilter(new SearchFilterPanel());
129

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected