| 77 | import pcgen.util.enumeration.Tab; |
| 78 | |
| 79 | @SuppressWarnings("serial") |
| 80 | public class ClassInfoTab extends FlippingSplitPane implements CharacterInfoTab |
| 81 | { |
| 82 | |
| 83 | /** |
| 84 | * The table of available classes |
| 85 | */ |
| 86 | private final FilteredTreeViewTable<Object, PCClass> availableTable; |
| 87 | /** |
| 88 | * The table of the character's classes |
| 89 | */ |
| 90 | private final JTable classTable; |
| 91 | private final JButton addButton; |
| 92 | private final JButton removeButton; |
| 93 | private final TabTitle tabTitle; |
| 94 | private final InfoPane infoPane; |
| 95 | private final JSpinner spinner; |
| 96 | private final FilterButton<Object, PCClass> qFilterButton; |
| 97 | private final QualifiedTreeCellRenderer qualifiedRenderer; |
| 98 | private final ClassTransferHandler classTransferHandler; |
| 99 | private int spinnerValue; |
| 100 | |
| 101 | public ClassInfoTab() |
| 102 | { |
| 103 | super(); |
| 104 | this.availableTable = new FilteredTreeViewTable<>(); |
| 105 | this.classTable = TableUtils.createDefaultTable(); |
| 106 | this.addButton = new JButton(); |
| 107 | this.removeButton = new JButton(); |
| 108 | this.tabTitle = new TabTitle(Tab.CLASSES); |
| 109 | this.infoPane = new InfoPane(LanguageBundle.getString("in_clInfo")); //$NON-NLS-1$ |
| 110 | this.spinner = new JSpinner(new SpinnerNumberModel(1, 1, 50, 1)); |
| 111 | this.qFilterButton = new FilterButton<>("ClassQualified"); |
| 112 | this.qualifiedRenderer = new QualifiedTreeCellRenderer(); |
| 113 | this.classTransferHandler = new ClassTransferHandler(); |
| 114 | initComponents(); |
| 115 | } |
| 116 | |
| 117 | private void initComponents() |
| 118 | { |
| 119 | FlippingSplitPane topPane = new FlippingSplitPane(); |
| 120 | setTopComponent(topPane); |
| 121 | setOrientation(VERTICAL_SPLIT); |
| 122 | |
| 123 | JPanel availPanel = new JPanel(new BorderLayout()); |
| 124 | FilterBar<Object, PCClass> bar = new FilterBar<>(); |
| 125 | bar.addDisplayableFilter(new SearchFilterPanel()); |
| 126 | qFilterButton.setText(LanguageBundle.getString("in_igQualFilter")); //$NON-NLS-1$ |
| 127 | bar.addDisplayableFilter(qFilterButton); |
| 128 | availPanel.add(bar, BorderLayout.NORTH); |
| 129 | |
| 130 | availableTable.setTreeCellRenderer(qualifiedRenderer); |
| 131 | availableTable.setDisplayableFilter(bar); |
| 132 | availPanel.add(new JScrollPane(availableTable), BorderLayout.CENTER); |
| 133 | { |
| 134 | Box box = Box.createHorizontalBox(); |
| 135 | box.add(Box.createHorizontalGlue()); |
| 136 | spinner.setMaximumSize(spinner.getPreferredSize()); |
nothing calls this directly
no outgoing calls
no test coverage detected