Example usage for java.awt GridBagConstraints NONE

List of usage examples for java.awt GridBagConstraints NONE

Introduction

In this page you can find the example usage for java.awt GridBagConstraints NONE.

Prototype

int NONE

To view the source code for java.awt GridBagConstraints NONE.

Click Source Link

Document

Do not resize the component.

Usage

From source file:cool.pandora.modeller.ui.jpanel.base.NewBagInPlaceFrame.java

/**
 * layoutProfileSelectionContent./*from  ww w .  ja v a2  s  .c om*/
 *
 * @param contentPane JPanel
 * @param row         int
 */
private void layoutProfileSelectionContent(final JPanel contentPane, final int row) {
    // content
    // profile selection
    final JLabel bagProfileLabel = new JLabel(bagView.getPropertyMessage("Select Profile:"));
    bagProfileLabel.setToolTipText(bagView.getPropertyMessage("bag.projectlist.help"));

    profileList = new JComboBox<>(bagView.getProfileStore().getProfileNames());
    profileList.setName(bagView.getPropertyMessage("bag.label.projectlist"));
    profileList.setSelectedItem(bagView.getPropertyMessage("bag.project.noproject"));
    profileList.setToolTipText(bagView.getPropertyMessage("bag.projectlist.help"));

    GridBagConstraints glbc = new GridBagConstraints();

    final JLabel spacerLabel = new JLabel();
    glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.WEST);
    contentPane.add(bagProfileLabel, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.CENTER);
    contentPane.add(profileList, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE,
            GridBagConstraints.EAST);
    contentPane.add(spacerLabel, glbc);
}

From source file:me.childintime.childintime.ui.window.tool.BmiToolDialog.java

/**
 * Build the student body states panel.//from w  w w.j  a v a  2s.c om
 *
 * @return Student body states panel.
 */
private JPanel buildUiStudentBodyStatesPanel() {
    // Create a new grid bag constraints configuration instance
    GridBagConstraints c = new GridBagConstraints();

    // Create the panel
    final JPanel studentBodyStatePanel = new JPanel(new GridBagLayout());

    // Add the label
    c.fill = GridBagConstraints.NONE;
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 0;
    c.weighty = 0;
    c.insets = new Insets(8, 2, 2, 0);
    c.anchor = GridBagConstraints.SOUTHWEST;
    studentBodyStatePanel.add(new JLabel("Student's body states:"), c);

    // Create a list for the students body states
    this.studentBodyStates = new EntityViewComponent(Core.getInstance().getBodyStateManager());

    // Add the list
    c.fill = GridBagConstraints.BOTH;
    c.gridx = 0;
    c.gridy = 1;
    c.weightx = 1;
    c.weighty = 1;
    c.insets = new Insets(0, 0, 0, 0);
    c.anchor = GridBagConstraints.CENTER;
    studentBodyStatePanel.add(this.studentBodyStates, c);

    // Update the student body state list when the selected student is changed
    this.studentList.addSelectionChangeListenerListener(this::updateStudentBodyStateList);

    // Set the minimum preferred size of the body states list
    this.studentBodyStates.setPreferredSize(new Dimension(200, 100));

    // Return the panel
    return studentBodyStatePanel;
}

From source file:org.sonarlint.intellij.config.global.SonarQubeServerEditor.java

private void createRootPanel() {
    JPanel form = createForm();/*w w w  .  ja  v a2s .com*/
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTH;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridy = 0;
    gbc.gridx = 0;
    gbc.weightx = 1.0;
    rootPanel.add(form, gbc);

    gbc.anchor = GridBagConstraints.CENTER;
    gbc.fill = GridBagConstraints.NONE;
    gbc.gridy = 1;
    gbc.gridx = 0;
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    rootPanel.add(testButton, gbc);
}

From source file:net.java.sip.communicator.impl.gui.main.chat.ChatWritePanel.java

/**
 * Creates the center panel.//w w w .ja va 2 s  . c  o  m
 *
 * @return the created center panel
 */
private Container createCenter() {
    JPanel centerPanel = new JPanel(new GridBagLayout());

    centerPanel.setBackground(Color.WHITE);
    centerPanel.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 3));

    GridBagConstraints constraints = new GridBagConstraints();

    initSmsLabel(centerPanel);
    initTextArea(centerPanel);

    smsCharCountLabel = new JLabel(String.valueOf(smsCharCount));
    smsCharCountLabel.setForeground(Color.GRAY);
    smsCharCountLabel.setVisible(false);

    constraints.anchor = GridBagConstraints.NORTHEAST;
    constraints.fill = GridBagConstraints.NONE;
    constraints.gridx = 3;
    constraints.gridy = 0;
    constraints.weightx = 0f;
    constraints.weighty = 0f;
    constraints.insets = new Insets(0, 2, 0, 2);
    constraints.gridheight = 1;
    constraints.gridwidth = 1;
    centerPanel.add(smsCharCountLabel, constraints);

    smsNumberLabel = new JLabel(String.valueOf(smsNumberCount)) {
        @Override
        public void paintComponent(Graphics g) {
            AntialiasingManager.activateAntialiasing(g);
            g.setColor(getBackground());
            g.fillOval(0, 0, getWidth(), getHeight());

            super.paintComponent(g);
        }
    };
    smsNumberLabel.setHorizontalAlignment(JLabel.CENTER);
    smsNumberLabel.setPreferredSize(new Dimension(18, 18));
    smsNumberLabel.setMinimumSize(new Dimension(18, 18));
    smsNumberLabel.setForeground(Color.WHITE);
    smsNumberLabel.setBackground(Color.GRAY);
    smsNumberLabel.setVisible(false);

    constraints.anchor = GridBagConstraints.NORTHEAST;
    constraints.fill = GridBagConstraints.NONE;
    constraints.gridx = 4;
    constraints.gridy = 0;
    constraints.weightx = 0f;
    constraints.weighty = 0f;
    constraints.insets = new Insets(0, 2, 0, 2);
    constraints.gridheight = 1;
    constraints.gridwidth = 1;
    centerPanel.add(smsNumberLabel, constraints);

    return centerPanel;
}

From source file:org.nuclos.client.layout.wysiwyg.component.properties.PropertyChartPropertyDomainStep.java

@Override
public void prepare() {
    super.prepare();

    chart = model.getChart();/*from w w  w . j  av  a  2 s  .co m*/
    wysiwygChart = model.getWYSIWYGChart();

    String sPrefix = getChartProperty(Chart.PROPERTY_COMBINED_PREFIXES);
    combinedPrefixes = (sPrefix == null) ? new StringBuffer("") : new StringBuffer(sPrefix);

    panel = new JPanel();
    panel.setLayout(new BorderLayout());

    final ChartFunction chartFunction = getChartFunction();

    if (!chartFunction.isCombinedChart()) {
        panel.add(getPanelComponent(chartFunction, ""), BorderLayout.CENTER);
    } else {
        JPanel editorType = new JPanel();
        editorType.setLayout(new GridBagLayout());
        JLabel propTypeValue = new JLabel(
                //SpringLocaleDelegate.getInstance().getMessage("wysiwyg.chart.wizard.domain.value",
                "Diagramm hinzufgen:"/*)*/);
        editorType.add(propTypeValue, new GridBagConstraints(0, 0, 0, 1, 1D, 1D, GridBagConstraints.NORTHWEST,
                GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 0), 0, 0));
        final JComboBox propTypeComponent = new JComboBox(chartFunction.getCombinedChartFunctions());
        editorType.add(propTypeComponent, new GridBagConstraints(0, 1, 1, 1, 1D, 1D,
                GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 15, 0), 0, 0));

        final JTabbedPane tabbedPane = new JTabbedPane();

        JButton removeButton = new JButton(iconRemove);
        removeButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (tabbedPane.getSelectedIndex() != -1) {
                    PanelComponent panelComponent = (PanelComponent) tabbedPane.getSelectedComponent();
                    combinedPrefixes = new StringBuffer(
                            combinedPrefixes.toString().replaceAll(panelComponent.prefix, ""));
                    tabbedPane.remove(panelComponent);
                }
            }
        });
        editorType.add(removeButton, new GridBagConstraints(1, 1, 1, 1, 1D, 1D, GridBagConstraints.NORTHEAST,
                GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
        JButton addButton = new JButton(iconAdd);
        addButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                ChartFunction cFunction = (ChartFunction) propTypeComponent.getSelectedItem();
                String prefix = cFunction.name() + "." + (Math.random() + "").replaceAll("\\.", "") + ":";

                combinedPrefixes.append(prefix);
                tabbedPane.add(cFunction.name(), getPanelComponent(cFunction, prefix));
                tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
            }
        });
        editorType.add(addButton, new GridBagConstraints(2, 1, 1, 1, 1D, 1D, GridBagConstraints.NORTHWEST,
                GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));

        String[] prefixes = combinedPrefixes.toString().split(":");
        for (String prefix : prefixes) {
            if (prefix.length() > 0) {
                try {
                    ChartFunction cFunction = ChartFunction.valueOf(prefix.split("\\.")[0]);
                    tabbedPane.add(cFunction.name(), getPanelComponent(cFunction, prefix + ":"));
                } catch (Exception e) {
                    // ignore.
                }
            }
        }
        panel.add(editorType, BorderLayout.NORTH);
        panel.add(tabbedPane, BorderLayout.CENTER);
    }
}

From source file:com.intel.stl.ui.main.view.StaDetailsPanel.java

/**
 * Description:// ww w .  jav a  2  s .co  m
 * 
 * @param sourceName
 */
protected void initComponent() {
    setLayout(new BorderLayout(0, 10));
    setOpaque(false);
    setBorder(BorderFactory.createTitledBorder((Border) null));

    JPanel titlePanel = new JPanel(new BorderLayout(5, 1));
    titlePanel.setOpaque(false);
    numberLabel = ComponentFactory.getH1Label(STLConstants.K0039_NOT_AVAILABLE.getValue(), Font.PLAIN);
    numberLabel.setHorizontalAlignment(JLabel.RIGHT);
    titlePanel.add(numberLabel, BorderLayout.CENTER);
    nameLabel = ComponentFactory.getH3Label("", Font.PLAIN);
    nameLabel.setHorizontalAlignment(JLabel.LEFT);
    nameLabel.setVerticalAlignment(JLabel.BOTTOM);
    titlePanel.add(nameLabel, BorderLayout.EAST);
    add(titlePanel, BorderLayout.NORTH);

    JPanel mainPanel = new JPanel();
    mainPanel.setOpaque(false);
    mainPanel.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2));
    GridBagLayout gridBag = new GridBagLayout();
    mainPanel.setLayout(gridBag);
    GridBagConstraints gc = new GridBagConstraints();

    gc.insets = new Insets(2, 2, 2, 2);
    gc.fill = GridBagConstraints.HORIZONTAL;
    gc.weightx = 1;
    gc.gridwidth = 1;
    gc.weighty = 0;
    failedChartPanel = new ChartPanel(null);
    failedChartPanel.setPreferredSize(new Dimension(60, 20));
    mainPanel.add(failedChartPanel, gc);

    gc.fill = GridBagConstraints.BOTH;
    gc.weightx = 0;
    failedNumberLabel = ComponentFactory.getH2Label(STLConstants.K0039_NOT_AVAILABLE.getValue(), Font.BOLD);
    failedNumberLabel.setForeground(UIConstants.INTEL_DARK_RED);
    failedNumberLabel.setHorizontalAlignment(JLabel.CENTER);
    mainPanel.add(failedNumberLabel, gc);

    gc.gridwidth = GridBagConstraints.REMAINDER;
    failedNameLabel = ComponentFactory.getH5Label(STLConstants.K0020_FAILED.getValue(), Font.PLAIN);
    failedNameLabel.setVerticalAlignment(JLabel.BOTTOM);
    mainPanel.add(failedNameLabel, gc);

    gc.fill = GridBagConstraints.HORIZONTAL;
    gc.weightx = 1;
    gc.gridwidth = 1;
    skippedChartPanel = new ChartPanel(null);
    skippedChartPanel.setPreferredSize(new Dimension(60, 20));
    mainPanel.add(skippedChartPanel, gc);

    gc.fill = GridBagConstraints.BOTH;
    gc.weightx = 0;
    skippedNumberLabel = ComponentFactory.getH2Label(STLConstants.K0039_NOT_AVAILABLE.getValue(), Font.BOLD);
    skippedNumberLabel.setForeground(UIConstants.INTEL_DARK_ORANGE);
    skippedNumberLabel.setHorizontalAlignment(JLabel.CENTER);
    mainPanel.add(skippedNumberLabel, gc);

    gc.gridwidth = GridBagConstraints.REMAINDER;
    skippedNameLabel = ComponentFactory.getH5Label(STLConstants.K0021_SKIPPED.getValue(), Font.PLAIN);
    skippedNameLabel.setVerticalAlignment(JLabel.BOTTOM);
    mainPanel.add(skippedNameLabel, gc);

    gc.weighty = 0;
    gc.fill = GridBagConstraints.NONE;
    gc.insets = new Insets(8, 2, 2, 2);
    gc.weightx = 1;
    gc.gridwidth = 1;
    gc.gridheight = types.length;
    typeChartPanel = new ChartPanel(null);
    typeChartPanel.setPreferredSize(new Dimension(80, 60));
    mainPanel.add(typeChartPanel, gc);

    typeNumberLabels = new JLabel[types.length];
    typeNameLabels = new JLabel[types.length];
    gc.fill = GridBagConstraints.BOTH;
    gc.gridheight = 1;
    gc.insets = new Insets(12, 2, 2, 2);
    for (int i = 0; i < types.length; i++) {
        if (i == 1) {
            gc.insets = new Insets(2, 2, 2, 2);
        }

        gc.weightx = 0;
        gc.gridwidth = 1;
        typeNumberLabels[i] = createNumberLabel();
        mainPanel.add(typeNumberLabels[i], gc);

        gc.gridwidth = GridBagConstraints.REMAINDER;
        typeNameLabels[i] = createNameLabel(types[i].getName());
        mainPanel.add(typeNameLabels[i], gc);
    }

    gc.fill = GridBagConstraints.BOTH;
    mainPanel.add(Box.createGlue(), gc);

    add(mainPanel, BorderLayout.CENTER);
}

From source file:io.github.tavernaextras.biocatalogue.ui.search_results.SOAPOperationListCellRenderer.java

/**
 * @return Final state of the {@link GridBagConstraints} instance
 *         that was used to lay out components in the panel.
 *///  ww w  . j a  v  a 2 s  .c om
private GridBagConstraints arrangeLayout() {
    // POPULATE PANEL WITH PREPARED COMPONENTS
    this.setLayout(new GridBagLayout());
    c = new GridBagConstraints();
    c.anchor = GridBagConstraints.NORTHWEST;
    c.fill = GridBagConstraints.HORIZONTAL;

    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 0;
    c.insets = new Insets(8, 6, 6, 3);
    this.add(jlTypeIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(8, 3, 6, 3);
    this.add(jlItemTitle, c);

    c.gridx++;
    c.gridheight = 7;
    c.weightx = 0;
    c.weighty = 1.0;
    this.add(jlItemStatus, c);

    c.gridx = 1;
    c.gridy++;
    c.gridheight = 1;
    c.weightx = 0;
    c.weighty = 0;
    this.add(jlPartOf, c);

    c.gridy++;
    this.add(jlWsdlLocation, c);

    c.fill = GridBagConstraints.NONE;
    c.gridy++;
    this.add(jtDescription, c);

    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridy++;
    this.add(jlSoapInputs, c);

    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridy++;
    this.add(jlSoapOutputs, c);

    return (c);
}

From source file:org.photovault.swingui.PhotoInfoEditor.java

protected void createUI() {
    setLayout(new BorderLayout());
    setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    tabPane = new JTabbedPane();
    add(tabPane, BorderLayout.CENTER);

    // General pane
    JPanel generalPane = new JPanel();
    tabPane.addTab("General", generalPane);

    // Create the fields & their labels

    // Photographer field
    JLabel photographerLabel = new JLabel("Photographer");
    photographerField = createMvTextField("photographer", 30);
    photographerDoc = photographerField.getDocument();

    // "Fuzzy time" field
    JLabel fuzzyDateLabel = new JLabel("Shooting date");
    fuzzyDateField = new JTextField(30);
    fuzzyDateDoc = fuzzyDateField.getDocument();
    fuzzyDateDoc.putProperty(FIELD, PhotoInfoFields.FUZZY_SHOOT_TIME);
    fuzzyDateDoc.addDocumentListener(this);

    JLabel qualityLabel = new JLabel("Quality");
    qualityField = new JComboBox(qualityStrings);
    qualityField.addActionListener(this);

    StarRating qualityStars = new StarRating(5);
    FieldController<Integer> qfCtrl = ctrl.getFieldController("quality");
    ValueModel qualityFieldValue = new PropertyAdapter(qfCtrl, "value", true);
    ValueModel starCount = new PropertyAdapter(qualityStars, "selection", true);
    PropertyConnector.connect(qualityFieldValue, "value", starCount, "value");

    // Shooting place field
    JLabel shootingPlaceLabel = new JLabel("Shooting place");
    shootingPlaceField = createMvTextField("shotLocation.description", 30);
    shootingPlaceDoc = shootingPlaceField.getDocument();
    JLabel shotLocRoadLabel = new JLabel("Road");
    JTextField shotLocRoadField = createMvTextField("shotLocation.road", 30);
    JLabel shotLocSuburbLabel = new JLabel("Suburb");
    JTextField shotLocSuburbField = createMvTextField("shotLocation.suburb", 30);
    JLabel shotLocCityLabel = new JLabel("City");
    JTextField shotLocCityField = createMvTextField("shotLocation.city", 30);
    JLabel shotLocCountryLabel = new JLabel("Country");
    JTextField shotLocCountryField = createMvTextField("shotLocation.country", 30);
    JLabel shotLocGeohashLabel = new JLabel("Geohash code");
    JTextField shotLocGeohashField = createMvTextField("shotLocation.geoHashString", 30);
    shotLocGeohashField.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), "fillAddress");
    shotLocGeohashField.getActionMap().put("fillAddress", new FindAddressAction(ctrl));

    // Tags/* w ww .  ja  v  a  2s. c o m*/
    JLabel tagLabel = new JLabel("Tags");
    tagList = new TagList2(ctrl.getTagController());
    tagList.setBackground(generalPane.getBackground());

    // Description text
    JLabel descLabel = new JLabel("Description");
    descriptionTextArea = new JTextArea(5, 40);
    descriptionTextArea.setLineWrap(true);
    descriptionTextArea.setWrapStyleWord(true);
    JScrollPane descScrollPane = new JScrollPane(descriptionTextArea);
    descScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    Border descBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    descBorder = BorderFactory.createTitledBorder(descBorder, "Description");
    descScrollPane.setBorder(descBorder);
    descriptionDoc = descriptionTextArea.getDocument();
    descriptionDoc.putProperty(FIELD, PhotoInfoFields.DESCRIPTION);
    descriptionDoc.addDocumentListener(this);

    // Lay out the created controls
    GridBagLayout layout = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    generalPane.setLayout(layout);
    JLabel[] labels = { photographerLabel, fuzzyDateLabel, shootingPlaceLabel, shotLocGeohashLabel,
            shotLocRoadLabel, shotLocSuburbLabel, shotLocCityLabel, shotLocCountryLabel, qualityLabel,
            tagLabel };
    JComponent[] fields = { photographerField, fuzzyDateField, shootingPlaceField, shotLocGeohashField,
            shotLocRoadField, shotLocSuburbField, shotLocCityField, shotLocCountryField, qualityStars,
            tagList };
    addLabelTextRows(labels, fields, layout, generalPane);
    c = layout.getConstraints(tagList);
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 0.0;
    c.weighty = 1.0;
    layout.setConstraints(tagList, c);

    generalPane.add(descScrollPane);
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.weighty = 0.5;
    c.fill = GridBagConstraints.BOTH;
    layout.setConstraints(descScrollPane, c);

    c = new GridBagConstraints();
    c.gridwidth = 1;
    c.weighty = 0;
    c.fill = GridBagConstraints.NONE;
    c.gridy = GridBagConstraints.RELATIVE;

    c.gridy = GridBagConstraints.RELATIVE;

    createTechDataUI();
    createFolderPaneUI();
    createRightsUI();
}

From source file:us.paulevans.basicxslt.TransformOutputPropertiesFrame.java

/**
 * Builds the main panel/*w  ww  . ja v  a  2s  .  c  om*/
 * @return
 */
private JPanel buildMainPanel() {

    int row;
    GridBagLayout layout;
    GridBagConstraints constraints;
    JPanel main;

    layout = new GridBagLayout();
    constraints = new GridBagConstraints();
    main = new JPanel(layout);
    row = 0;
    GUIUtils.add(main,
            new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_CDATA_SECTION_ELEMENTS)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JScrollPane(CDATASectionElements = new JTextArea(3, 30)), layout, constraints, row++,
            1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_DOCTYPE_PUBLIC)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, doctypePublic = new JTextField(30), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_DOCTYPE_SYSTEM)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, doctypeSystem = new JTextField(30), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_ENCODING)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, encoding = new JTextField(30), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_MEDIA_TYPE)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, mediaType = new JTextField(30), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_METHOD)), layout,
            constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, buildMethodPanel(), layout, constraints, row++, 1, 1, 1, GridBagConstraints.WEST,
            GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_VERSION)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, version = new JTextField(30), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_INDENT)), layout,
            constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, indent = new JCheckBox(), layout, constraints, row++, 1, 1, 1, GridBagConstraints.WEST,
            GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main,
            new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_OMIT_XML_DECLARATION)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, omitXmlDeclaration = new JCheckBox(), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_IS_STANDALONE)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, standalone = new JCheckBox(), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    return main;
}

From source file:io.github.tavernaextras.biocatalogue.ui.search_results.RESTMethodListCellRenderer.java

/**
 * @return Final state of the {@link GridBagConstraints} instance
 *         that was used to lay out components in the panel.
 *///  w  w  w. j  a va  2 s  . c om
private GridBagConstraints arrangeLayout() {
    // POPULATE PANEL WITH PREPARED COMPONENTS
    this.setLayout(new GridBagLayout());
    c = new GridBagConstraints();
    c.anchor = GridBagConstraints.NORTHWEST;
    c.fill = GridBagConstraints.HORIZONTAL;

    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 0;
    c.insets = new Insets(8, 6, 6, 3);
    this.add(jlTypeIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(8, 3, 6, 3);
    this.add(jlItemTitle, c);

    c.gridx++;
    c.gridheight = 8;
    c.weightx = 0;
    c.weighty = 1.0;
    this.add(jlItemStatus, c);

    c.gridx = 1;
    c.gridy++;
    c.gridheight = 1;
    c.weightx = 1.0;
    c.weighty = 0;
    this.add(jlPartOf, c);

    c.fill = GridBagConstraints.NONE;
    c.gridy++;
    this.add(jtDescription, c);

    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridy++;
    this.add(jlMethodType, c);

    c.gridy++;
    this.add(jlUrlTemplate, c);

    c.gridy++;
    this.add(jlMethodParameters, c);

    c.gridy++;
    this.add(jlInputRepresentations, c);

    c.gridy++;
    this.add(jlOutputRepresentations, c);
    return (c);
}