The Class TempBonusInfoTab allows the user to select which temporary bonus should be applied to their character.
| 71 | * temporary bonus should be applied to their character. |
| 72 | */ |
| 73 | public class TempBonusInfoTab extends FlippingSplitPane implements CharacterInfoTab |
| 74 | { |
| 75 | |
| 76 | /** |
| 77 | * Version for serialisation. |
| 78 | */ |
| 79 | private static final long serialVersionUID = 4521237435574462482L; |
| 80 | |
| 81 | private final TabTitle tabTitle = new TabTitle(Tab.TEMPBONUS); |
| 82 | private final FilteredTreeViewTable<CharacterFacade, TempBonusFacade> availableTable; |
| 83 | private final FilteredTreeViewTable<CharacterFacade, TempBonusFacade> selectedTable; |
| 84 | private final JButton addButton; |
| 85 | private final JButton removeButton; |
| 86 | private final InfoPane infoPane; |
| 87 | private final TempBonusRenderer tempBonusRenderer; |
| 88 | |
| 89 | /** |
| 90 | * Create a new instance of TemporaryBonusInfoTab. |
| 91 | */ |
| 92 | public TempBonusInfoTab() |
| 93 | { |
| 94 | this.availableTable = new FilteredTreeViewTable<>(); |
| 95 | this.selectedTable = new FilteredTreeViewTable<>(); |
| 96 | this.addButton = new JButton(); |
| 97 | this.removeButton = new JButton(); |
| 98 | this.infoPane = new InfoPane(LanguageBundle.getString("in_InfoTempMod")); //$NON-NLS-1$ |
| 99 | this.tempBonusRenderer = new TempBonusRenderer(); |
| 100 | initComponents(); |
| 101 | } |
| 102 | |
| 103 | private void initComponents() |
| 104 | { |
| 105 | FlippingSplitPane topPane = new FlippingSplitPane(); |
| 106 | setTopComponent(topPane); |
| 107 | setOrientation(VERTICAL_SPLIT); |
| 108 | |
| 109 | JPanel availPanel = new JPanel(new BorderLayout()); |
| 110 | FilterBar<CharacterFacade, TempBonusFacade> bar = new FilterBar<>(); |
| 111 | bar.addDisplayableFilter(new SearchFilterPanel()); |
| 112 | availPanel.add(bar, BorderLayout.NORTH); |
| 113 | |
| 114 | availableTable.setDisplayableFilter(bar); |
| 115 | availableTable.setTreeCellRenderer(tempBonusRenderer); |
| 116 | availPanel.add(new JScrollPane(availableTable), BorderLayout.CENTER); |
| 117 | |
| 118 | Box box = Box.createHorizontalBox(); |
| 119 | box.add(Box.createHorizontalGlue()); |
| 120 | addButton.setHorizontalTextPosition(SwingConstants.LEADING); |
| 121 | box.add(addButton); |
| 122 | box.add(Box.createHorizontalStrut(5)); |
| 123 | box.setBorder(new EmptyBorder(0, 0, 5, 0)); |
| 124 | availPanel.add(box, BorderLayout.SOUTH); |
| 125 | |
| 126 | topPane.setLeftComponent(availPanel); |
| 127 | |
| 128 | JPanel selPanel = new JPanel(new BorderLayout()); |
| 129 | FilterBar<CharacterFacade, TempBonusFacade> filterBar = new FilterBar<>(); |
| 130 | filterBar.addDisplayableFilter(new SearchFilterPanel()); |
nothing calls this directly
no outgoing calls
no test coverage detected