use of pcgen.facade.core.ClassFacade in project pcgen by PCGen.
the class ClassInfoTab method initComponents.
private void initComponents() {
FlippingSplitPane topPane = new FlippingSplitPane("ClassTop");
setTopComponent(topPane);
setOrientation(VERTICAL_SPLIT);
JPanel availPanel = new JPanel(new BorderLayout());
FilterBar<Object, ClassFacade> bar = new FilterBar<>();
bar.addDisplayableFilter(new SearchFilterPanel());
//$NON-NLS-1$
qFilterButton.setText(LanguageBundle.getString("in_igQualFilter"));
bar.addDisplayableFilter(qFilterButton);
availPanel.add(bar, BorderLayout.NORTH);
availableTable.setTreeCellRenderer(qualifiedRenderer);
availableTable.setDisplayableFilter(bar);
availPanel.add(new JScrollPane(availableTable), BorderLayout.CENTER);
{
Box box = Box.createHorizontalBox();
box.add(Box.createHorizontalGlue());
spinner.setMaximumSize(spinner.getPreferredSize());
box.add(spinner);
box.add(Box.createHorizontalStrut(5));
addButton.setHorizontalTextPosition(SwingConstants.LEADING);
box.add(addButton);
box.add(Box.createHorizontalStrut(5));
box.setBorder(new EmptyBorder(0, 0, 5, 0));
availPanel.add(box, BorderLayout.SOUTH);
}
topPane.setLeftComponent(availPanel);
JPanel selPanel = new JPanel(new BorderLayout());
JScrollPane tablePane = new JScrollPane(classTable);
selPanel.add(tablePane, BorderLayout.CENTER);
{
Box box = Box.createHorizontalBox();
box.add(Box.createHorizontalStrut(5));
box.add(removeButton);
box.add(Box.createHorizontalGlue());
box.setBorder(new EmptyBorder(0, 0, 5, 0));
selPanel.add(box, BorderLayout.SOUTH);
}
{
classTable.setDragEnabled(true);
classTable.setTransferHandler(classTransferHandler);
availableTable.setDragEnabled(true);
availableTable.setTransferHandler(classTransferHandler);
}
initListeners();
topPane.setRightComponent(selPanel);
setBottomComponent(infoPane);
setResizeWeight(0.75);
}
use of pcgen.facade.core.ClassFacade in project pcgen by PCGen.
the class CharacterFacadeImpl method addCharacterLevels.
/**
* @see pcgen.core.facade.CharacterFacade#addCharacterLevels(pcgen.core.facade.ClassFacade[])
*/
@Override
public void addCharacterLevels(ClassFacade[] classes) {
SettingsHandler.setShowHPDialogAtLevelUp(false);
//SettingsHandler.setShowStatDialogAtLevelUp(false);
int oldLevel = charLevelsFacade.getSize();
boolean needFullRefresh = false;
for (ClassFacade classFacade : classes) {
if (classFacade instanceof PCClass) {
int totalLevels = charDisplay.getTotalLevels();
if (!validateAddLevel((PCClass) classFacade)) {
return;
}
Logging.log(Logging.INFO, charDisplay.getName() + ": Adding level " + //$NON-NLS-1$
(totalLevels + 1) + " in class " + //$NON-NLS-1$
classFacade);
theCharacter.incrementClassLevel(1, (PCClass) classFacade);
if (totalLevels == charDisplay.getTotalLevels()) {
// The level change was rejected - no further processing needed.
return;
}
if (((PCClass) classFacade).containsKey(ObjectKey.EXCHANGE_LEVEL)) {
needFullRefresh = true;
}
}
if (!pcClasses.contains(classFacade)) {
pcClasses.add(classFacade);
}
CharacterLevelFacadeImpl cl = new CharacterLevelFacadeImpl(classFacade, charLevelsFacade.getSize() + 1);
pcClassLevels.addElement(cl);
charLevelsFacade.addLevelOfClass(cl);
}
CharacterUtils.selectClothes(getTheCharacter());
// Calculate any active bonuses
theCharacter.calcActiveBonuses();
if (needFullRefresh) {
refreshClassLevelModel();
}
postLevellingUpdates();
delegate.showLevelUpInfo(this, oldLevel);
}
use of pcgen.facade.core.ClassFacade in project pcgen by PCGen.
the class CharacterLevelsFacadeImpl method addLevelOfClass.
// ============== Level Management code =========================
/**
* Register the addition of a new level to the character of the
* specified class. It is expected that the backing PlayerCharacter object
* will be updated by our caller.
* @param theClassLevel The class the level is in.
*/
void addLevelOfClass(CharacterLevelFacadeImpl theClassLevel) {
ClassFacade theClass = theClassLevel.getSelectedClass();
classLevels.add(theClass);
addElement(theClassLevel);
updateSkillsTodo();
}
Aggregations