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

Class CompanionInfoTab

code/src/java/pcgen/gui2/tabs/CompanionInfoTab.java:107–1135  ·  view source on GitHub ↗

This component allows a user to manage a character's companions (animal, familiar, cohort, mount, etc).

Source from the content-addressed store, hash-verified

105 * familiar, cohort, mount, etc).
106 */
107@SuppressWarnings("PMD.UseArrayListInsteadOfVector")
108public class CompanionInfoTab extends FlippingSplitPane implements CharacterInfoTab, TodoHandler, DisplayAwareTab
109{
110
111 private final JTreeTable companionsTable;
112 private final JFXPanelFromResource<SimpleHtmlPanelController> infoPane;
113 private final JButton loadButton;
114 private CompanionDialog companionDialog = null;
115 private Object selectedElement;
116
117 CompanionInfoTab()
118 {
119 this.companionsTable = new JTreeTable()
120 {
121 @Override
122 protected void configureEnclosingScrollPane()
123 {
124 //We do nothing so the table is displayed without a header
125 }
126
127 };
128 this.infoPane = new JFXPanelFromResource<>(
129 SimpleHtmlPanelController.class,
130 "SimpleHtmlPanel.fxml"
131 );
132 this.loadButton = new JButton();
133 initComponents();
134 }
135
136 private void initDialog()
137 {
138 if (companionDialog == null)
139 {
140 companionDialog = new CompanionDialog();
141 }
142 }
143
144 private void initComponents()
145 {
146 {
147 DefaultTableColumnModel model = new DefaultTableColumnModel();
148 TableColumn column = new TableColumn(0);
149 column.setResizable(true);
150 model.addColumn(column);
151
152 column = new TableColumn(1, 120, new ButtonCellRenderer(), null);
153 column.setMaxWidth(120);
154 column.setResizable(false);
155 model.addColumn(column);
156
157 companionsTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
158 companionsTable.getTableHeader().setResizingAllowed(false);
159 companionsTable.setAutoCreateColumnsFromModel(false);
160 companionsTable.setColumnModel(model);
161 }
162 companionsTable.setIntercellSpacing(new Dimension(0, 0));
163 companionsTable.setFocusable(false);
164 companionsTable.setRowHeight(23);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected