The Class DescriptionInfoTab is a placeholder for the yet to be implemented description tab.
| 57 | * implemented description tab. |
| 58 | */ |
| 59 | @SuppressWarnings("serial") |
| 60 | public class DescriptionInfoTab extends FlippingSplitPane implements CharacterInfoTab |
| 61 | { |
| 62 | |
| 63 | private final TabTitle tabTitle = new TabTitle(Tab.DESCRIPTION); |
| 64 | private final PortraitInfoPane portraitPane; |
| 65 | private final BiographyInfoPane bioPane; |
| 66 | private final CampaignHistoryInfoPane histPane; |
| 67 | private final JList pageList; |
| 68 | private final JButton addButton; |
| 69 | private final JPanel pagePanel; |
| 70 | |
| 71 | /** |
| 72 | * Create a new instance of DescriptionInfoTab |
| 73 | */ |
| 74 | public DescriptionInfoTab() |
| 75 | { |
| 76 | super(); //$NON-NLS-1$ |
| 77 | this.portraitPane = new PortraitInfoPane(); |
| 78 | this.bioPane = new BiographyInfoPane(); |
| 79 | this.histPane = new CampaignHistoryInfoPane(); |
| 80 | this.pageList = new JList<>(); |
| 81 | this.addButton = new JButton(); |
| 82 | this.pagePanel = new JPanel(); |
| 83 | initComponents(); |
| 84 | } |
| 85 | |
| 86 | private void initComponents() |
| 87 | { |
| 88 | addButton.setAlignmentX(0.5f); |
| 89 | |
| 90 | Box box = Box.createVerticalBox(); |
| 91 | box.add(new JScrollPane(pageList)); |
| 92 | box.add(Box.createVerticalStrut(5)); |
| 93 | { |
| 94 | Box hbox = Box.createHorizontalBox(); |
| 95 | hbox.add(Box.createRigidArea(new Dimension(8, 0))); |
| 96 | hbox.add(addButton); |
| 97 | hbox.add(Box.createRigidArea(new Dimension(8, 0))); |
| 98 | box.add(hbox); |
| 99 | } |
| 100 | box.add(Box.createVerticalStrut(4)); |
| 101 | setLeftComponent(box); |
| 102 | |
| 103 | CardLayout pages = new CardLayout(); |
| 104 | |
| 105 | pagePanel.setLayout(pages); |
| 106 | addPage(bioPane); |
| 107 | addPage(portraitPane); |
| 108 | addPage(histPane); |
| 109 | setRightComponent(pagePanel); |
| 110 | setResizeWeight(0); |
| 111 | } |
| 112 | |
| 113 | private <T extends Component & CharacterInfoTab> void addPage(T page) |
| 114 | { |
| 115 | pagePanel.add(page, page.getTabTitle().getValue(TabTitle.TITLE)); |
| 116 | } |
nothing calls this directly
no outgoing calls
no test coverage detected