Search in sources :

Example 1 with DomainFacade

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

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

the class DomainInfoTab method initComponents.

private void initComponents() {
    setOrientation(VERTICAL_SPLIT);
    deityTable.setTreeCellRenderer(qualifiedRenderer);
    JPanel panel = new JPanel(new BorderLayout());
    FilterBar<Object, DeityFacade> bar = new FilterBar<>();
    bar.addDisplayableFilter(new SearchFilterPanel());
    //$NON-NLS-1$
    qDeityButton.setText(LanguageBundle.getString("in_igQualFilter"));
    bar.addDisplayableFilter(qDeityButton);
    deityTable.setDisplayableFilter(bar);
    panel.add(bar, BorderLayout.NORTH);
    ListSelectionModel selectionModel = deityTable.getSelectionModel();
    selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    panel.add(new JScrollPane(deityTable), BorderLayout.CENTER);
    Box box = Box.createHorizontalBox();
    box.add(Box.createHorizontalGlue());
    //$NON-NLS-1$
    box.add(new JLabel(LanguageBundle.getString("in_domDeityLabel")));
    box.add(Box.createHorizontalStrut(5));
    box.add(selectedDeity);
    box.add(Box.createHorizontalStrut(5));
    box.add(selectDeity);
    box.add(Box.createHorizontalGlue());
    panel.add(box, BorderLayout.SOUTH);
    FlippingSplitPane splitPane = new FlippingSplitPane("DomainTop");
    splitPane.setLeftComponent(panel);
    panel = new JPanel(new BorderLayout());
    FilterBar<CharacterFacade, DomainFacade> dbar = new FilterBar<>();
    dbar.addDisplayableFilter(new SearchFilterPanel());
    //$NON-NLS-1$
    qDomainButton.setText(LanguageBundle.getString("in_igQualFilter"));
    dbar.addDisplayableFilter(qDomainButton);
    domainFilter = dbar;
    panel.add(dbar, BorderLayout.NORTH);
    selectionModel = domainTable.getSelectionModel();
    selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    domainTable.setAutoCreateColumnsFromModel(false);
    domainTable.setColumnModel(createDomainColumnModel());
    JScrollPane scrollPane = TableUtils.createCheckBoxSelectionPane(domainTable, domainRowHeaderTable);
    panel.add(scrollPane, BorderLayout.CENTER);
    box = Box.createHorizontalBox();
    box.add(Box.createHorizontalGlue());
    //$NON-NLS-1$
    box.add(new JLabel(LanguageBundle.getString("in_domRemainDomLabel")));
    box.add(Box.createHorizontalStrut(5));
    box.add(selectedDomain);
    box.add(Box.createHorizontalGlue());
    panel.add(box, BorderLayout.SOUTH);
    splitPane.setRightComponent(panel);
    setTopComponent(splitPane);
    splitPane = new FlippingSplitPane("DomainBottom");
    splitPane.setLeftComponent(deityInfo);
    splitPane.setRightComponent(domainInfo);
    setBottomComponent(splitPane);
    setResizeWeight(0.65);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) ListSelectionModel(javax.swing.ListSelectionModel) JLabel(javax.swing.JLabel) Box(javax.swing.Box) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane) CharacterFacade(pcgen.facade.core.CharacterFacade) DomainFacade(pcgen.facade.core.DomainFacade) FilterBar(pcgen.gui2.filter.FilterBar) BorderLayout(java.awt.BorderLayout) DeityFacade(pcgen.facade.core.DeityFacade) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel)

Aggregations

DeityFacade (pcgen.facade.core.DeityFacade)2 DomainFacade (pcgen.facade.core.DomainFacade)2 BorderLayout (java.awt.BorderLayout)1 Box (javax.swing.Box)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 ListSelectionModel (javax.swing.ListSelectionModel)1 AbilityFacade (pcgen.facade.core.AbilityFacade)1 CharacterFacade (pcgen.facade.core.CharacterFacade)1 ClassFacade (pcgen.facade.core.ClassFacade)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 TempBonusFacade (pcgen.facade.core.TempBonusFacade)1 TemplateFacade (pcgen.facade.core.TemplateFacade)1 FilterBar (pcgen.gui2.filter.FilterBar)1 SearchFilterPanel (pcgen.gui2.filter.SearchFilterPanel)1