Search in sources :

Example 56 with GridBagConstraints

use of java.awt.GridBagConstraints in project pcgen by PCGen.

the class SummaryInfoTab method resetBasicsPanel.

private void resetBasicsPanel() {
    basicsPanel.removeAll();
    GridBagConstraints gbc = new GridBagConstraints();
    {
        //$NON-NLS-1$
        JLabel label = createLabel("in_sumName");
        gbc.anchor = java.awt.GridBagConstraints.WEST;
        gbc.insets = new Insets(0, 0, 3, 0);
        basicsPanel.add(label, gbc);
        //$NON-NLS-1$
        random.setText(LanguageBundle.getString("in_randomButton"));
        random.setMargin(new Insets(0, 0, 0, 0));
        gbc.insets = new Insets(0, 2, 3, 2);
        basicsPanel.add(random, gbc);
        gbc.insets = new Insets(0, 0, 3, 2);
        gbc.gridwidth = GridBagConstraints.REMAINDER;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 1.0;
        basicsPanel.add(characterNameField, gbc);
    }
    Insets insets = new Insets(0, 0, 3, 2);
    Font labelFont = null;
    //$NON-NLS-1$
    addGridBagLayer(basicsPanel, labelFont, insets, "in_sumCharType", characterTypeComboBox);
    //$NON-NLS-1$
    addGridBagLayer(basicsPanel, labelFont, insets, "in_sumPlayer", playerNameField);
    //$NON-NLS-1$
    addGridBagLayer(basicsPanel, labelFont, insets, "in_sumTabLabel", tabLabelField);
    if (genderComboBox.getModel().getSize() != 0) {
        //$NON-NLS-1$
        addGridBagLayer(basicsPanel, labelFont, insets, "in_sumGender", genderComboBox);
    }
    if (handsComboBox.getModel().getSize() != 0) {
        //$NON-NLS-1$
        addGridBagLayer(basicsPanel, labelFont, insets, "in_sumHanded", handsComboBox);
    }
    if (alignmentComboBox.getModel().getSize() != 0) {
        //$NON-NLS-1$
        addGridBagLayer(basicsPanel, labelFont, insets, "in_sumAlignment", alignmentComboBox);
    }
    if (deityComboBox.getModel().getSize() != 0) {
        //$NON-NLS-1$
        addGridBagLayer(basicsPanel, labelFont, insets, "in_domDeityLabel", deityComboBox);
    }
    gbc = new GridBagConstraints();
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weighty = 1;
    gbc.insets = new Insets(6, 2, 2, 2);
    langScroll = new JScrollPane(languageTable);
    basicsPanel.add(langScroll, gbc);
    basicsPanel.revalidate();
}
Also used : JScrollPane(javax.swing.JScrollPane) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) JLabel(javax.swing.JLabel) Font(java.awt.Font)

Example 57 with GridBagConstraints

use of java.awt.GridBagConstraints 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 58 with GridBagConstraints

use of java.awt.GridBagConstraints in project pcgen by PCGen.

the class SummaryInfoTab method initLevelPanel.

private void initLevelPanel(JPanel panel) {
    panel.setLayout(new GridBagLayout());
    //$NON-NLS-1$
    JLabel addLabel = createLabel("in_sumAddLevels");
    //$NON-NLS-1$
    JLabel removeLabel = createLabel("in_sumRemoveLevels");
    JLabel darrowLabel = new JLabel(Icons.button_arrow_down.getImageIcon());
    JLabel uarrowLabel = new JLabel(Icons.button_arrow_up.getImageIcon());
    addLevelsButton.setMargin(new Insets(0, 8, 0, 8));
    addLevelsField.setValue(1);
    addLevelsField.setHorizontalAlignment(SwingConstants.RIGHT);
    removeLevelsButton.setMargin(new Insets(0, 8, 0, 8));
    removeLevelsField.setValue(1);
    removeLevelsField.setHorizontalAlignment(SwingConstants.RIGHT);
    GridBagConstraints gbc1 = new GridBagConstraints();
    GridBagConstraints gbc2 = new GridBagConstraints();
    gbc1.weightx = gbc2.weightx = 0.5;
    gbc1.insets = new Insets(1, 0, 1, 0);
    gbc2.insets = new Insets(1, 0, 1, 0);
    gbc2.gridwidth = GridBagConstraints.REMAINDER;
    panel.add(addLabel, gbc1);
    panel.add(removeLabel, gbc2);
    gbc1.ipadx = 30;
    panel.add(addLevelsField, gbc1);
    gbc2.ipadx = 30;
    panel.add(removeLevelsField, gbc2);
    gbc1.ipadx = 0;
    panel.add(addLevelsButton, gbc1);
    gbc2.ipadx = 0;
    panel.add(removeLevelsButton, gbc2);
    panel.add(darrowLabel, gbc1);
    panel.add(uarrowLabel, gbc2);
    ClassLevelTableModel.initializeTable(classLevelTable);
    gbc2.weightx = 0;
    gbc2.weighty = 1;
    gbc2.fill = GridBagConstraints.BOTH;
    panel.add(new JScrollPane(classLevelTable), gbc2);
}
Also used : JScrollPane(javax.swing.JScrollPane) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel)

Example 59 with GridBagConstraints

use of java.awt.GridBagConstraints in project pcgen by PCGen.

the class PortraitInfoPane method initComponents.

private void initComponents() {
    JPanel panel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    Utility.buildConstraints(gbc, 0, 0, 2, 1, 0, 0);
    panel.add(new JLabel(LanguageBundle.getString("in_largePortrait")), gbc);
    Utility.buildConstraints(gbc, 0, 1, 2, 1, 0, 0);
    panel.add(portraitPane, gbc);
    Utility.buildConstraints(gbc, 0, 2, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
    panel.add(loadButton, gbc);
    Utility.buildConstraints(gbc, 1, 2, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
    panel.add(clearButton, gbc);
    Utility.buildConstraints(gbc, 2, 1, 1, 1, 0, 0, GridBagConstraints.VERTICAL, GridBagConstraints.CENTER);
    zoomSlider.setInverted(true);
    zoomSlider.setPreferredSize(new Dimension(20, 10));
    panel.add(zoomSlider, gbc);
    Utility.buildConstraints(gbc, 3, 0, 1, 1, 0, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    panel.add(new JLabel(LanguageBundle.getString("in_thumbnailPortrait")), gbc);
    Utility.buildConstraints(gbc, 3, 1, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTH);
    panel.add(tnPane, gbc);
    this.setViewportView(panel);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 60 with GridBagConstraints

use of java.awt.GridBagConstraints in project pcgen by PCGen.

the class RunConvertPanel method setupDisplay.

/**
	 * @see pcgen.gui2.converter.panel.ConvertSubPanel#setupDisplay(javax.swing.JPanel, pcgen.cdom.base.CDOMObject)
	 */
@Override
public void setupDisplay(JPanel panel, CDOMObject pc) {
    panel.setLayout(new GridBagLayout());
    JLabel introLabel = new JLabel("Conversion in progress");
    GridBagConstraints gbc = new GridBagConstraints();
    Utility.buildRelativeConstraints(gbc, GridBagConstraints.REMAINDER, 1, 1.0, 0);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.insets = new Insets(0, 10, 5, 10);
    panel.add(introLabel, gbc);
    JLabel explainLabel = new JLabel("<html>The LST data is being converted. In the log, " + "LSTERROR rows are errors that need to be manually corrected in the source data. " + "LSTWARN rows indicate changes the converter is making. " + "See " + changeLogFile.getAbsolutePath() + " for a log of all data changes.</html>");
    explainLabel.setFocusable(true);
    Utility.buildRelativeConstraints(gbc, GridBagConstraints.REMAINDER, 1, 1.0, 0);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.insets = new Insets(0, 10, 5, 10);
    panel.add(explainLabel, gbc);
    progressBar = getProgressBar();
    Dimension d = progressBar.getPreferredSize();
    d.width = 400;
    progressBar.setPreferredSize(d);
    progressBar.setStringPainted(true);
    Utility.buildRelativeConstraints(gbc, GridBagConstraints.REMAINDER, 1, 1.0, 0);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel.add(progressBar, gbc);
    messageAreaContainer = new JScrollPane(getMessageArea());
    Utility.buildRelativeConstraints(gbc, GridBagConstraints.REMAINDER, GridBagConstraints.REMAINDER, 1.0, 1.0);
    gbc.fill = GridBagConstraints.BOTH;
    panel.add(messageAreaContainer, gbc);
    panel.setPreferredSize(new Dimension(800, 500));
}
Also used : JScrollPane(javax.swing.JScrollPane) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Aggregations

GridBagConstraints (java.awt.GridBagConstraints)807 GridBagLayout (java.awt.GridBagLayout)585 Insets (java.awt.Insets)520 JPanel (javax.swing.JPanel)472 JLabel (javax.swing.JLabel)412 Dimension (java.awt.Dimension)156 JButton (javax.swing.JButton)131 ActionEvent (java.awt.event.ActionEvent)123 JScrollPane (javax.swing.JScrollPane)119 ActionListener (java.awt.event.ActionListener)116 JTextField (javax.swing.JTextField)99 BorderLayout (java.awt.BorderLayout)98 JCheckBox (javax.swing.JCheckBox)84 TitledBorder (javax.swing.border.TitledBorder)57 ButtonGroup (javax.swing.ButtonGroup)48 JComboBox (javax.swing.JComboBox)45 Color (java.awt.Color)41 FlowLayout (java.awt.FlowLayout)37 Font (java.awt.Font)36 Border (javax.swing.border.Border)35