Example usage for java.awt GridBagConstraints WEST

List of usage examples for java.awt GridBagConstraints WEST

Introduction

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

Prototype

int WEST

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

Click Source Link

Document

Put the component on the left side of its display area, centered vertically.

Usage

From source file:org.openmicroscopy.shoola.agents.dataBrowser.view.SearchPanel.java

/**
 * Builds and lays out the component displaying the various options.
 * /*from   w  ww  .ja  v a2s . c  o m*/
 * @return See above.
 */
private JPanel buildScope() {
    JPanel p = new JPanel();
    p.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.setLayout(new GridBagLayout());

    GridBagConstraints c = new GridBagConstraints();
    c.anchor = GridBagConstraints.WEST;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridx = 0;
    c.gridy = 0;

    p.add(new JLabel("Groups:"), c);
    c.gridx = 1;
    p.add(groupsBox, c);

    groupsBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            updateUsersBox();
        }
    });

    c.gridx = 0;
    c.gridy++;

    p.add(new JLabel("Data owned by:"), c);
    c.gridx = 1;
    p.add(usersBox, c);

    UIUtilities.setBoldTitledBorder("Scope", p);

    return p;
}

From source file:be.agiv.security.demo.Main.java

private void rStsIssueToken() {
    GridBagLayout gridBagLayout = new GridBagLayout();
    GridBagConstraints gridBagConstraints = new GridBagConstraints();
    JPanel contentPanel = new JPanel(gridBagLayout);

    JLabel urlLabel = new JLabel("URL:");
    gridBagConstraints.gridx = 0;/*from   w w  w  .  j av a 2 s .co  m*/
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    gridBagConstraints.ipadx = 5;
    gridBagLayout.setConstraints(urlLabel, gridBagConstraints);
    contentPanel.add(urlLabel);

    JTextField urlTextField = new JTextField(
            "https://auth.beta.agiv.be/sts/Services/SalvadorSecurityTokenServiceConfiguration.svc/IWSTrust13",
            60);
    gridBagConstraints.gridx++;
    gridBagLayout.setConstraints(urlTextField, gridBagConstraints);
    contentPanel.add(urlTextField);

    JLabel appliesToLabel = new JLabel("Applies to:");
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy++;
    gridBagLayout.setConstraints(appliesToLabel, gridBagConstraints);
    contentPanel.add(appliesToLabel);

    JTextField appliesToTextField = new JTextField(ClaimsAwareServiceFactory.SERVICE_REALM, 60);
    gridBagConstraints.gridx++;
    gridBagLayout.setConstraints(appliesToTextField, gridBagConstraints);
    contentPanel.add(appliesToTextField);

    int result = JOptionPane.showConfirmDialog(this, contentPanel, "R-STS Issue Token",
            JOptionPane.OK_CANCEL_OPTION);
    if (result == JOptionPane.CANCEL_OPTION) {
        return;
    }

    String location = urlTextField.getText();
    String appliesTo = appliesToTextField.getText();

    RSTSClient rStsClient = new RSTSClient(location);
    try {
        this.rStsSecurityToken = rStsClient.getSecurityToken(this.ipStsSecurityToken, appliesTo);
        this.rStsViewMenuItem.setEnabled(true);
        this.secConvIssueMenuItem.setEnabled(true);
        rStsViewToken();
    } catch (Exception e) {
        showException(e);
    }
}

From source file:erigo.filepump.FilePump.java

private void createAndShowGUI(String default_outputFolderI, double default_filesPerSecI,
        int default_totNumFilesI, FileMode default_modeI, String default_ftpHostI, String default_ftpUserI,
        String default_ftpPasswordI) {

    // Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    // Create the GUI components
    GridBagLayout framegbl = new GridBagLayout();
    filePumpGuiFrame = new JFrame("FilePump");
    GridBagLayout gbl = new GridBagLayout();
    JPanel guiPanel = new JPanel(gbl);
    outputFolderLabel = new JLabel(" ");
    Dimension preferredSize = new Dimension(200, 20);
    outputFolderLabel.setPreferredSize(preferredSize);
    filesPerSecLabel = new JLabel("1");
    totNumFilesLabel = new JLabel("unlimited");
    modeLabel = new JLabel("file system folder");
    fileCountLabel = new JLabel("0");
    endButton = new JButton("Finish test");
    endButton.addActionListener(this);
    actionButton = new JButton("Start pump");
    actionButton.setBackground(Color.GREEN);
    actionButton.addActionListener(this);

    filePumpGuiFrame.setFont(new Font("Dialog", Font.PLAIN, 12));
    guiPanel.setFont(new Font("Dialog", Font.PLAIN, 12));

    int row = 0;/*  w ww  . j a v  a2s .  c  om*/

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.NONE;
    gbc.weightx = 0;
    gbc.weighty = 0;

    // ROW 1
    JLabel label = new JLabel("Output directory");
    gbc.insets = new Insets(15, 15, 0, 5);
    Utility.add(guiPanel, label, gbl, gbc, 0, row, 1, 1);
    gbc.insets = new Insets(15, 0, 0, 15);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 100;
    gbc.weighty = 100;
    Utility.add(guiPanel, outputFolderLabel, gbl, gbc, 1, row, 1, 1);
    gbc.fill = GridBagConstraints.NONE;
    gbc.weightx = 0;
    gbc.weighty = 0;
    ++row;

    // ROW 2
    label = new JLabel("Files/sec");
    gbc.insets = new Insets(15, 15, 0, 5);
    Utility.add(guiPanel, label, gbl, gbc, 0, row, 1, 1);
    gbc.insets = new Insets(15, 0, 0, 15);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 100;
    gbc.weighty = 100;
    Utility.add(guiPanel, filesPerSecLabel, gbl, gbc, 1, row, 1, 1);
    gbc.fill = GridBagConstraints.NONE;
    gbc.weightx = 0;
    gbc.weighty = 0;
    ++row;

    // ROW 3
    label = new JLabel("Tot num files");
    gbc.insets = new Insets(15, 15, 0, 5);
    Utility.add(guiPanel, label, gbl, gbc, 0, row, 1, 1);
    gbc.insets = new Insets(15, 0, 0, 15);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 100;
    gbc.weighty = 100;
    Utility.add(guiPanel, totNumFilesLabel, gbl, gbc, 1, row, 1, 1);
    gbc.fill = GridBagConstraints.NONE;
    gbc.weightx = 0;
    gbc.weighty = 0;
    ++row;

    // ROW 4
    label = new JLabel("Mode");
    gbc.insets = new Insets(15, 15, 0, 5);
    Utility.add(guiPanel, label, gbl, gbc, 0, row, 1, 1);
    gbc.insets = new Insets(15, 0, 0, 15);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 100;
    gbc.weighty = 100;
    Utility.add(guiPanel, modeLabel, gbl, gbc, 1, row, 1, 1);
    gbc.fill = GridBagConstraints.NONE;
    gbc.weightx = 0;
    gbc.weighty = 0;
    ++row;

    // ROW 5
    label = new JLabel("File count");
    gbc.insets = new Insets(15, 15, 0, 5);
    Utility.add(guiPanel, label, gbl, gbc, 0, row, 1, 1);
    gbc.insets = new Insets(15, 0, 0, 15);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 100;
    gbc.weighty = 100;
    Utility.add(guiPanel, fileCountLabel, gbl, gbc, 1, row, 1, 1);
    gbc.fill = GridBagConstraints.NONE;
    gbc.weightx = 0;
    gbc.weighty = 0;
    ++row;

    // ROW 6: command buttons
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(actionButton);
    buttonPanel.add(endButton);
    gbc.insets = new Insets(15, 15, 15, 15);
    gbc.anchor = GridBagConstraints.CENTER;
    Utility.add(guiPanel, buttonPanel, gbl, gbc, 0, row, 2, 1);
    gbc.anchor = GridBagConstraints.WEST;
    ++row;

    // Now add guiPanel to filePumpGuiFrame
    gbc.anchor = GridBagConstraints.CENTER;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weightx = 100;
    gbc.weighty = 100;
    gbc.insets = new Insets(0, 0, 0, 0);
    Utility.add(filePumpGuiFrame, guiPanel, framegbl, gbc, 0, 0, 1, 1);

    // Add menu
    JMenuBar menuBar = createMenu();
    filePumpGuiFrame.setJMenuBar(menuBar);

    // Display the window.
    filePumpGuiFrame.pack();

    filePumpGuiFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

    filePumpGuiFrame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            exit();
        }
    });

    // Create a settings dialog box
    pumpSettings = new FilePumpSettings(filePumpGuiFrame, default_outputFolderI, default_filesPerSecI,
            default_totNumFilesI, default_modeI, default_ftpHostI, default_ftpUserI, default_ftpPasswordI);

    // Initialize information displayed on the GUI front panel
    updateMainFrame();

    filePumpGuiFrame.setVisible(true);

}

From source file:org.datacleaner.windows.OpenAnalysisJobAsTemplateDialog.java

@Override
protected JComponent getDialogContent() {
    final DCPanel panel = new DCPanel();

    int row = 0;//from w w w  . j  a  v a  2s .  c  om
    WidgetUtils.addToGridBag(DCLabel.bright("<html><b>Original value:</b></html>"), panel, 1, row);
    WidgetUtils.addToGridBag(DCLabel.bright("<html><b>New/mapped value:</b></html>"), panel, 2, row);

    row++;
    WidgetUtils.addToGridBag(new JLabel(imageManager.getImageIcon(IconUtils.GENERIC_DATASTORE_IMAGEPATH)),
            panel, 0, row);
    WidgetUtils.addToGridBag(DCLabel.bright(_metadata.getDatastoreName()), panel, 1, row,
            GridBagConstraints.WEST);

    DCPanel datastoreButtonPanel = new DCPanel();
    datastoreButtonPanel.setLayout(new HorizontalLayout(0));
    datastoreButtonPanel.add(_datastoreCombobox);
    datastoreButtonPanel.add(Box.createHorizontalStrut(4));
    datastoreButtonPanel.add(_autoMapButton);

    WidgetUtils.addToGridBag(datastoreButtonPanel, panel, 2, row, GridBagConstraints.WEST);

    Set<String> tableNames = _sourceColumnComboBoxes.keySet();
    for (final String tableName : tableNames) {
        row++;
        final JLabel tableLabel = DCLabel.bright("<html><b>" + tableName + "</b></html>");
        tableLabel.setIcon(imageManager.getImageIcon(IconUtils.MODEL_TABLE, IconUtils.ICON_SIZE_SMALL));
        WidgetUtils.addToGridBag(tableLabel, panel, 0, row, 2, 1, GridBagConstraints.WEST);

        final JButton clearButton = WidgetFactory.createDefaultButton("Clear");
        clearButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                List<SourceColumnComboBox> comboBoxes = _sourceColumnComboBoxes.get(tableName);
                for (SourceColumnComboBox comboBox : comboBoxes) {
                    comboBox.setModel(_datastore, false);
                }
            }
        });
        final DCPanel clearButtonPanel = new DCPanel();
        clearButtonPanel.add(clearButton);
        WidgetUtils.addToGridBag(clearButtonPanel, panel, 2, row, GridBagConstraints.CENTER);

        final List<SourceColumnComboBox> comboBoxes = _sourceColumnComboBoxes.get(tableName);
        for (SourceColumnComboBox comboBox : comboBoxes) {
            row++;
            WidgetUtils.addToGridBag(
                    new JLabel(imageManager.getImageIcon(IconUtils.MODEL_COLUMN, IconUtils.ICON_SIZE_SMALL)),
                    panel, 0, row);
            WidgetUtils.addToGridBag(DCLabel.bright(comboBox.getName()), panel, 1, row,
                    GridBagConstraints.WEST);
            WidgetUtils.addToGridBag(comboBox, panel, 2, row, GridBagConstraints.WEST);
        }
    }
    row++;

    if (!_variableTextFields.isEmpty()) {
        final JLabel tableLabel = DCLabel.bright("<html><b>Job-level variables</b></html>");
        tableLabel.setIcon(imageManager.getImageIcon(IconUtils.MODEL_JOB, IconUtils.ICON_SIZE_SMALL));
        WidgetUtils.addToGridBag(tableLabel, panel, 0, row, 2, 1, GridBagConstraints.WEST);

        for (Entry<String, JXTextField> entry : _variableTextFields.entrySet()) {
            row++;
            String variableId = entry.getKey();
            JXTextField textField = entry.getValue();

            WidgetUtils.addToGridBag(
                    new JLabel(
                            imageManager.getImageIcon("images/model/variable.png", IconUtils.ICON_SIZE_SMALL)),
                    panel, 0, row);
            WidgetUtils.addToGridBag(DCLabel.bright(variableId), panel, 1, row, GridBagConstraints.WEST);
            WidgetUtils.addToGridBag(textField, panel, 2, row, GridBagConstraints.WEST);
        }
        row++;
    }

    final DCPanel openButtonPanel = new DCPanel();
    openButtonPanel.add(_openButton);
    WidgetUtils.addToGridBag(openButtonPanel, panel, 2, row, GridBagConstraints.EAST);

    return WidgetUtils.scrolleable(panel);
}

From source file:gov.loc.repository.bagger.ui.SaveBagFrame.java

private JPanel createComponents() {
    Border border = new EmptyBorder(5, 5, 5, 5);

    TitlePane titlePane = new TitlePane();
    initStandardCommands();//from   w w w  . jav  a  2 s .c  o m
    JPanel pageControl = new JPanel(new BorderLayout());
    JPanel titlePaneContainer = new JPanel(new BorderLayout());
    titlePane.setTitle(bagView.getPropertyMessage("SaveBagFrame.title"));
    titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Define the Bag settings")));
    titlePaneContainer.add(titlePane.getControl());
    titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH);
    pageControl.add(titlePaneContainer, BorderLayout.NORTH);
    JPanel contentPane = new JPanel();

    // TODO: Add bag name field
    // TODO: Add save name file selection button
    JLabel location = new JLabel("Save in:");
    browseButton = new JButton(getMessage("bag.button.browse"));
    browseButton.addActionListener(new SaveBagAsHandler());
    browseButton.setEnabled(true);
    browseButton.setToolTipText(getMessage("bag.button.browse.help"));
    String fileName = "";
    DefaultBag bag = bagView.getBag();
    if (bag != null) {
        fileName = bag.getName();
    }
    bagNameField = new JTextField(fileName);
    bagNameField.setCaretPosition(fileName.length());
    bagNameField.setEditable(false);
    bagNameField.setEnabled(false);

    // Holey bag control
    JLabel holeyLabel = new JLabel(bagView.getPropertyMessage("bag.label.isholey"));
    holeyLabel.setToolTipText(bagView.getPropertyMessage("bag.isholey.help"));
    holeyCheckbox = new JCheckBox(bagView.getPropertyMessage("bag.checkbox.isholey"));
    holeyCheckbox.setBorder(border);
    holeyCheckbox.setSelected(bag.isHoley());
    holeyCheckbox.addActionListener(new HoleyBagHandler());
    holeyCheckbox.setToolTipText(bagView.getPropertyMessage("bag.isholey.help"));

    urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label"));
    urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description"));
    urlLabel.setEnabled(bag.isHoley());
    urlField = new JTextField("");
    try {
        urlField.setText(bag.getFetch().getBaseURL());
    } catch (Exception e) {
        log.error("fetch baseURL: " + e.getMessage());
    }
    urlField.setEnabled(false);

    // TODO: Add format label
    JLabel serializeLabel;
    serializeLabel = new JLabel(getMessage("bag.label.ispackage"));
    serializeLabel.setToolTipText(getMessage("bag.serializetype.help"));

    // TODO: Add format selection panel
    noneButton = new JRadioButton(getMessage("bag.serializetype.none"));
    noneButton.setEnabled(true);
    AbstractAction serializeListener = new SerializeBagHandler();
    noneButton.addActionListener(serializeListener);
    noneButton.setToolTipText(getMessage("bag.serializetype.none.help"));

    zipButton = new JRadioButton(getMessage("bag.serializetype.zip"));
    zipButton.setEnabled(true);
    zipButton.addActionListener(serializeListener);
    zipButton.setToolTipText(getMessage("bag.serializetype.zip.help"));

    /*
    tarButton = new JRadioButton(getMessage("bag.serializetype.tar"));
    tarButton.setEnabled(true);
    tarButton.addActionListener(serializeListener);
    tarButton.setToolTipText(getMessage("bag.serializetype.tar.help"));
            
    tarGzButton = new JRadioButton(getMessage("bag.serializetype.targz"));
    tarGzButton.setEnabled(true);
    tarGzButton.addActionListener(serializeListener);
    tarGzButton.setToolTipText(getMessage("bag.serializetype.targz.help"));
            
    tarBz2Button = new JRadioButton(getMessage("bag.serializetype.tarbz2"));
    tarBz2Button.setEnabled(true);
    tarBz2Button.addActionListener(serializeListener);
    tarBz2Button.setToolTipText(getMessage("bag.serializetype.tarbz2.help"));
    */

    short mode = bag.getSerialMode();
    if (mode == DefaultBag.NO_MODE) {
        this.noneButton.setEnabled(true);
    } else if (mode == DefaultBag.ZIP_MODE) {
        this.zipButton.setEnabled(true);
    } /*else if (mode == DefaultBag.TAR_MODE) {
       this.tarButton.setEnabled(true);
      } else if (mode == DefaultBag.TAR_GZ_MODE) {
       this.tarGzButton.setEnabled(true);
      } else if (mode == DefaultBag.TAR_BZ2_MODE) {
       this.tarBz2Button.setEnabled(true);
      } */else {
        this.noneButton.setEnabled(true);
    }

    ButtonGroup serializeGroup = new ButtonGroup();
    serializeGroup.add(noneButton);
    serializeGroup.add(zipButton);
    //serializeGroup.add(tarButton);
    //serializeGroup.add(tarGzButton);
    //serializeGroup.add(tarBz2Button);
    serializeGroupPanel = new JPanel(new FlowLayout());
    serializeGroupPanel.add(serializeLabel);
    serializeGroupPanel.add(noneButton);
    serializeGroupPanel.add(zipButton);
    //serializeGroupPanel.add(tarButton);
    //serializeGroupPanel.add(tarGzButton);
    //serializeGroupPanel.add(tarBz2Button);
    serializeGroupPanel.setBorder(border);
    serializeGroupPanel.setEnabled(true);
    serializeGroupPanel.setToolTipText(bagView.getPropertyMessage("bag.serializetype.help"));

    JLabel tagLabel = new JLabel(getMessage("bag.label.istag"));
    tagLabel.setToolTipText(getMessage("bag.label.istag.help"));
    isTagCheckbox = new JCheckBox();
    isTagCheckbox.setBorder(border);
    isTagCheckbox.setSelected(bag.isBuildTagManifest());
    isTagCheckbox.addActionListener(new TagManifestHandler());
    isTagCheckbox.setToolTipText(getMessage("bag.checkbox.istag.help"));

    JLabel tagAlgorithmLabel = new JLabel(getMessage("bag.label.tagalgorithm"));
    tagAlgorithmLabel.setToolTipText(getMessage("bag.label.tagalgorithm.help"));
    ArrayList<String> listModel = new ArrayList<String>();
    for (Algorithm algorithm : Algorithm.values()) {
        listModel.add(algorithm.bagItAlgorithm);
    }
    tagAlgorithmList = new JComboBox(listModel.toArray());
    tagAlgorithmList.setName(getMessage("bag.tagalgorithmlist"));
    tagAlgorithmList.setSelectedItem(bag.getTagManifestAlgorithm());
    tagAlgorithmList.addActionListener(new TagAlgorithmListHandler());
    tagAlgorithmList.setToolTipText(getMessage("bag.tagalgorithmlist.help"));

    JLabel payloadLabel = new JLabel(getMessage("bag.label.ispayload"));
    payloadLabel.setToolTipText(getMessage("bag.ispayload.help"));
    isPayloadCheckbox = new JCheckBox();
    isPayloadCheckbox.setBorder(border);
    isPayloadCheckbox.setSelected(bag.isBuildPayloadManifest());
    isPayloadCheckbox.addActionListener(new PayloadManifestHandler());
    isPayloadCheckbox.setToolTipText(getMessage("bag.ispayload.help"));

    JLabel payAlgorithmLabel = new JLabel(bagView.getPropertyMessage("bag.label.payalgorithm"));
    payAlgorithmLabel.setToolTipText(getMessage("bag.payalgorithm.help"));
    payAlgorithmList = new JComboBox(listModel.toArray());
    payAlgorithmList.setName(getMessage("bag.payalgorithmlist"));
    payAlgorithmList.setSelectedItem(bag.getPayloadManifestAlgorithm());
    payAlgorithmList.addActionListener(new PayAlgorithmListHandler());
    payAlgorithmList.setToolTipText(getMessage("bag.payalgorithmlist.help"));

    GridBagLayout layout = new GridBagLayout();
    GridBagConstraints glbc = new GridBagConstraints();
    JPanel panel = new JPanel(layout);
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));

    int row = 0;

    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(location, glbc);
    panel.add(location);

    buildConstraints(glbc, 2, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.EAST);
    glbc.ipadx = 5;
    layout.setConstraints(browseButton, glbc);
    glbc.ipadx = 0;
    panel.add(browseButton);

    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
    glbc.ipadx = 5;
    layout.setConstraints(bagNameField, glbc);
    glbc.ipadx = 0;
    panel.add(bagNameField);

    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(holeyLabel, glbc);
    panel.add(holeyLabel);
    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.WEST, GridBagConstraints.WEST);
    layout.setConstraints(holeyCheckbox, glbc);
    panel.add(holeyCheckbox);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(urlLabel, glbc);
    panel.add(urlLabel);
    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(urlField, glbc);
    panel.add(urlField);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(serializeLabel, glbc);
    panel.add(serializeLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
    layout.setConstraints(serializeGroupPanel, glbc);
    panel.add(serializeGroupPanel);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(tagLabel, glbc);
    panel.add(tagLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(isTagCheckbox, glbc);
    panel.add(isTagCheckbox);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(tagAlgorithmLabel, glbc);
    panel.add(tagAlgorithmLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(tagAlgorithmList, glbc);
    panel.add(tagAlgorithmList);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(payloadLabel, glbc);
    panel.add(payloadLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(isPayloadCheckbox, glbc);
    panel.add(isPayloadCheckbox);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(payAlgorithmLabel, glbc);
    panel.add(payAlgorithmLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(payAlgorithmList, glbc);
    panel.add(payAlgorithmList);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);

    GuiStandardUtils.attachDialogBorder(contentPane);
    pageControl.add(panel);
    JComponent buttonBar = createButtonBar();
    pageControl.add(buttonBar, BorderLayout.SOUTH);

    this.pack();
    return pageControl;

}

From source file:com.sec.ose.osi.ui.frm.main.identification.stringmatch.JPanStringMatchMain.java

/**
 * This method initializes jPanel   //from w  w w. j a va  2  s .  com
 *    
 * @return javax.swing.JPanel   
 */
private JPanel getJPanelBottom() {
    if (jPanelBottom == null) {
        GridBagConstraints gridBagConstraints18 = new GridBagConstraints();
        gridBagConstraints18.gridx = 0;
        gridBagConstraints18.gridy = 2;
        gridBagConstraints18.anchor = GridBagConstraints.WEST;
        gridBagConstraints18.insets = new Insets(0, 20, 0, 0);
        GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
        gridBagConstraints8.gridx = 0;
        gridBagConstraints8.anchor = GridBagConstraints.WEST;
        gridBagConstraints8.insets = new Insets(0, 24, 0, 0);
        gridBagConstraints8.gridy = 4;
        GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
        gridBagConstraints7.gridx = 0;
        gridBagConstraints7.anchor = GridBagConstraints.WEST;
        gridBagConstraints7.weightx = 1.0;
        gridBagConstraints7.gridy = 3;
        GridBagConstraints gridBagConstraints61 = new GridBagConstraints();
        gridBagConstraints61.gridx = 0;
        gridBagConstraints61.anchor = GridBagConstraints.WEST;
        gridBagConstraints61.insets = new Insets(0, 110, 0, 0);
        gridBagConstraints61.gridy = 1;
        GridBagConstraints gridBagConstraints51 = new GridBagConstraints();
        gridBagConstraints51.gridx = 0;
        gridBagConstraints51.anchor = GridBagConstraints.WEST;
        gridBagConstraints51.gridy = 0;
        jPanelBottom = new JPanel();
        jPanelBottom.setLayout(new GridBagLayout());
        jPanelBottom.add(getJPanelThisFileIsFolderTitle(), gridBagConstraints51);
        jPanelBottom.add(getJPanelLicenseFolder(), gridBagConstraints61);
        jPanelBottom.add(getJPanelThisFileContainsFolderTitle(), gridBagConstraints7);
        jPanelBottom.add(getJPanelRepreLicenFolder(), gridBagConstraints8);
        jPanelBottom.add(getJPanel2(), gridBagConstraints18);
    }
    return jPanelBottom;
}

From source file:org.pentaho.reporting.designer.extensions.pentaho.repository.dialogs.RepositoryPublishDialog.java

private JPanel createPublishSettingsPanel() {
    final JComboBox fileFormat = new JComboBox(exportFormatModel);

    final GridBagConstraints c = new GridBagConstraints();
    final JPanel publishSettingsPanel = new JPanel(new GridBagLayout());

    c.insets = new Insets(5, 5, 0, 5);
    c.gridwidth = 1;//from w  w w.ja v a  2s. co  m
    c.gridx = 0;
    c.gridy = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.WEST;
    publishSettingsPanel.add(new JLabel(Messages.getInstance().getString("RepositoryPublishDialog.OutputType")),
            c);

    c.insets = new Insets(5, 5, 5, 0);
    c.gridwidth = 1;
    c.gridx = 0;
    c.gridy = 1;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.WEST;
    c.weightx = 0.0;
    publishSettingsPanel.add(fileFormat, c);

    c.insets = new Insets(0, 5, 5, 5);
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.WEST;
    c.gridx = 1;
    c.gridy = 1;
    c.weightx = 1.0;
    publishSettingsPanel.add(lockOutputTypeCheckBox, c);
    return publishSettingsPanel;
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.ChannelAcquisitionComponent.java

/** Builds and lays out the UI. */
private void buildGUI() {
    setBackground(UIUtilities.BACKGROUND_COLOR);
    parent.layoutFields(generalPane, unsetGeneral, fieldsGeneral, unsetGeneralShown);

    setLayout(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.fill = GridBagConstraints.BOTH;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.insets = new Insets(0, 2, 2, 0);
    constraints.weightx = 1.0;//from   w w  w. j a  v  a2s . c  o m
    constraints.gridy = 0;
    if (generalPane.isVisible()) {
        add(generalPane, constraints);
        ++constraints.gridy;
    }
    if (detectorPane.isVisible()) {
        add(detectorPane, constraints);
        ++constraints.gridy;
    }
    if (lightPane.isVisible()) {
        add(lightPane, constraints);
        ++constraints.gridy;
    }
    if (lightPathPane != null) {
        add(lightPathPane, constraints);
        ++constraints.gridy;
    }
    if (filterSetPane != null) {
        add(filterSetPane, constraints);
        ++constraints.gridy;
    }
    constraints.fill = GridBagConstraints.HORIZONTAL;
    add(exposureTask, constraints);
    parent.attachListener(fieldsGeneral);
}

From source file:com.att.aro.ui.view.videotab.VideoTab.java

/**
 * MidPanel contains Video Requests//from  ww  w .j  av  a  2  s  . c om
 */
private JPanel buildRequestsGroup() {

    JPanel pane;
    pane = new JPanel(new GridBagLayout());

    int section = 0;

    VideoRequestPanel requestPanel = new VideoRequestPanel();
    pane.add(requestPanel, new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, noInsets, 0, 0));
    bpObservable.registerObserver(requestPanel);

    JPanel wrapper = getTitledWrapper("video.tab.request.title", null);
    wrapper.add(pane, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL, noInsets, 0, 0));
    return wrapper;
}

From source file:be.vds.jtbdive.client.view.core.dive.profile.DiveProfileGraphicDetailPanel.java

private JPanel createInstantDataPanel() {
    I18nLabel timeLabel = new I18nLabel("dive.time");
    instantDepthLabel = new JLabel();
    setDephtLabelText();// ww  w  . j  a  v  a  2 s. c  o  m

    instantTimeTf = new JTextField(6);
    instantTimeTf.setText(null);
    instantTimeTf.setEditable(false);
    instantTimeTf.setFocusable(false);

    instantDepthTf = new JTextField(6);
    instantDepthTf.setText(null);
    instantDepthTf.setEditable(false);
    instantDepthTf.setFocusable(false);

    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(3, 3, 3, 3);

    JPanel instantDataPanel = new DetailPanel();
    instantDataPanel.setLayout(new GridBagLayout());
    instantDataPanel.setOpaque(false);

    GridBagLayoutManager.addComponent(instantDataPanel, timeLabel, c, 0, 0, 1, 1, 0, 0, GridBagConstraints.NONE,
            GridBagConstraints.WEST);
    GridBagLayoutManager.addComponent(instantDataPanel, instantTimeTf, c, 1, 0, 1, 1, 1, 0,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);

    GridBagLayoutManager.addComponent(instantDataPanel, instantDepthLabel, c, 0, 1, 1, 1, 0, 0,
            GridBagConstraints.NONE, GridBagConstraints.WEST);
    GridBagLayoutManager.addComponent(instantDataPanel, instantDepthTf, c, 1, 1, 1, 1, 1, 0,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);

    return instantDataPanel;
}