Search in sources :

Example 6 with ClassFacade

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);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FilterBar(pcgen.gui2.filter.FilterBar) ClassFacade(pcgen.facade.core.ClassFacade) BorderLayout(java.awt.BorderLayout) Box(javax.swing.Box) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) EmptyBorder(javax.swing.border.EmptyBorder) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane)

Example 7 with ClassFacade

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);
}
Also used : ClassFacade(pcgen.facade.core.ClassFacade) PCClass(pcgen.core.PCClass)

Example 8 with ClassFacade

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();
}
Also used : ClassFacade(pcgen.facade.core.ClassFacade)

Aggregations

ClassFacade (pcgen.facade.core.ClassFacade)8 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)2 PCClass (pcgen.core.PCClass)2 SpellFacade (pcgen.facade.core.SpellFacade)2 BorderLayout (java.awt.BorderLayout)1 Box (javax.swing.Box)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 EmptyBorder (javax.swing.border.EmptyBorder)1 TreePath (javax.swing.tree.TreePath)1 AbilityFacade (pcgen.facade.core.AbilityFacade)1 CharacterLevelFacade (pcgen.facade.core.CharacterLevelFacade)1 DeityFacade (pcgen.facade.core.DeityFacade)1 DomainFacade (pcgen.facade.core.DomainFacade)1 EquipmentFacade (pcgen.facade.core.EquipmentFacade)1 InfoFacade (pcgen.facade.core.InfoFacade)1 KitFacade (pcgen.facade.core.KitFacade)1 RaceFacade (pcgen.facade.core.RaceFacade)1 SkillFacade (pcgen.facade.core.SkillFacade)1 SpellNode (pcgen.facade.core.SpellSupportFacade.SpellNode)1