Search in sources :

Example 11 with FilterBar

use of pcgen.gui2.filter.FilterBar 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 12 with FilterBar

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

the class AdvancedSourceSelectionPanel method initComponents.

private void initComponents() {
    FlippingSplitPane mainPane = new FlippingSplitPane(JSplitPane.VERTICAL_SPLIT, "advSrcMain");
    FlippingSplitPane topPane = new FlippingSplitPane("advSrcTop");
    topPane.setResizeWeight(0.6);
    JPanel panel = new JPanel(new BorderLayout());
    //$NON-NLS-1$
    panel.add(new JLabel(LanguageBundle.getString("in_src_gameLabel")), BorderLayout.WEST);
    FacadeComboBoxModel<GameModeDisplayFacade> gameModes = new FacadeComboBoxModel<>();
    gameModes.setListFacade(FacadeFactory.getGameModeDisplays());
    gameModeList.setModel(gameModes);
    gameModeList.addActionListener(this);
    panel.add(gameModeList, BorderLayout.CENTER);
    FilterBar<Object, CampaignFacade> bar = new FilterBar<>(false);
    bar.add(panel, BorderLayout.WEST);
    bar.addDisplayableFilter(new SearchFilterPanel());
    panel = new JPanel(new BorderLayout());
    panel.add(bar, BorderLayout.NORTH);
    availableTable.setDisplayableFilter(bar);
    availableTable.setTreeViewModel(availTreeViewModel);
    availableTable.getSelectionModel().addListSelectionListener(this);
    availableTable.setTreeCellRenderer(new CampaignRenderer());
    ((DynamicTableColumnModel) availableTable.getColumnModel()).getAvailableColumns().get(2).setCellRenderer(new TableCellUtilities.AlignRenderer(SwingConstants.CENTER));
    JScrollPane pane = new JScrollPane(availableTable);
    pane.setPreferredSize(new Dimension(600, 310));
    panel.add(pane, BorderLayout.CENTER);
    Box box = Box.createHorizontalBox();
    unloadAllButton.setAction(new UnloadAllAction());
    box.add(unloadAllButton);
    box.add(Box.createHorizontalGlue());
    addButton.setHorizontalTextPosition(SwingConstants.LEADING);
    addButton.setAction(new AddAction());
    box.add(addButton);
    box.add(Box.createHorizontalStrut(5));
    box.setBorder(new EmptyBorder(0, 0, 5, 0));
    panel.add(box, BorderLayout.SOUTH);
    topPane.setLeftComponent(panel);
    JPanel selPanel = new JPanel(new BorderLayout());
    FilterBar<Object, CampaignFacade> filterBar = new FilterBar<>();
    filterBar.addDisplayableFilter(new SearchFilterPanel());
    selectedTable.setDisplayableFilter(filterBar);
    selectedTable.setTreeViewModel(selTreeViewModel);
    selectedTable.getSelectionModel().addListSelectionListener(this);
    selectedTable.setTreeCellRenderer(new CampaignRenderer());
    ((DynamicTableColumnModel) selectedTable.getColumnModel()).getAvailableColumns().get(2).setCellRenderer(new TableCellUtilities.AlignRenderer(SwingConstants.CENTER));
    JScrollPane scrollPane = new JScrollPane(selectedTable);
    scrollPane.setPreferredSize(new Dimension(300, 350));
    selPanel.add(scrollPane, BorderLayout.CENTER);
    box = Box.createHorizontalBox();
    box.add(Box.createHorizontalStrut(5));
    removeButton.setAction(new RemoveAction());
    box.add(removeButton);
    box.add(Box.createHorizontalGlue());
    box.setBorder(new EmptyBorder(0, 0, 5, 0));
    selPanel.add(box, BorderLayout.SOUTH);
    topPane.setRightComponent(selPanel);
    mainPane.setTopComponent(topPane);
    linkAction.install();
    infoPane.setPreferredSize(new Dimension(800, 150));
    mainPane.setBottomComponent(infoPane);
    mainPane.setResizeWeight(0.7);
    setLayout(new BorderLayout());
    add(mainPane, BorderLayout.CENTER);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) DynamicTableColumnModel(pcgen.gui2.util.table.DynamicTableColumnModel) JLabel(javax.swing.JLabel) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) Dimension(java.awt.Dimension) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane) CampaignFacade(pcgen.facade.core.CampaignFacade) FacadeComboBoxModel(pcgen.gui2.util.FacadeComboBoxModel) TableCellUtilities(pcgen.gui2.util.table.TableCellUtilities) GameModeDisplayFacade(pcgen.facade.core.GameModeDisplayFacade) FilterBar(pcgen.gui2.filter.FilterBar) BorderLayout(java.awt.BorderLayout) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) EmptyBorder(javax.swing.border.EmptyBorder)

Example 13 with FilterBar

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

the class TemplateInfoTab method initComponents.

private void initComponents() {
    FlippingSplitPane topPane = new FlippingSplitPane("TemplateTop");
    setTopComponent(topPane);
    setOrientation(VERTICAL_SPLIT);
    JPanel availPanel = new JPanel(new BorderLayout());
    FilterBar<CharacterFacade, TemplateFacade> 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.setDisplayableFilter(bar);
    availableTable.setTreeCellRenderer(qualifiedRenderer);
    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, TemplateFacade> filterBar = new FilterBar<>();
    filterBar.addDisplayableFilter(new SearchFilterPanel());
    selectedTable.setDisplayableFilter(filterBar);
    selectedTable.setTreeCellRenderer(qualifiedRenderer);
    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) 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) TemplateFacade(pcgen.facade.core.TemplateFacade)

Example 14 with FilterBar

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

the class EquipCustomPanel method initComponents.

private void initComponents() {
    JPanel upperPanel = new JPanel(new BorderLayout());
    setTopComponent(upperPanel);
    setOrientation(VERTICAL_SPLIT);
    Box bannerBox = Box.createHorizontalBox();
    bannerBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    bannerBox.add(Box.createHorizontalGlue());
    JLabel baseItemLabel = new JLabel(LanguageBundle.getString("in_EqBuilder_BaseItem"));
    FontManipulation.large(baseItemLabel);
    bannerBox.add(baseItemLabel);
    bannerBox.add(Box.createHorizontalStrut(5));
    JLabel baseItemName = new JLabel(builder.getBaseItemName());
    FontManipulation.large(baseItemName);
    FontManipulation.title(baseItemName);
    bannerBox.add(baseItemName);
    if (validHeads.getSize() > 1) {
        bannerBox.add(Box.createHorizontalStrut(45));
        JLabel headLabel = new JLabel(LanguageBundle.getString("in_EqBuilder_Head"));
        FontManipulation.large(headLabel);
        bannerBox.add(headLabel);
        bannerBox.add(Box.createHorizontalStrut(5));
        Dimension prefDim = headCombo.getPreferredSize();
        prefDim.width += 15;
        headCombo.setMaximumSize(prefDim);
        bannerBox.add(headCombo);
    }
    bannerBox.add(Box.createHorizontalGlue());
    upperPanel.add(bannerBox, BorderLayout.NORTH);
    FlippingSplitPane topPane = new FlippingSplitPane("equipCustTop");
    upperPanel.add(topPane, BorderLayout.CENTER);
    JPanel availPanel = new JPanel(new BorderLayout());
    FilterBar<Object, EquipModFacade> bar = new FilterBar<>();
    bar.addDisplayableFilter(new SearchFilterPanel());
    availPanel.add(bar, BorderLayout.NORTH);
    availableTable.setDisplayableFilter(bar);
    availableTable.setTreeViewModel(availEqmodModelMap.get(currentHead));
    availableTable.setTreeCellRenderer(renderer);
    availPanel.add(new JScrollPane(availableTable), BorderLayout.CENTER);
    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());
    Box equipButtonBox = Box.createHorizontalBox();
    equipButtonBox.add(Box.createHorizontalGlue());
    nameButton.setHorizontalTextPosition(SwingConstants.LEADING);
    nameButton.setAction(nameAction);
    equipButtonBox.add(nameButton);
    equipButtonBox.add(Box.createHorizontalStrut(5));
    spropButton.setHorizontalTextPosition(SwingConstants.LEADING);
    spropButton.setAction(spropAction);
    equipButtonBox.add(spropButton);
    equipButtonBox.add(Box.createHorizontalStrut(5));
    costButton.setHorizontalTextPosition(SwingConstants.LEADING);
    costButton.setAction(costAction);
    equipButtonBox.add(costButton);
    equipButtonBox.add(Box.createHorizontalStrut(5));
    weightButton.setHorizontalTextPosition(SwingConstants.LEADING);
    weightButton.setAction(weightAction);
    equipButtonBox.add(weightButton);
    if (builder.isWeapon()) {
        equipButtonBox.add(Box.createHorizontalStrut(5));
        damageButton.setHorizontalTextPosition(SwingConstants.LEADING);
        damageButton.setAction(damageAction);
        equipButtonBox.add(damageButton);
    }
    // Only show size if it can be used
    if (builder.isResizable()) {
        JPanel sizePanel = new JPanel();
        JLabel sizeLabel = new JLabel(LanguageBundle.getString("in_EqBuilder_Size"));
        sizePanel.add(sizeLabel);
        sizePanel.add(sizeCombo);
        equipButtonBox.add(Box.createHorizontalStrut(5));
        equipButtonBox.add(sizePanel);
    }
    equipButtonBox.add(Box.createHorizontalGlue());
    equipButtonBox.setBorder(new EmptyBorder(5, 0, 0, 0));
    selPanel.add(equipButtonBox, BorderLayout.NORTH);
    selectedTable.setTreeViewModel(selectedEqmodModelMap.get(currentHead));
    selectedTable.setTreeCellRenderer(renderer);
    selPanel.add(new JScrollPane(selectedTable), BorderLayout.CENTER);
    box = Box.createHorizontalBox();
    removeButton.setHorizontalTextPosition(SwingConstants.TRAILING);
    removeButton.setAction(removeAction);
    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);
    FlippingSplitPane bottomPane = new FlippingSplitPane("equipCustBottom");
    bottomPane.setLeftComponent(equipModInfoPane);
    bottomPane.setRightComponent(equipInfoPane);
    setBottomComponent(bottomPane);
    setResizeWeight(0.75);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) JLabel(javax.swing.JLabel) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) Dimension(java.awt.Dimension) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane) EquipModFacade(pcgen.facade.core.EquipModFacade) FilterBar(pcgen.gui2.filter.FilterBar) BorderLayout(java.awt.BorderLayout) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) EmptyBorder(javax.swing.border.EmptyBorder)

Aggregations

JPanel (javax.swing.JPanel)14 JScrollPane (javax.swing.JScrollPane)14 FilterBar (pcgen.gui2.filter.FilterBar)14 SearchFilterPanel (pcgen.gui2.filter.SearchFilterPanel)14 FlippingSplitPane (pcgen.gui2.tools.FlippingSplitPane)14 Box (javax.swing.Box)13 BorderLayout (java.awt.BorderLayout)11 EmptyBorder (javax.swing.border.EmptyBorder)9 CharacterFacade (pcgen.facade.core.CharacterFacade)9 JLabel (javax.swing.JLabel)5 Dimension (java.awt.Dimension)4 JComboBox (javax.swing.JComboBox)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