Search in sources :

Example 51 with GridBagLayout

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

the class SummaryInfoTab method initComponents.

private void initComponents() {
    this.setFocusCycleRoot(true);
    this.setFocusTraversalPolicyProvider(true);
    this.setFocusTraversalPolicy(new SummaryTabFocusTraversalPolicy());
    LanguageTableModel.initializeTable(languageTable);
    setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    //$NON-NLS-1$
    setPanelTitle(basicsPanel, LanguageBundle.getString("in_sumCharacterBasics"));
    basicsPanel.setLayout(new GridBagLayout());
    deityComboBox.setRenderer(infoBoxRenderer);
    raceComboBox.setRenderer(infoBoxRenderer);
    classComboBox.setRenderer(classBoxRenderer);
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weightx = 0.1;
    gbc.weighty = 0.7;
    add(basicsPanel, gbc);
    //$NON-NLS-1$
    setPanelTitle(todoPanel, LanguageBundle.getString("in_tipsString"));
    initTodoPanel(todoPanel);
    gbc.gridy = 1;
    gbc.gridheight = GridBagConstraints.REMAINDER;
    add(todoPanel, gbc);
    initMiddlePanel(scoresPanel);
    gbc.gridy = GridBagConstraints.RELATIVE;
    gbc.weightx = 1;
    add(scoresPanel, gbc);
    JPanel rightPanel = new JPanel();
    //$NON-NLS-1$
    setPanelTitle(racePanel, LanguageBundle.getString("in_raceString"));
    //$NON-NLS-1$
    setPanelTitle(classPanel, LanguageBundle.getString("in_sumClassLevel"));
    initRightPanel(rightPanel);
    gbc.weightx = 0.1;
    gbc.weighty = 1;
    add(rightPanel, gbc);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout)

Example 52 with GridBagLayout

use of java.awt.GridBagLayout 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 53 with GridBagLayout

use of java.awt.GridBagLayout 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 54 with GridBagLayout

use of java.awt.GridBagLayout 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 55 with GridBagLayout

use of java.awt.GridBagLayout in project zaproxy by zaproxy.

the class ContextAuthorizationPanel method initialize.

/**
	 * Initialize the panel.
	 */
private void initialize() {
    this.setLayout(new CardLayout());
    this.setName(getContextIndex() + ": " + PANEL_NAME);
    this.setLayout(new GridBagLayout());
    this.setBorder(new EmptyBorder(2, 2, 2, 2));
    this.add(new JLabel(LABEL_DESCRIPTION), LayoutHelper.getGBC(0, 0, 2, 0.0D, new Insets(0, 0, 20, 0)));
    // Basic Authorization detection
    Insets insets = new Insets(2, 5, 2, 5);
    this.add(new JLabel(FIELD_LABEL_INTRO), LayoutHelper.getGBC(0, 1, 2, 0.0D, new Insets(0, 0, 5, 0)));
    JPanel configContainerPanel = new JPanel(new GridBagLayout());
    configContainerPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, FontUtils.getFont(FontUtils.Size.standard), java.awt.Color.black));
    this.add(configContainerPanel, LayoutHelper.getGBC(0, 2, 2, 0.0D));
    configContainerPanel.add(new JLabel(FIELD_LABEL_STATUS_CODE), LayoutHelper.getGBC(0, 2, 1, 0.0D));
    statusCodeComboBox = new JComboBox<>(STATUS_CODES);
    configContainerPanel.add(statusCodeComboBox, LayoutHelper.getGBC(1, 2, 1, 1.0D, insets));
    configContainerPanel.add(new JLabel(FIELD_LABEL_HEADER_PATTERN), LayoutHelper.getGBC(0, 3, 1, 0.0D));
    headerPatternText = new JTextField();
    configContainerPanel.add(headerPatternText, LayoutHelper.getGBC(1, 3, 1, 1.0D, insets));
    configContainerPanel.add(new JLabel(FIELD_LABEL_BODY_PATTERN), LayoutHelper.getGBC(0, 4, 1, 0.0D));
    bodyPatternText = new JTextField();
    configContainerPanel.add(bodyPatternText, LayoutHelper.getGBC(1, 4, 1, 1.0D, insets));
    logicalOperatorComboBox = new JComboBox<>(new String[] { FIELD_VALUE_AND_COMPOSITION, FIELD_VALUE_OR_COMPOSITION });
    configContainerPanel.add(logicalOperatorComboBox, LayoutHelper.getGBC(0, 5, 2, 0.0D, new Insets(2, 0, 2, 5)));
    // Padding
    this.add(new JLabel(), LayoutHelper.getGBC(0, 99, 2, 1.0D, 1.0D));
}
Also used : CardLayout(java.awt.CardLayout) JPanel(javax.swing.JPanel) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) EmptyBorder(javax.swing.border.EmptyBorder) JTextField(javax.swing.JTextField)

Aggregations

GridBagLayout (java.awt.GridBagLayout)739 GridBagConstraints (java.awt.GridBagConstraints)576 JPanel (javax.swing.JPanel)532 JLabel (javax.swing.JLabel)425 Insets (java.awt.Insets)409 Dimension (java.awt.Dimension)182 JScrollPane (javax.swing.JScrollPane)147 JButton (javax.swing.JButton)143 ActionEvent (java.awt.event.ActionEvent)136 ActionListener (java.awt.event.ActionListener)115 JTextField (javax.swing.JTextField)100 BorderLayout (java.awt.BorderLayout)96 JCheckBox (javax.swing.JCheckBox)79 BoxLayout (javax.swing.BoxLayout)66 ButtonGroup (javax.swing.ButtonGroup)56 TitledBorder (javax.swing.border.TitledBorder)48 JComboBox (javax.swing.JComboBox)46 FlowLayout (java.awt.FlowLayout)42 JRadioButton (javax.swing.JRadioButton)36 Color (java.awt.Color)34