Search in sources :

Example 1 with SearchFilterPanel

use of pcgen.gui2.filter.SearchFilterPanel in project pcgen by PCGen.

the class PurchaseInfoTab method initComponents.

private void initComponents() {
    setOrientation(VERTICAL_SPLIT);
    //$NON-NLS-1$
    FlippingSplitPane splitPane = new FlippingSplitPane("PurchaseTop");
    splitPane.setOrientation(HORIZONTAL_SPLIT);
    {
        // Top Left panel
        FilterBar<CharacterFacade, EquipmentFacade> filterBar = new FilterBar<>();
        {
            // Filters
            filterBar.addDisplayableFilter(new SearchFilterPanel());
            FilterButton<CharacterFacade, EquipmentFacade> premadeFilter = //$NON-NLS-1$
            new FilterButton<>("EqQualified");
            //$NON-NLS-1$
            premadeFilter.setText(LanguageBundle.getString("in_igQualFilter"));
            premadeFilter.setFilter(CharacterFacade::isQualifiedFor);
            FilterButton<CharacterFacade, EquipmentFacade> customFilter = //$NON-NLS-1$
            new FilterButton<>("EqAffordable");
            //$NON-NLS-1$
            customFilter.setText(LanguageBundle.getString("in_igAffordFilter"));
            customFilter.setFilter(new Filter<CharacterFacade, EquipmentFacade>() {

                @Override
                public boolean accept(CharacterFacade context, EquipmentFacade element) {
                    return context.getInfoFactory().getCost(element) <= context.getFundsRef().get().floatValue();
                }
            });
            filterBar.addDisplayableFilter(premadeFilter);
            filterBar.addDisplayableFilter(customFilter);
        }
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(filterBar, BorderLayout.NORTH);
        availableTable.setTreeCellRenderer(equipmentRenderer);
        availableTable.setDisplayableFilter(filterBar);
        panel.add(new JScrollPane(availableTable), BorderLayout.CENTER);
        Box box = Box.createHorizontalBox();
        box.add(Box.createHorizontalStrut(5));
        box.add(autoResizeBox);
        box.add(Box.createHorizontalGlue());
        addCustomButton.setHorizontalTextPosition(SwingConstants.LEADING);
        box.add(addCustomButton);
        box.add(Box.createHorizontalStrut(5));
        addEquipmentButton.setHorizontalTextPosition(SwingConstants.LEADING);
        box.add(addEquipmentButton);
        box.add(Box.createHorizontalStrut(5));
        box.setBorder(new EmptyBorder(0, 0, 5, 0));
        panel.add(box, BorderLayout.SOUTH);
        splitPane.setLeftComponent(panel);
    }
    {
        // Top Right panel
        FilterBar<CharacterFacade, EquipmentFacade> filterBar = new FilterBar<>();
        filterBar.addDisplayableFilter(new SearchFilterPanel());
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(filterBar, BorderLayout.NORTH);
        purchasedTable.setDisplayableFilter(filterBar);
        purchasedTable.setTreeCellRenderer(equipmentRenderer);
        panel.add(new JScrollPane(purchasedTable), BorderLayout.CENTER);
        Box box = Box.createHorizontalBox();
        box.add(Box.createHorizontalStrut(5));
        box.add(removeEquipmentButton);
        box.add(Box.createHorizontalGlue());
        box.setBorder(new EmptyBorder(0, 0, 5, 0));
        panel.add(box, BorderLayout.SOUTH);
        splitPane.setRightComponent(panel);
    }
    setTopComponent(splitPane);
    //$NON-NLS-1$
    splitPane = new FlippingSplitPane("PurchaseBottom");
    splitPane.setOrientation(HORIZONTAL_SPLIT);
    {
        // Bottom Left Panel
        JPanel panel = new JPanel();
        initMoneyPanel(panel);
        splitPane.setLeftComponent(panel);
    }
    {
        // Bottom Right Panel
        //$NON-NLS-1$
        infoPane.setTitle(LanguageBundle.getString("in_igEqInfo"));
        splitPane.setRightComponent(infoPane);
    }
    splitPane.setResizeWeight(0.25);
    setResizeWeight(1);
    setBottomComponent(splitPane);
}
Also used : EquipmentFacade(pcgen.facade.core.EquipmentFacade) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FilterButton(pcgen.gui2.filter.FilterButton) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane) CharacterFacade(pcgen.facade.core.CharacterFacade) FilterBar(pcgen.gui2.filter.FilterBar) BorderLayout(java.awt.BorderLayout) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) EmptyBorder(javax.swing.border.EmptyBorder)

Example 2 with SearchFilterPanel

use of pcgen.gui2.filter.SearchFilterPanel in project pcgen by PCGen.

the class RaceInfoTab method initComponents.

private void initComponents() {
    FlippingSplitPane topPane = new FlippingSplitPane("RaceTop");
    setTopComponent(topPane);
    setOrientation(VERTICAL_SPLIT);
    JPanel availPanel = new JPanel(new BorderLayout());
    FilterBar<Object, RaceFacade> bar = new FilterBar<>();
    bar.addDisplayableFilter(new SearchFilterPanel());
    //$NON-NLS-1$
    noRacialHdFilterButton.setText(LanguageBundle.getString("in_irNoRacialHd"));
    //$NON-NLS-1$
    noRacialHdFilterButton.setToolTipText(LanguageBundle.getString("in_irNoRacialHdTip"));
    bar.addDisplayableFilter(noRacialHdFilterButton);
    //$NON-NLS-1$
    qFilterButton.setText(LanguageBundle.getString("in_igQualFilter"));
    bar.addDisplayableFilter(qFilterButton);
    raceTable.setDisplayableFilter(bar);
    availPanel.add(bar, BorderLayout.NORTH);
    raceTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    raceTable.setTreeCellRenderer(qualifiedRenderer);
    availPanel.add(new JScrollPane(raceTable), BorderLayout.CENTER);
    Box box = Box.createHorizontalBox();
    box.add(Box.createHorizontalGlue());
    selectRaceButton.setHorizontalTextPosition(SwingConstants.LEADING);
    box.add(selectRaceButton);
    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, RaceFacade> filterBar = new FilterBar<>();
    filterBar.addDisplayableFilter(new SearchFilterPanel());
    selectedTable.setDisplayableFilter(filterBar);
    selectedTable.setTreeCellRenderer(qualifiedRenderer);
    JScrollPane scrollPane = new JScrollPane(selectedTable);
    selPanel.add(scrollPane, BorderLayout.CENTER);
    scrollPane.setPreferredSize(new Dimension(0, 0));
    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);
    topPane.setResizeWeight(0.75);
    setBottomComponent(infoPane);
    setResizeWeight(0.75);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FilterBar(pcgen.gui2.filter.FilterBar) BorderLayout(java.awt.BorderLayout) Box(javax.swing.Box) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) Dimension(java.awt.Dimension) EmptyBorder(javax.swing.border.EmptyBorder) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane) RaceFacade(pcgen.facade.core.RaceFacade)

Example 3 with SearchFilterPanel

use of pcgen.gui2.filter.SearchFilterPanel in project pcgen by PCGen.

the class AbilityChooserTab method initComponents.

private void initComponents() {
    setOrientation(VERTICAL_SPLIT);
    availableTreeViewPanel.setDefaultRenderer(Boolean.class, new BooleanRenderer());
    availableTreeViewPanel.setTreeCellRenderer(qualifiedRenderer);
    selectedTreeViewPanel.setTreeCellRenderer(abilityRenderer);
    FilterBar<CharacterFacade, AbilityFacade> filterBar = new FilterBar<>();
    filterBar.addDisplayableFilter(new SearchFilterPanel());
    //$NON-NLS-1$
    qFilterButton.setText(LanguageBundle.getString("in_igQualFilter"));
    filterBar.addDisplayableFilter(qFilterButton);
    JPanel availPanel = FilterUtilities.configureFilteredTreeViewPane(availableTreeViewPanel, filterBar);
    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);
    JPanel selPanel = new JPanel(new BorderLayout());
    selPanel.add(new JScrollPane(selectedTreeViewPanel), BorderLayout.CENTER);
    AbilityTreeTableModel.initializeTreeTable(selectedTreeViewPanel);
    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);
    FlippingSplitPane topPane = new FlippingSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, availPanel, selPanel, "abilityTop");
    setTopComponent(topPane);
    FilterButton<CharacterFacade, AbilityCategoryFacade> gainedFilterButton = new FilterButton<>("AbilityGained", true);
    //$NON-NLS-1$
    gainedFilterButton.setText(LanguageBundle.getString("in_gained"));
    gainedFilterButton.setEnabled(true);
    gainedFilterButton.setFilter(new Filter<CharacterFacade, AbilityCategoryFacade>() {

        @Override
        public boolean accept(CharacterFacade context, AbilityCategoryFacade element) {
            return context.getActiveAbilityCategories().containsElement(element);
        }
    });
    categoryBar.addDisplayableFilter(gainedFilterButton);
    JPanel filterPanel = new JPanel(new BorderLayout());
    filterPanel.add(categoryBar, BorderLayout.NORTH);
    filterPanel.add(new JScrollPane(categoryTable), BorderLayout.CENTER);
    FlippingSplitPane bottomPane = new FlippingSplitPane(JSplitPane.HORIZONTAL_SPLIT, "abilityBottom");
    bottomPane.setLeftComponent(filterPanel);
    bottomPane.setRightComponent(infoPane);
    setBottomComponent(bottomPane);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) AbilityCategoryFacade(pcgen.facade.core.AbilityCategoryFacade) FilterButton(pcgen.gui2.filter.FilterButton) Box(javax.swing.Box) CharacterFacade(pcgen.facade.core.CharacterFacade) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane) FilterBar(pcgen.gui2.filter.FilterBar) BorderLayout(java.awt.BorderLayout) AbilityFacade(pcgen.facade.core.AbilityFacade) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) EmptyBorder(javax.swing.border.EmptyBorder)

Example 4 with SearchFilterPanel

use of pcgen.gui2.filter.SearchFilterPanel 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)

Example 5 with SearchFilterPanel

use of pcgen.gui2.filter.SearchFilterPanel in project pcgen by PCGen.

the class EquipInfoTab method initComponents.

private void initComponents() {
    FontManipulation.small(newSetButton);
    newSetButton.setMargin(new Insets(0, 0, 0, 0));
    FontManipulation.small(removeSetButton);
    removeSetButton.setMargin(new Insets(0, 0, 0, 0));
    //$NON-NLS-1$
    exportTemplateButton.setText(LanguageBundle.getString("in_equipExportTemplate"));
    //$NON-NLS-1$
    viewBrowserButton.setText(LanguageBundle.getString("in_equipViewBrowser"));
    //$NON-NLS-1$
    exportFileButton.setText(LanguageBundle.getString("in_equipExportFile"));
    //$NON-NLS-1$
    setNoteButton.setText(LanguageBundle.getString("in_equipSetNote"));
    setOrientation(HORIZONTAL_SPLIT);
    FlippingSplitPane splitPane = new FlippingSplitPane(VERTICAL_SPLIT, "EquipMain");
    JPanel panel = new JPanel(new BorderLayout());
    Box bar = Box.createHorizontalBox();
    bar.add(Box.createHorizontalStrut(5));
    //$NON-NLS-1$
    bar.add(new JLabel(LanguageBundle.getString("in_equipView")));
    bar.add(Box.createHorizontalStrut(5));
    bar.add(equipViewBox);
    bar.add(Box.createHorizontalStrut(5));
    tableFilter = new SearchFilterPanel();
    bar.add(tableFilter.getFilterComponent());
    bar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
    panel.add(bar, BorderLayout.NORTH);
    equipmentTable.setAutoCreateColumnsFromModel(false);
    equipmentTable.setColumnModel(createEquipmentColumnModel());
    equipmentTable.setAutoCreateRowSorter(true);
    panel.add(new JScrollPane(equipmentTable), BorderLayout.CENTER);
    Box buttonsBox = Box.createHorizontalBox();
    buttonsBox.add(Box.createHorizontalGlue());
    equipButton.setHorizontalTextPosition(SwingConstants.LEADING);
    buttonsBox.add(equipButton);
    buttonsBox.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
    panel.add(buttonsBox, BorderLayout.SOUTH);
    splitPane.setTopComponent(panel);
    splitPane.setBottomComponent(infoPane);
    setLeftComponent(splitPane);
    panel = new JPanel(new BorderLayout());
    Box equipPane = Box.createVerticalBox();
    Box box = Box.createHorizontalBox();
    box.add(Box.createHorizontalGlue());
    //$NON-NLS-1$
    box.add(new JLabel(LanguageBundle.getString("in_equipSetLabel")));
    box.add(Box.createHorizontalStrut(3));
    box.add(equipSetBox);
    box.add(Box.createHorizontalStrut(3));
    box.add(newSetButton);
    box.add(Box.createHorizontalStrut(3));
    box.add(removeSetButton);
    box.add(Box.createHorizontalGlue());
    //$NON-NLS-1$
    box.add(new JLabel(LanguageBundle.getString("in_equipWeightLabel")));
    box.add(Box.createHorizontalStrut(5));
    box.add(weightLabel);
    box.add(Box.createHorizontalGlue());
    //$NON-NLS-1$
    box.add(new JLabel(LanguageBundle.getString("in_equipLoadLabel")));
    box.add(Box.createHorizontalStrut(5));
    box.add(loadLabel);
    //		box.add(Box.createHorizontalGlue());
    //		box.add(new JLabel("Limit:"));
    box.add(Box.createHorizontalStrut(5));
    box.add(limitLabel);
    box.add(Box.createHorizontalGlue());
    equipPane.add(Box.createVerticalStrut(3));
    equipPane.add(box);
    equipPane.add(Box.createVerticalStrut(3));
    box = Box.createHorizontalBox();
    box.add(exportTemplateButton);
    exportTemplateButton.setEnabled(false);
    box.add(Box.createHorizontalStrut(3));
    box.add(viewBrowserButton);
    viewBrowserButton.setEnabled(false);
    box.add(Box.createHorizontalStrut(3));
    box.add(exportFileButton);
    exportFileButton.setEnabled(false);
    box.add(Box.createHorizontalStrut(3));
    box.add(setNoteButton);
    setNoteButton.setEnabled(false);
    box.add(Box.createHorizontalStrut(3));
    box.add(expandAllButton);
    box.add(Box.createHorizontalStrut(3));
    box.add(collapseAllButton);
    equipPane.add(box);
    equipPane.add(Box.createVerticalStrut(3));
    panel.add(equipPane, BorderLayout.NORTH);
    EquipmentModel.initializeTreeTable(equipmentSetTable);
    panel.add(new JScrollPane(equipmentSetTable), BorderLayout.CENTER);
    Box selPanelbuttonsBox = Box.createHorizontalBox();
    selPanelbuttonsBox.add(Box.createHorizontalStrut(3));
    selPanelbuttonsBox.add(unequipButton);
    selPanelbuttonsBox.add(Box.createHorizontalStrut(3));
    selPanelbuttonsBox.add(unequipAllButton);
    selPanelbuttonsBox.add(Box.createHorizontalStrut(3));
    selPanelbuttonsBox.add(moveUpButton);
    selPanelbuttonsBox.add(Box.createHorizontalStrut(3));
    selPanelbuttonsBox.add(moveDownButton);
    selPanelbuttonsBox.add(Box.createHorizontalGlue());
    selPanelbuttonsBox.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
    panel.add(selPanelbuttonsBox, BorderLayout.SOUTH);
    setRightComponent(panel);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) JLabel(javax.swing.JLabel) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane)

Aggregations

JPanel (javax.swing.JPanel)15 JScrollPane (javax.swing.JScrollPane)15 SearchFilterPanel (pcgen.gui2.filter.SearchFilterPanel)15 FlippingSplitPane (pcgen.gui2.tools.FlippingSplitPane)15 Box (javax.swing.Box)14 FilterBar (pcgen.gui2.filter.FilterBar)14 BorderLayout (java.awt.BorderLayout)12 EmptyBorder (javax.swing.border.EmptyBorder)9 CharacterFacade (pcgen.facade.core.CharacterFacade)9 JLabel (javax.swing.JLabel)6 JComboBox (javax.swing.JComboBox)5 Dimension (java.awt.Dimension)4 JCheckBox (javax.swing.JCheckBox)3 SuperNode (pcgen.facade.core.SpellSupportFacade.SuperNode)3 SortableTableModel (pcgen.gui2.util.table.SortableTableModel)3 SortableTableRowSorter (pcgen.gui2.util.table.SortableTableRowSorter)3 FilterButton (pcgen.gui2.filter.FilterButton)2 TableCellUtilities (pcgen.gui2.util.table.TableCellUtilities)2 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1