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

Class AbilitiesInfoTab

code/src/java/pcgen/gui2/tabs/AbilitiesInfoTab.java:51–319  ·  view source on GitHub ↗

This component is the tabbed pane which contains all of the AbilityChooserTabs. This component doesn't actually display any character information, that is the job of the AbilityChooserTab. All this class does is manage the states of all the AbilityChooserTab. @see AbilityChooserTab

Source from the content-addressed store, hash-verified

49 * @see AbilityChooserTab
50 */
51@SuppressWarnings("serial")
52public class AbilitiesInfoTab extends SharedTabPane implements CharacterInfoTab, TodoHandler
53{
54
55 private final AbilityChooserTab abilityTab;
56 private final TabTitle tabTitle;
57
58 public AbilitiesInfoTab()
59 {
60 this.abilityTab = new AbilityChooserTab();
61 this.tabTitle = new TabTitle(Tab.ABILITIES);
62 setSharedComponent(abilityTab);
63 }
64
65 @Override
66 public ModelMap createModels(CharacterFacade character)
67 {
68 ModelMap models = new ModelMap();
69 models.put(AbilityTabsModel.class, new AbilityTabsModel(character));
70 return models;
71 }
72
73 @Override
74 public void storeModels(ModelMap models)
75 {
76 models.get(AbilityTabsModel.class).uninstall();
77 }
78
79 @Override
80 public void restoreModels(ModelMap models)
81 {
82 models.get(AbilityTabsModel.class).install();
83 }
84
85 @Override
86 public TabTitle getTabTitle()
87 {
88 return tabTitle;
89 }
90
91 private class AbilityTabsModel implements ListListener<AbilityCategory>, ChangeListener
92 {
93
94 private final Map<String, TabInfo> typeMap = new HashMap<>();
95 private final List<TabInfo> tabs = new ArrayList<>();
96 private final MapFacade<AbilityCategory, ListFacade<AbilityFacade>> categoryMap;
97 private final CharacterFacade character;
98 private boolean isInstalled = false;
99 private String selectedTitle;
100 private final ListFacade<AbilityCategory> activeCategories;
101
102 public AbilityTabsModel(CharacterFacade character)
103 {
104 this.character = character;
105 this.activeCategories = character.getActiveAbilityCategories();
106 this.categoryMap = character.getDataSet().getAbilities();
107 for (AbilityCategory category : activeCategories)
108 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected