Search in sources :

Example 66 with JScrollPane

use of javax.swing.JScrollPane 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 67 with JScrollPane

use of javax.swing.JScrollPane 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 68 with JScrollPane

use of javax.swing.JScrollPane 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)

Example 69 with JScrollPane

use of javax.swing.JScrollPane in project pcgen by PCGen.

the class SkillInfoTab method initComponents.

private void initComponents() {
    setOrientation(VERTICAL_SPLIT);
    setResizeWeight(0.70);
    JSpinner spinner = new JSpinner();
    //$NON-NLS-1$
    spinner.setEditor(new JSpinner.NumberEditor(spinner, "#0.#"));
    skillTable.setDefaultRenderer(Float.class, new SpinnerRenderer(spinner));
    skillTable.setDefaultRenderer(Integer.class, new TableCellUtilities.AlignRenderer(SwingConstants.CENTER));
    skillTable.setDefaultRenderer(String.class, new TableCellUtilities.AlignRenderer(SwingConstants.CENTER));
    skillTable.setRowHeight(26);
    FilterBar<CharacterFacade, SkillFacade> filterBar = new FilterBar<>();
    filterBar.addDisplayableFilter(new SearchFilterPanel());
    //$NON-NLS-1$
    cFilterButton.setText(LanguageBundle.getString("in_classString"));
    cFilterButton.setEnabled(false);
    filterBar.addDisplayableFilter(cFilterButton);
    //$NON-NLS-1$
    trainedFilterButton.setText(LanguageBundle.getString("in_trained"));
    trainedFilterButton.setEnabled(false);
    filterBar.addDisplayableFilter(trainedFilterButton);
    JPanel availPanel = FilterUtilities.configureFilteredTreeViewPane(skillTable, filterBar);
    availPanel.setPreferredSize(new Dimension(650, 300));
    JScrollPane tableScrollPane;
    JPanel tablePanel = new JPanel(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    constraints.fill = java.awt.GridBagConstraints.BOTH;
    constraints.weightx = 1.0;
    constraints.ipady = 0;
    constraints.weighty = 1.0;
    SkillPointTableModel.initializeTable(skillpointTable);
    tableScrollPane = new JScrollPane(skillpointTable);
    tablePanel.add(tableScrollPane, constraints);
    htmlPane.setOpaque(false);
    htmlPane.setEditable(false);
    htmlPane.setFocusable(false);
    //$NON-NLS-1$
    htmlPane.setContentType("text/html");
    skillFilterBox.setRenderer(new DefaultListCellRenderer());
    JScrollPane selScrollPane = new JScrollPane(htmlPane);
    JPanel skillPanel = new JPanel(new BorderLayout());
    skillPanel.add(skillFilterBox, BorderLayout.NORTH);
    skillPanel.add(selScrollPane, BorderLayout.CENTER);
    selScrollPane.setPreferredSize(new Dimension(530, 300));
    FlippingSplitPane topPane = new FlippingSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, availPanel, skillPanel, "SkillTop");
    setTopComponent(topPane);
    FlippingSplitPane bottomPane = new FlippingSplitPane(JSplitPane.HORIZONTAL_SPLIT, "SkillBottom");
    bottomPane.setLeftComponent(tablePanel);
    tablePanel.setPreferredSize(new Dimension(650, 100));
    bottomPane.setRightComponent(infoPane);
    infoPane.setPreferredSize(new Dimension(530, 100));
    setBottomComponent(bottomPane);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) SkillFacade(pcgen.facade.core.SkillFacade) Dimension(java.awt.Dimension) SpinnerRenderer(pcgen.gui2.util.table.TableCellUtilities.SpinnerRenderer) CharacterFacade(pcgen.facade.core.CharacterFacade) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane) TableCellUtilities(pcgen.gui2.util.table.TableCellUtilities) FilterBar(pcgen.gui2.filter.FilterBar) BorderLayout(java.awt.BorderLayout) DefaultListCellRenderer(javax.swing.DefaultListCellRenderer) JSpinner(javax.swing.JSpinner) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel)

Example 70 with JScrollPane

use of javax.swing.JScrollPane in project pcgen by PCGen.

the class SummaryInfoTab method initMiddlePanel.

private void initMiddlePanel(JPanel middlePanel) {
    middlePanel.setLayout(new GridLayout(2, 1));
    JPanel statsPanel = new JPanel();
    //$NON-NLS-1$
    setPanelTitle(statsPanel, LanguageBundle.getString("in_sumAbilityScores"));
    statsPanel.setLayout(new BoxLayout(statsPanel, BoxLayout.Y_AXIS));
    StatTableModel.initializeTable(statsTable);
    JScrollPane pane = new JScrollPane(statsTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER) {

        @Override
        public Dimension getMaximumSize() {
            //This prevents the scroll pane from taking up more space than it needs.
            return super.getPreferredSize();
        }
    };
    pane.setBorder(BorderFactory.createEmptyBorder());
    JPanel statsBox = new JPanel();
    statsBox.setLayout(new BoxLayout(statsBox, BoxLayout.X_AXIS));
    statsBox.add(Box.createHorizontalGlue());
    statsBox.add(pane);
    statsBox.add(Box.createHorizontalGlue());
    statsPanel.add(statsBox);
    JPanel statTotalPanel = new JPanel();
    statTotalPanel.setLayout(new BoxLayout(statTotalPanel, BoxLayout.X_AXIS));
    //this makes box layout use the statTotalPanel to distribute extra space
    statTotalPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    statTotalPanel.add(Box.createHorizontalGlue());
    FontManipulation.title(statTotalLabel);
    statTotalPanel.add(statTotalLabel);
    statTotalPanel.add(statTotal);
    FontManipulation.title(modTotalLabel);
    statTotalPanel.add(modTotalLabel);
    statTotalPanel.add(modTotal);
    statTotalPanel.add(Box.createHorizontalGlue());
    //$NON-NLS-1$
    generateRollsButton.setText(LanguageBundle.getString("in_sumGenerate_Rolls"));
    statTotalPanel.add(generateRollsButton);
    //$NON-NLS-1$
    rollMethodButton.setText(LanguageBundle.getString("in_sumRoll_Method"));
    statTotalPanel.add(Box.createRigidArea(new Dimension(5, 0)));
    statTotalPanel.add(rollMethodButton);
    statTotalPanel.add(Box.createHorizontalGlue());
    statsPanel.add(statTotalPanel);
    middlePanel.add(statsPanel);
    InfoPaneHandler.initializeEditorPane(infoPane);
    pane = new JScrollPane(infoPane);
    //$NON-NLS-1$
    setPanelTitle(pane, LanguageBundle.getString("in_sumStats"));
    middlePanel.add(pane);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) BoxLayout(javax.swing.BoxLayout) Dimension(java.awt.Dimension)

Aggregations

JScrollPane (javax.swing.JScrollPane)832 JPanel (javax.swing.JPanel)431 Dimension (java.awt.Dimension)271 JLabel (javax.swing.JLabel)269 BorderLayout (java.awt.BorderLayout)260 JButton (javax.swing.JButton)191 GridBagLayout (java.awt.GridBagLayout)149 JTable (javax.swing.JTable)148 BoxLayout (javax.swing.BoxLayout)140 Insets (java.awt.Insets)122 GridBagConstraints (java.awt.GridBagConstraints)121 ActionEvent (java.awt.event.ActionEvent)120 JTextArea (javax.swing.JTextArea)110 ActionListener (java.awt.event.ActionListener)103 FlowLayout (java.awt.FlowLayout)96 JTextField (javax.swing.JTextField)70 FormLayout (com.jgoodies.forms.layout.FormLayout)60 Container (java.awt.Container)55 JSplitPane (javax.swing.JSplitPane)55 MouseEvent (java.awt.event.MouseEvent)52