Search in sources :

Example 16 with FlippingSplitPane

use of pcgen.gui2.tools.FlippingSplitPane 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 17 with FlippingSplitPane

use of pcgen.gui2.tools.FlippingSplitPane 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)16 JScrollPane (javax.swing.JScrollPane)16 FlippingSplitPane (pcgen.gui2.tools.FlippingSplitPane)16 SearchFilterPanel (pcgen.gui2.filter.SearchFilterPanel)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 Dimension (java.awt.Dimension)5 JComboBox (javax.swing.JComboBox)5 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 CardLayout (java.awt.CardLayout)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1