Search in sources :

Example 1 with TempBonusFacade

use of pcgen.facade.core.TempBonusFacade in project pcgen by PCGen.

the class TempBonusInfoTab method initComponents.

private void initComponents() {
    FlippingSplitPane topPane = new FlippingSplitPane("TempBonusTop");
    setTopComponent(topPane);
    setOrientation(VERTICAL_SPLIT);
    JPanel availPanel = new JPanel(new BorderLayout());
    FilterBar<CharacterFacade, TempBonusFacade> bar = new FilterBar<>();
    bar.addDisplayableFilter(new SearchFilterPanel());
    availPanel.add(bar, BorderLayout.NORTH);
    availableTable.setDisplayableFilter(bar);
    availableTable.setTreeCellRenderer(tempBonusRenderer);
    availPanel.add(new JScrollPane(availableTable), BorderLayout.CENTER);
    Box box = Box.createHorizontalBox();
    box.add(Box.createHorizontalGlue());
    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());
    FilterBar<CharacterFacade, TempBonusFacade> filterBar = new FilterBar<>();
    filterBar.addDisplayableFilter(new SearchFilterPanel());
    selectedTable.setDisplayableFilter(filterBar);
    selectedTable.setTreeCellRenderer(tempBonusRenderer);
    selPanel.add(new JScrollPane(selectedTable), BorderLayout.CENTER);
    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);
    topPane.setRightComponent(selPanel);
    setBottomComponent(infoPane);
    setResizeWeight(0.75);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FilterBar(pcgen.gui2.filter.FilterBar) TempBonusFacade(pcgen.facade.core.TempBonusFacade) BorderLayout(java.awt.BorderLayout) Box(javax.swing.Box) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) EmptyBorder(javax.swing.border.EmptyBorder) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane) CharacterFacade(pcgen.facade.core.CharacterFacade)

Example 2 with TempBonusFacade

use of pcgen.facade.core.TempBonusFacade in project pcgen by PCGen.

the class Gui2InfoFactory method getHTMLInfo.

@Override
public String getHTMLInfo(InfoFacade facade) {
    if (facade == null) {
        return EMPTY_STRING;
    }
    // Use a more detailed info if we can
    if (facade instanceof AbilityFacade) {
        return getHTMLInfo((AbilityFacade) facade);
    }
    if (facade instanceof ClassFacade) {
        return getHTMLInfo((ClassFacade) facade, null);
    }
    if (facade instanceof DeityFacade) {
        return getHTMLInfo((DeityFacade) facade);
    }
    if (facade instanceof DomainFacade) {
        return getHTMLInfo((DomainFacade) facade);
    }
    if (facade instanceof EquipmentFacade) {
        return getHTMLInfo((EquipmentFacade) facade);
    }
    if (facade instanceof KitFacade) {
        return getHTMLInfo((KitFacade) facade);
    }
    if (facade instanceof RaceFacade) {
        return getHTMLInfo((RaceFacade) facade);
    }
    if (facade instanceof SkillFacade) {
        return getHTMLInfo((SkillFacade) facade);
    }
    if (facade instanceof SpellFacade) {
        return getHTMLInfo((SpellFacade) facade);
    }
    if (facade instanceof TempBonusFacade) {
        return getHTMLInfo((TempBonusFacade) facade);
    }
    if (facade instanceof TemplateFacade) {
        return getHTMLInfo((TemplateFacade) facade);
    }
    final HtmlInfoBuilder infoText = new HtmlInfoBuilder();
    infoText.appendTitleElement(facade.toString());
    infoText.appendLineBreak();
    if (!facade.getType().isEmpty()) {
        //$NON-NLS-1$
        infoText.appendI18nElement("in_irInfoType", facade.getType());
        infoText.appendLineBreak();
    }
    infoText.appendI18nElement(//$NON-NLS-1$
    "in_itmInfoLabelTextSource", facade.getSource());
    return infoText.toString();
}
Also used : DomainFacade(pcgen.facade.core.DomainFacade) EquipmentFacade(pcgen.facade.core.EquipmentFacade) ClassFacade(pcgen.facade.core.ClassFacade) KitFacade(pcgen.facade.core.KitFacade) TempBonusFacade(pcgen.facade.core.TempBonusFacade) AbilityFacade(pcgen.facade.core.AbilityFacade) SkillFacade(pcgen.facade.core.SkillFacade) DeityFacade(pcgen.facade.core.DeityFacade) HtmlInfoBuilder(pcgen.gui2.util.HtmlInfoBuilder) RaceFacade(pcgen.facade.core.RaceFacade) SpellFacade(pcgen.facade.core.SpellFacade) TemplateFacade(pcgen.facade.core.TemplateFacade)

Aggregations

TempBonusFacade (pcgen.facade.core.TempBonusFacade)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 AbilityFacade (pcgen.facade.core.AbilityFacade)1 CharacterFacade (pcgen.facade.core.CharacterFacade)1 ClassFacade (pcgen.facade.core.ClassFacade)1 DeityFacade (pcgen.facade.core.DeityFacade)1 DomainFacade (pcgen.facade.core.DomainFacade)1 EquipmentFacade (pcgen.facade.core.EquipmentFacade)1 KitFacade (pcgen.facade.core.KitFacade)1 RaceFacade (pcgen.facade.core.RaceFacade)1 SkillFacade (pcgen.facade.core.SkillFacade)1 SpellFacade (pcgen.facade.core.SpellFacade)1 TemplateFacade (pcgen.facade.core.TemplateFacade)1 FilterBar (pcgen.gui2.filter.FilterBar)1 SearchFilterPanel (pcgen.gui2.filter.SearchFilterPanel)1 FlippingSplitPane (pcgen.gui2.tools.FlippingSplitPane)1