Search in sources :

Example 1 with KitFacade

use of pcgen.facade.core.KitFacade 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)

Example 2 with KitFacade

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

the class KitPanel method initComponents.

private void initComponents() {
    renderer.setCharacter(character);
    FlippingSplitPane topPane = new FlippingSplitPane("kitTop");
    setTopComponent(topPane);
    setOrientation(VERTICAL_SPLIT);
    FilterBar<Object, KitFacade> bar = new FilterBar<>();
    bar.addDisplayableFilter(new SearchFilterPanel());
    //$NON-NLS-1$
    qFilterButton.setText(LanguageBundle.getString("in_igQualFilter"));
    bar.addDisplayableFilter(qFilterButton);
    availableTable.setTreeViewModel(new KitTreeViewModel(character, true));
    availableTable.setTreeCellRenderer(renderer);
    JPanel availPanel = FilterUtilities.configureFilteredTreeViewPane(availableTable, bar);
    Box box = Box.createHorizontalBox();
    box.add(Box.createHorizontalGlue());
    addButton.setHorizontalTextPosition(SwingConstants.LEADING);
    addButton.setAction(addAction);
    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<Object, KitFacade> filterBar = new FilterBar<>();
    filterBar.addDisplayableFilter(new SearchFilterPanel());
    selectedTable.setDisplayableFilter(filterBar);
    selectedTable.setTreeViewModel(new KitTreeViewModel(character, false));
    selectedTable.setTreeCellRenderer(renderer);
    selPanel.add(new JScrollPane(selectedTable), BorderLayout.CENTER);
    topPane.setRightComponent(selPanel);
    setBottomComponent(infoPane);
    setResizeWeight(0.75);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FilterBar(pcgen.gui2.filter.FilterBar) KitFacade(pcgen.facade.core.KitFacade) BorderLayout(java.awt.BorderLayout) Box(javax.swing.Box) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) EmptyBorder(javax.swing.border.EmptyBorder) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane)

Aggregations

KitFacade (pcgen.facade.core.KitFacade)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 ClassFacade (pcgen.facade.core.ClassFacade)1 DeityFacade (pcgen.facade.core.DeityFacade)1 DomainFacade (pcgen.facade.core.DomainFacade)1 EquipmentFacade (pcgen.facade.core.EquipmentFacade)1 RaceFacade (pcgen.facade.core.RaceFacade)1 SkillFacade (pcgen.facade.core.SkillFacade)1 SpellFacade (pcgen.facade.core.SpellFacade)1 TempBonusFacade (pcgen.facade.core.TempBonusFacade)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 HtmlInfoBuilder (pcgen.gui2.util.HtmlInfoBuilder)1