Example usage for java.awt GridBagConstraints NORTH

List of usage examples for java.awt GridBagConstraints NORTH

Introduction

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

Prototype

int NORTH

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

Click Source Link

Document

Put the component at the top of its display area, centered horizontally.

Usage

From source file:com.sec.ose.osi.ui.dialog.setting.JPanProjectAnalysisSetting.java

/**
 * This method initializes this//from   w  ww .  ja va2  s  .c o  m
 * 
 * @return void
 */
private void initialize() {
    GridBagConstraints gridBagConstraints71 = new GridBagConstraints();
    gridBagConstraints71.anchor = GridBagConstraints.NORTHWEST;
    gridBagConstraints71.weightx = 1.0;
    gridBagConstraints71.weighty = 1.0;
    gridBagConstraints71.insets = new Insets(0, 0, 0, 0);
    gridBagConstraints71.fill = GridBagConstraints.BOTH;
    GridBagConstraints gridBagConstraints14 = new GridBagConstraints();
    gridBagConstraints14.gridx = -1;
    gridBagConstraints14.anchor = GridBagConstraints.NORTH;
    gridBagConstraints14.insets = new Insets(10, 10, 0, 10);
    gridBagConstraints14.gridy = -1;
    this.setLayout(new GridBagLayout());
    this.add(getJIntMainPanel(), gridBagConstraints71);
    this.add(getJPanel(), gridBagConstraints14);
}

From source file:ro.nextreports.designer.wizpublish.SelectEntityWizardPanel.java

private void jbInit() {
    this.setLayout(new GridBagLayout());
    banner.setTitle(I18NSupport.getString("wizard.publish.entities.select"));

    btnAdd.setIcon(ImageUtil.getImageIcon("add"));
    btnAdd.setPreferredSize(btnDim);/*from  w  ww  .ja  va 2  s .  c o m*/
    btnAdd.setMinimumSize(btnDim);
    btnAdd.setMaximumSize(btnDim);
    btnAdd.setToolTipText(I18NSupport.getString("listselectionpanel.add"));
    btnAdd.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            add();
        }
    });

    btnRem.setIcon(ImageUtil.getImageIcon("delete"));
    btnRem.setPreferredSize(btnDim);
    btnRem.setMinimumSize(btnDim);
    btnRem.setMaximumSize(btnDim);
    btnRem.setToolTipText(I18NSupport.getString("listselectionpanel.remove"));
    btnRem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            remove();
        }
    });

    list.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() == 2) {
                remove();
            }
        }
    });

    scrList.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrList.setMinimumSize(scrDim);
    scrList.setPreferredSize(scrDim);
    scrList.getViewport().add(list, null);
    list.setModel(listModel);

    JPanel btnPanel = new JPanel();
    btnPanel.setLayout(new BoxLayout(btnPanel, BoxLayout.Y_AXIS));
    btnPanel.add(Box.createGlue());
    btnPanel.add(btnAdd);
    btnPanel.add(Box.createRigidArea(new Dimension(5, 5)));
    btnPanel.add(btnRem);
    btnPanel.add(Box.createGlue());

    add(scrList, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHEAST,
            GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));

    add(btnPanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
}

From source file:analysers.FilterValidatedDialog.java

/**
 * Create the dialog.//from   w ww .ja  va 2  s  . c  o  m
 */
public FilterValidatedDialog() {
    setTitle("Validated Lineages: Export Filter");
    setBounds(100, 100, 632, 348);
    getContentPane().setLayout(new BorderLayout());
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    getContentPane().add(contentPanel, BorderLayout.CENTER);
    GridBagLayout gbl_contentPanel = new GridBagLayout();
    gbl_contentPanel.columnWidths = new int[] { 160, 440, 0 };
    gbl_contentPanel.rowHeights = new int[] { 1, 28, 28, 28, 0, 0 };
    gbl_contentPanel.columnWeights = new double[] { 1.0, 1.0, Double.MIN_VALUE };
    gbl_contentPanel.rowWeights = new double[] { 0.0, 0.0, 0.0, 1.0, 0.0, Double.MIN_VALUE };
    contentPanel.setLayout(gbl_contentPanel);
    {
        JLabel lblCriterion = new JLabel("Lineage Criterion");
        lblCriterion.setFont(new Font("Lucida Grande", Font.BOLD, 13));
        GridBagConstraints gbc_lblCriterion = new GridBagConstraints();
        gbc_lblCriterion.insets = new Insets(0, 0, 5, 5);
        gbc_lblCriterion.gridx = 0;
        gbc_lblCriterion.gridy = 0;
        contentPanel.add(lblCriterion, gbc_lblCriterion);
    }
    {
        JLabel lblValue = new JLabel("Value");
        lblValue.setFont(new Font("Lucida Grande", Font.BOLD, 13));
        GridBagConstraints gbc_lblValue = new GridBagConstraints();
        gbc_lblValue.insets = new Insets(0, 0, 5, 0);
        gbc_lblValue.gridx = 1;
        gbc_lblValue.gridy = 0;
        contentPanel.add(lblValue, gbc_lblValue);
    }
    {
        lblMinLineageLength = new JLabel("Min. Length (frames)");
        GridBagConstraints gbc_lblMinLineageLength = new GridBagConstraints();
        gbc_lblMinLineageLength.fill = GridBagConstraints.BOTH;
        gbc_lblMinLineageLength.insets = new Insets(0, 0, 5, 5);
        gbc_lblMinLineageLength.gridx = 0;
        gbc_lblMinLineageLength.gridy = 1;
        contentPanel.add(lblMinLineageLength, gbc_lblMinLineageLength);
    }
    {
        minLinLen = new JTextField();
        GridBagConstraints gbc_minLinLen = new GridBagConstraints();
        gbc_minLinLen.anchor = GridBagConstraints.NORTH;
        gbc_minLinLen.fill = GridBagConstraints.HORIZONTAL;
        gbc_minLinLen.insets = new Insets(0, 0, 5, 0);
        gbc_minLinLen.gridx = 1;
        gbc_minLinLen.gridy = 1;
        contentPanel.add(minLinLen, gbc_minLinLen);
        minLinLen.setText("1");
        minLinLen.setColumns(3);
    }
    {
        lblStartFrameOf = new JLabel("Max. Start Frame");
        GridBagConstraints gbc_lblStartFrameOf = new GridBagConstraints();
        gbc_lblStartFrameOf.fill = GridBagConstraints.HORIZONTAL;
        gbc_lblStartFrameOf.insets = new Insets(0, 0, 5, 5);
        gbc_lblStartFrameOf.gridx = 0;
        gbc_lblStartFrameOf.gridy = 2;
        contentPanel.add(lblStartFrameOf, gbc_lblStartFrameOf);
    }
    {
        startLin = new JTextField();
        GridBagConstraints gbc_startLin = new GridBagConstraints();
        gbc_startLin.insets = new Insets(0, 0, 5, 0);
        gbc_startLin.fill = GridBagConstraints.HORIZONTAL;
        gbc_startLin.gridx = 1;
        gbc_startLin.gridy = 2;
        contentPanel.add(startLin, gbc_startLin);
        startLin.setText("-1");
        startLin.setColumns(3);
    }
    {
        JButton btnPreview = new JButton("Preview");
        btnPreview.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
                preview.setText(makePreview());
            }
        });
        GridBagConstraints gbc_btnPreview = new GridBagConstraints();
        gbc_btnPreview.insets = new Insets(0, 0, 5, 5);
        gbc_btnPreview.gridx = 0;
        gbc_btnPreview.gridy = 3;
        contentPanel.add(btnPreview, gbc_btnPreview);
    }
    {
        JScrollPane scrollPane = new JScrollPane();
        GridBagConstraints gbc_scrollPane = new GridBagConstraints();
        gbc_scrollPane.insets = new Insets(0, 0, 5, 0);
        gbc_scrollPane.fill = GridBagConstraints.BOTH;
        gbc_scrollPane.gridx = 1;
        gbc_scrollPane.gridy = 3;
        contentPanel.add(scrollPane, gbc_scrollPane);
        {
            preview = new JTextArea();
            scrollPane.setViewportView(preview);
            preview.setEditable(false);
            preview.setColumns(10);
            preview.setTabSize(4);
        }
    }
    {
        JLabel lblOptions = new JLabel("Options");
        GridBagConstraints gbc_lblOptions = new GridBagConstraints();
        gbc_lblOptions.insets = new Insets(0, 0, 0, 5);
        gbc_lblOptions.gridx = 0;
        gbc_lblOptions.gridy = 4;
        contentPanel.add(lblOptions, gbc_lblOptions);
    }
    {
        JPanel panel = new JPanel();
        GridBagConstraints gbc_panel = new GridBagConstraints();
        gbc_panel.anchor = GridBagConstraints.NORTH;
        gbc_panel.fill = GridBagConstraints.HORIZONTAL;
        gbc_panel.gridx = 1;
        gbc_panel.gridy = 4;
        contentPanel.add(panel, gbc_panel);
        GridBagLayout gbl_panel = new GridBagLayout();
        gbl_panel.columnWidths = new int[] { 69, 169, 162, 0 };
        gbl_panel.rowHeights = new int[] { 23, 23, 0 };
        gbl_panel.columnWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
        gbl_panel.rowWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
        panel.setLayout(gbl_panel);
        {
            rdbtnExportMeanIntensity = new JRadioButton("Export Mean Intensity");
            rdbtnExportMeanIntensity.setSelected(true);
            buttonGroup.add(rdbtnExportMeanIntensity);
            GridBagConstraints gbc_rdbtnExportMeanIntensity = new GridBagConstraints();
            gbc_rdbtnExportMeanIntensity.anchor = GridBagConstraints.NORTHWEST;
            gbc_rdbtnExportMeanIntensity.insets = new Insets(0, 0, 5, 5);
            gbc_rdbtnExportMeanIntensity.gridx = 1;
            gbc_rdbtnExportMeanIntensity.gridy = 0;
            panel.add(rdbtnExportMeanIntensity, gbc_rdbtnExportMeanIntensity);
        }
        {
            rdbtnExportMaxIntensity = new JRadioButton("Export Max Intensity");
            buttonGroup.add(rdbtnExportMaxIntensity);
            GridBagConstraints gbc_rdbtnExportMaxIntensity = new GridBagConstraints();
            gbc_rdbtnExportMaxIntensity.anchor = GridBagConstraints.NORTHWEST;
            gbc_rdbtnExportMaxIntensity.insets = new Insets(0, 0, 5, 0);
            gbc_rdbtnExportMaxIntensity.gridx = 2;
            gbc_rdbtnExportMaxIntensity.gridy = 0;
            panel.add(rdbtnExportMaxIntensity, gbc_rdbtnExportMaxIntensity);
        }
        {
            chckbxExportPositions = new JCheckBox("Export Cell Positions and Areas in CSV");
            GridBagConstraints gbc_chckbxExportPositions = new GridBagConstraints();
            gbc_chckbxExportPositions.anchor = GridBagConstraints.NORTH;
            gbc_chckbxExportPositions.gridwidth = 2;
            gbc_chckbxExportPositions.gridx = 1;
            gbc_chckbxExportPositions.gridy = 1;
            panel.add(chckbxExportPositions, gbc_chckbxExportPositions);
        }
    }
    {
        JPanel buttonPane = new JPanel();
        buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
        getContentPane().add(buttonPane, BorderLayout.SOUTH);
        {
            JButton okButton = new JButton("OK");
            okButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent arg0) {
                    if (validateFields()) {
                        Prefs.set("TrackApp.FilterValidatedDialog.startLin", valStartLin);
                        Prefs.set("TrackApp.FilterValidatedDialog.minLinLen", valMinLinLen);
                        Prefs.set("TrackApp.FilterValidatedDialog.exportMean", doExportMean);
                        Prefs.set("TrackApp.FilterValidatedDialog.exportPositions", doExportPositions);
                        Prefs.savePreferences();
                        dispose();
                    }
                }
            });
            okButton.setActionCommand("OK");
            buttonPane.add(okButton);
            getRootPane().setDefaultButton(okButton);
        }
        {
            JButton cancelButton = new JButton("Cancel");
            cancelButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    dispose();
                }
            });
            cancelButton.setActionCommand("Cancel");
            buttonPane.add(cancelButton);
        }
    }
}

From source file:com.digitalgeneralists.assurance.ui.components.ScanDefinitionPanel.java

@Override
protected void initializeComponent() {
    if (!this.initialized) {
        if (this.definition == null) {
            mode = AssuranceDialogMode.ADD;
            this.dialogTitle = "Add New Scan Definition";
            this.definition = new ScanDefinition();
        } else {//from  w ww .  j a  v a2  s.c om
            mode = AssuranceDialogMode.EDIT;
            this.dialogTitle = "Edit Scan Definition";
        }

        GridBagLayout gridbag = new GridBagLayout();
        this.setLayout(gridbag);

        final JPanel optionsPanel = new JPanel();
        optionsPanel.setLayout(new GridBagLayout());

        Border optionsBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
        optionsBorder = BorderFactory.createTitledBorder(optionsBorder, "Merge Options", TitledBorder.CENTER,
                TitledBorder.TOP);

        GridBagConstraints nameTextFieldConstraints = new GridBagConstraints();
        nameTextFieldConstraints.anchor = GridBagConstraints.NORTH;
        nameTextFieldConstraints.fill = GridBagConstraints.HORIZONTAL;
        nameTextFieldConstraints.gridx = 0;
        nameTextFieldConstraints.gridy = 0;
        nameTextFieldConstraints.weightx = 1.0;
        nameTextFieldConstraints.weighty = 1.0;
        nameTextFieldConstraints.gridheight = 1;
        nameTextFieldConstraints.gridwidth = 2;
        nameTextFieldConstraints.insets = new Insets(10, 5, 0, 5);

        this.nameTextField.setText(this.definition.getName());
        this.nameTextField.getDocument().addDocumentListener(this.textPropertyValidationListener);
        this.add(this.nameTextField, nameTextFieldConstraints);

        Border existingScanMappingsPanelBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
        existingScanMappingsPanelBorder = BorderFactory.createTitledBorder(existingScanMappingsPanelBorder,
                "Paths", TitledBorder.CENTER, TitledBorder.TOP);

        GridBagConstraints existingScanMappingsPanelConstraints = new GridBagConstraints();
        existingScanMappingsPanelConstraints.anchor = GridBagConstraints.WEST;
        existingScanMappingsPanelConstraints.fill = GridBagConstraints.BOTH;
        existingScanMappingsPanelConstraints.gridx = 0;
        existingScanMappingsPanelConstraints.gridy = 1;
        existingScanMappingsPanelConstraints.weightx = 1.0;
        existingScanMappingsPanelConstraints.weighty = 1.0;
        existingScanMappingsPanelConstraints.gridheight = 1;
        existingScanMappingsPanelConstraints.gridwidth = 2;
        existingScanMappingsPanelConstraints.insets = new Insets(5, 5, 0, 5);

        JPanel existingScanMappingsPanel = new JPanel();
        GridBagLayout panelGridbag = new GridBagLayout();
        existingScanMappingsPanel.setLayout(panelGridbag);
        existingScanMappingsPanel.setBorder(existingScanMappingsPanelBorder);
        this.add(existingScanMappingsPanel, existingScanMappingsPanelConstraints);

        GridBagConstraints existingScanMappingsListConstraints = new GridBagConstraints();
        existingScanMappingsListConstraints.anchor = GridBagConstraints.WEST;
        existingScanMappingsListConstraints.fill = GridBagConstraints.BOTH;
        existingScanMappingsListConstraints.gridx = 0;
        existingScanMappingsListConstraints.gridy = 0;
        existingScanMappingsListConstraints.weightx = 1.0;
        existingScanMappingsListConstraints.weighty = 0.9;
        existingScanMappingsListConstraints.gridheight = 1;
        existingScanMappingsListConstraints.gridwidth = 2;
        existingScanMappingsListConstraints.insets = new Insets(5, 5, 5, 5);

        this.definition = (ScanDefinition) ModelUtils.initializeEntity(this.definition,
                ScanDefinition.SCAN_MAPPING_PROPERTY);
        this.scanMappingsList = new ListInputPanel<ScanMappingDefinition>(this.definition, this);
        existingScanMappingsPanel.add(this.scanMappingsList, existingScanMappingsListConstraints);

        GridBagConstraints optionsPanelConstraints = new GridBagConstraints();
        optionsPanelConstraints.anchor = GridBagConstraints.SOUTH;
        optionsPanelConstraints.fill = GridBagConstraints.HORIZONTAL;
        optionsPanelConstraints.gridx = 0;
        optionsPanelConstraints.gridy = 3;
        optionsPanelConstraints.weightx = 1.0;
        optionsPanelConstraints.weighty = 1.0;
        optionsPanelConstraints.gridheight = 1;
        optionsPanelConstraints.gridwidth = 2;
        optionsPanelConstraints.insets = new Insets(5, 5, 5, 5);

        optionsPanel.setBorder(optionsBorder);
        this.add(optionsPanel, optionsPanelConstraints);

        GridBagConstraints strategyLabelConstraints = new GridBagConstraints();
        strategyLabelConstraints.anchor = GridBagConstraints.WEST;
        strategyLabelConstraints.fill = GridBagConstraints.BOTH;
        strategyLabelConstraints.gridx = 0;
        strategyLabelConstraints.gridy = 0;
        strategyLabelConstraints.weightx = 1.0;
        strategyLabelConstraints.weighty = 1.0;
        strategyLabelConstraints.gridheight = 1;
        strategyLabelConstraints.gridwidth = 1;
        strategyLabelConstraints.insets = new Insets(5, 5, 0, 5);

        final JLabel strategyLabel = new JLabel("Strategy", SwingConstants.RIGHT);
        optionsPanel.add(strategyLabel, strategyLabelConstraints);

        GridBagConstraints strategyComboBoxConstraints = new GridBagConstraints();
        strategyComboBoxConstraints.anchor = GridBagConstraints.WEST;
        strategyComboBoxConstraints.fill = GridBagConstraints.VERTICAL;
        strategyComboBoxConstraints.gridx = 1;
        strategyComboBoxConstraints.gridy = 0;
        strategyComboBoxConstraints.weightx = 1.0;
        strategyComboBoxConstraints.weighty = 1.0;
        strategyComboBoxConstraints.gridheight = 1;
        strategyComboBoxConstraints.gridwidth = 1;
        strategyComboBoxConstraints.insets = new Insets(5, 5, 0, 5);

        String[] strategyLabels = { "Source", "Target", "Both" };
        this.strategyComboBox = new JComboBox<String>(strategyLabels);
        // NOTE: We should have better validation of the data state for these controls.
        // We could run into problems as the application versions over time.
        this.strategyComboBox.setSelectedIndex(this.definition.getMergeStrategy().ordinal());
        this.strategyComboBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                validateFormState();
            }
        });
        optionsPanel.add(this.strategyComboBox, strategyComboBoxConstraints);

        GridBagConstraints autoMergeCheckBoxConstraints = new GridBagConstraints();
        autoMergeCheckBoxConstraints.gridx = 0;
        autoMergeCheckBoxConstraints.gridy = 1;
        autoMergeCheckBoxConstraints.weightx = 1.0;
        autoMergeCheckBoxConstraints.weighty = 1.0;
        autoMergeCheckBoxConstraints.gridheight = 1;
        autoMergeCheckBoxConstraints.gridwidth = 2;
        autoMergeCheckBoxConstraints.insets = new Insets(2, 5, 5, 5);

        this.autoMergeCheckBox.setHorizontalTextPosition(SwingConstants.LEFT);
        this.autoMergeCheckBox.setSelected(this.definition.getAutoResolveConflicts());
        this.autoMergeCheckBox.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                validateFormState();
            }
        });
        optionsPanel.add(this.autoMergeCheckBox, autoMergeCheckBoxConstraints);

        GridBagConstraints includeNonCreationTimestampsCheckBoxConstraints = new GridBagConstraints();
        includeNonCreationTimestampsCheckBoxConstraints.gridx = 0;
        includeNonCreationTimestampsCheckBoxConstraints.gridy = 2;
        includeNonCreationTimestampsCheckBoxConstraints.weightx = 1.0;
        includeNonCreationTimestampsCheckBoxConstraints.weighty = 1.0;
        includeNonCreationTimestampsCheckBoxConstraints.gridheight = 1;
        includeNonCreationTimestampsCheckBoxConstraints.gridwidth = 2;
        includeNonCreationTimestampsCheckBoxConstraints.insets = new Insets(2, 5, 5, 5);

        this.includeNonCreationTimestampCheckBox.setHorizontalTextPosition(SwingConstants.LEFT);
        this.includeNonCreationTimestampCheckBox.setSelected(this.definition.getIncludeNonCreationTimestamps());
        this.includeNonCreationTimestampCheckBox.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                validateFormState();
            }
        });
        optionsPanel.add(this.includeNonCreationTimestampCheckBox,
                includeNonCreationTimestampsCheckBoxConstraints);

        GridBagConstraints advancedAttributesCheckBoxConstraints = new GridBagConstraints();
        advancedAttributesCheckBoxConstraints.gridx = 0;
        advancedAttributesCheckBoxConstraints.gridy = 3;
        advancedAttributesCheckBoxConstraints.weightx = 1.0;
        advancedAttributesCheckBoxConstraints.weighty = 1.0;
        advancedAttributesCheckBoxConstraints.gridheight = 1;
        advancedAttributesCheckBoxConstraints.gridwidth = 2;
        advancedAttributesCheckBoxConstraints.insets = new Insets(2, 5, 5, 5);

        this.includeAdvancedAttributesCheckBox.setHorizontalTextPosition(SwingConstants.LEFT);
        this.includeAdvancedAttributesCheckBox.setSelected(this.definition.getAutoResolveConflicts());
        this.includeAdvancedAttributesCheckBox.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                validateFormState();
            }
        });
        optionsPanel.add(this.includeAdvancedAttributesCheckBox, advancedAttributesCheckBoxConstraints);

        this.scanMappingsList.loadData();

        if (this.getMode() == AssuranceDialogMode.EDIT) {
            this.validateFormState();
        }

        this.initialized = true;
    }
}

From source file:com.sec.ose.osi.ui.frm.main.manage.dialog.JDlgProjectCreate.java

/**
 * This method initializes this//from  ww  w. ja  v a2s.  c o  m
 * 
 * @return void
 */
private void initialize() {
    GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
    gridBagConstraints5.gridx = 0;
    gridBagConstraints5.weightx = 0.1;
    gridBagConstraints5.weighty = 0.0;
    gridBagConstraints5.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints5.insets = new Insets(0, 10, 0, 0);
    gridBagConstraints5.gridy = 1;
    GridBagConstraints gridBagConstraints41 = new GridBagConstraints();
    gridBagConstraints41.gridx = 0;
    gridBagConstraints41.weightx = 0.1;
    gridBagConstraints41.anchor = GridBagConstraints.CENTER;
    gridBagConstraints41.insets = new Insets(0, 10, 20, 0);
    gridBagConstraints41.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints41.gridy = 0;
    GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
    gridBagConstraints3.gridx = 1;
    gridBagConstraints3.gridheight = 2;
    gridBagConstraints3.anchor = GridBagConstraints.NORTH;
    gridBagConstraints3.insets = new Insets(10, 0, 0, 0);
    gridBagConstraints3.gridy = 0;
    this.setSize(600, 250);
    this.setLayout(new GridBagLayout());
    this.add(getJPanelButton(), gridBagConstraints3);
    this.add(getJPanelPjtName(), gridBagConstraints41);
    this.add(getJPanelSourceLocation(), gridBagConstraints5);

    getJTextFieldSourceLocation().setText(strPath);
    getJTextFieldSourceLocation().setToolTipText(strPath);
}

From source file:fr.eurecom.hybris.demogui.HybrisDemoGui.java

private void initializeGUI() {
    frame = new JFrame("Hybris Demo GUI");
    frame.setIconImage(new ImageIcon(getClass().getResource("/clouds.png")).getImage());
    frame.setBounds(100, 100, 650, 500);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(new GridBagLayout());

    JPanel cloudParentPanel = new JPanel(new GridLayout(1, 2, 10, 10));
    JPanel hybrisPanel = new JPanel(new GridBagLayout());
    JPanel cloudsPanel = new JPanel(new GridBagLayout());

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.weightx = 1.0;//w ww  . j a  v  a  2s.  com
    gbc.weighty = 1.0;
    gbc.insets = new Insets(5, 5, 5, 5);

    gbc.anchor = GridBagConstraints.NORTH;
    gbc.fill = GridBagConstraints.BOTH;

    gbc.gridwidth = 3;
    gbc.gridheight = 1;
    gbc.gridx = 0;
    gbc.gridy = 0;
    hybrisPanel.add(new JLabel("<html><b>Hybris</b></html>"), gbc);

    gbc.gridwidth = 3;
    gbc.gridheight = 3;
    gbc.gridx = 0;
    gbc.gridy = 1;

    lstHybris = new JList<String>(lmHybris);
    lstHybris.setPreferredSize(new java.awt.Dimension(100, 500));
    lstHybris.setMinimumSize(new java.awt.Dimension(100, 440));
    hybrisPanel.add(lstHybris, gbc);

    gbc.anchor = GridBagConstraints.SOUTH;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridwidth = 1;
    gbc.gridx = 0;
    gbc.gridy = 4;
    btnPut = new JButton("Put");
    hybrisPanel.add(btnPut, gbc);
    gbc.gridx = 1;
    gbc.gridy = 4;
    btnGet = new JButton("Get");
    hybrisPanel.add(btnGet, gbc);
    gbc.gridx = 2;
    gbc.gridy = 4;
    btnDelete = new JButton("Delete");
    hybrisPanel.add(btnDelete, gbc);

    gbc.fill = GridBagConstraints.BOTH;
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    cloudsPanel.add(new JLabel("<html><b>Amazon S3</b></html>"), gbc);

    gbc.gridheight = 2;
    gbc.gridy = 1;
    lstAmazon = new JList<String>(lmAmazon);
    lstAmazon.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    lstAmazon.setPreferredSize(new java.awt.Dimension(100, 100));
    cloudsPanel.add(lstAmazon, gbc);

    gbc.gridy = 3;
    gbc.gridheight = 1;
    cloudsPanel.add(new JLabel("<html><b>Microsoft Azure</b></html>"), gbc);

    gbc.gridheight = 2;
    gbc.gridy = 4;
    lstAzure = new JList<String>(lmAzure);
    lstAzure.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    lstAzure.setPreferredSize(new java.awt.Dimension(100, 100));
    cloudsPanel.add(lstAzure, gbc);

    gbc.gridy = 6;
    gbc.gridheight = 1;
    cloudsPanel.add(new JLabel("<html><b>Google Cloud Storage</b></html>"), gbc);

    gbc.gridheight = 2;
    gbc.gridy = 7;
    lstGoogle = new JList<String>(lmGoogle);
    lstGoogle.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    lstGoogle.setPreferredSize(new java.awt.Dimension(100, 100));
    cloudsPanel.add(lstGoogle, gbc);

    gbc.gridy = 9;
    gbc.gridheight = 1;
    cloudsPanel.add(new JLabel("<html><b>Rackspace Cloud Files</b></html>"), gbc);

    gbc.gridheight = 2;
    gbc.gridy = 10;
    lstRackspace = new JList<String>(lmRackspace);
    lstRackspace.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    lstRackspace.setPreferredSize(new java.awt.Dimension(100, 100));
    cloudsPanel.add(lstRackspace, gbc);

    cloudParentPanel.add(hybrisPanel);
    cloudParentPanel.add(cloudsPanel);

    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    frame.add(cloudParentPanel, gbc);

    gbc.gridx = 0;
    gbc.gridy = 1;
    JTextArea jt = new JTextArea(10, 30);
    JScrollPane scrollPane = new JScrollPane(jt);
    frame.add(scrollPane, gbc);

    PrintStream printStream = new PrintStream(new CustomOutputStream(jt));
    System.setOut(printStream);
    System.setErr(printStream);

    frame.pack();
    frame.setSize(550, 800);
    frame.setResizable(false);

    lstAmazon.addKeyListener(this);
    lstAzure.addKeyListener(this);
    lstGoogle.addKeyListener(this);
    lstRackspace.addKeyListener(this);
    lstHybris.addKeyListener(this);

    lstAmazon.setCellRenderer(this.new MyListRenderer("amazon"));
    lstGoogle.setCellRenderer(this.new MyListRenderer("google"));
    lstAzure.setCellRenderer(this.new MyListRenderer("azure"));
    lstRackspace.setCellRenderer(this.new MyListRenderer("rackspace"));

    btnGet.addActionListener(this);
    btnPut.addActionListener(this);
    btnDelete.addActionListener(this);
}

From source file:ro.nextreports.designer.wizpublish.DownloadListWizardPanel.java

private void init() {
    setLayout(new GridBagLayout());

    btnAdd.setIcon(ImageUtil.getImageIcon("add"));
    btnAdd.setPreferredSize(btnDim);//from  w  ww .j av  a 2 s.c  om
    btnAdd.setMinimumSize(btnDim);
    btnAdd.setMaximumSize(btnDim);
    btnAdd.setToolTipText(I18NSupport.getString("listselectionpanel.add"));
    btnAdd.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            add();
        }
    });

    btnRem.setIcon(ImageUtil.getImageIcon("delete"));
    btnRem.setPreferredSize(btnDim);
    btnRem.setMinimumSize(btnDim);
    btnRem.setMaximumSize(btnDim);
    btnRem.setToolTipText(I18NSupport.getString("listselectionpanel.remove"));
    btnRem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            remove();
        }
    });

    list.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() == 2) {
                remove();
            }
        }
    });

    scrList.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrList.setMinimumSize(scrDim);
    scrList.setPreferredSize(scrDim);
    scrList.getViewport().add(list, null);
    list.setModel(listModel);

    JPanel btnPanel = new JPanel();
    btnPanel.setLayout(new BoxLayout(btnPanel, BoxLayout.Y_AXIS));
    btnPanel.add(Box.createGlue());
    btnPanel.add(btnAdd);
    btnPanel.add(Box.createRigidArea(new Dimension(5, 5)));
    btnPanel.add(btnRem);
    btnPanel.add(Box.createGlue());

    add(scrList, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHEAST,
            GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));

    add(btnPanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
}

From source file:org.zaproxy.zap.extension.quickstart.QuickStartPanel.java

private void initialize() {
    this.setIcon(new ImageIcon(BreakPanel.class.getResource("/resource/icon/16/147.png"))); // 'lightning' icon
    this.setDefaultAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | Event.SHIFT_MASK, false));
    this.setMnemonic(Constant.messages.getChar("quickstart.panel.mnemonic"));
    this.setLayout(new BorderLayout());

    JPanel panelContent = new JPanel(new GridBagLayout());
    JScrollPane jScrollPane = new JScrollPane();
    jScrollPane.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 11));
    jScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jScrollPane.setViewportView(panelContent);

    this.add(jScrollPane, BorderLayout.CENTER);

    panelContent.setBackground(Color.white);
    panelContent.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));

    /*/*from w  ww . j a v  a  2  s.  c om*/
     * Layout:
     * Col            0                      1                      2                    3                       4
     * Row+----------------------+----------------------+----------------------+----------------------+----------------------+
     *  0 | Top welcome message                                                                       |    zap128x128.png    |
     *  1 | URL:                 | [ Url field                                                      ] |                      |
     *  2 |                      | [ Attack button ]    | [ Stop button ]      | padding              |                      |
     *  3 | Progress:            | Progress details                                                   |                      |
     *    | Bottom message                                                                                                   |
     *    | Show at start:       | [x]                  |                      |                      |                      |
     *    +----------------------+----------------------+----------------------+----------------------+----------------------+
     */

    panelContent.add(new JLabel(Constant.messages.getString("quickstart.panel.topmsg")),
            LayoutHelper.getGBC(0, 0, 4, 1.0D, new Insets(5, 5, 5, 5)));
    if (Constant.isDevBuild()) {
        panelContent.add(
                new JLabel(new ImageIcon(QuickStartPanel.class
                        .getResource("/org/zaproxy/zap/extension/quickstart/resources/zap128x128dark.png"))),
                LayoutHelper.getGBC(4, 0, 1, 0.0D, 0.0D, GridBagConstraints.NORTH));
    } else {
        panelContent.add(
                new JLabel(DisplayUtils.getScaledIcon(
                        new ImageIcon(SearchPanel.class.getResource("/resource/zap128x128.png")))),
                LayoutHelper.getGBC(4, 0, 1, 0.0D, 0.0D, GridBagConstraints.NORTH));
    }

    panelContent.add(new JLabel(Constant.messages.getString("quickstart.label.url")),
            LayoutHelper.getGBC(0, 1, 1, 0.0D, new Insets(5, 5, 5, 5)));

    JPanel urlSelectPanel = new JPanel(new GridBagLayout());
    JButton selectButton = new JButton(Constant.messages.getString("all.button.select"));
    selectButton.setIcon(
            DisplayUtils.getScaledIcon(new ImageIcon(View.class.getResource("/resource/icon/16/094.png")))); // Globe icon
    selectButton.addActionListener(new java.awt.event.ActionListener() {
        @Override
        public void actionPerformed(java.awt.event.ActionEvent e) {
            NodeSelectDialog nsd = new NodeSelectDialog(View.getSingleton().getMainFrame());
            SiteNode node = null;
            try {
                node = Model.getSingleton().getSession().getSiteTree()
                        .findNode(new URI(getUrlField().getText(), false));
            } catch (Exception e2) {
                // Ignore
            }
            node = nsd.showDialog(node);
            if (node != null && node.getHistoryReference() != null) {
                try {
                    getUrlField().setText(node.getHistoryReference().getURI().toString());
                } catch (Exception e1) {
                    // Ignore
                }
            }
        }
    });

    urlSelectPanel.add(this.getUrlField(), LayoutHelper.getGBC(0, 0, 1, 1.0D));
    urlSelectPanel.add(selectButton, LayoutHelper.getGBC(1, 0, 1, 0.0D));
    panelContent.add(urlSelectPanel, LayoutHelper.getGBC(1, 1, 3, 0.25D));

    panelContent.add(this.getAttackButton(), LayoutHelper.getGBC(1, 2, 1, 0.0D));
    panelContent.add(this.getStopButton(), LayoutHelper.getGBC(2, 2, 1, 0.0D));
    panelContent.add(new JLabel(""), LayoutHelper.getGBC(3, 2, 1, 0.75D, 0.0D)); // Padding to right of buttons

    progressLabel = new JLabel(
            Constant.messages.getString("quickstart.progress." + AttackThread.Progress.notstarted.name()));
    panelContent.add(new JLabel(Constant.messages.getString("quickstart.label.progress")),
            LayoutHelper.getGBC(0, 3, 1, 0.0D, new Insets(5, 5, 5, 5)));
    panelContent.add(this.progressLabel, LayoutHelper.getGBC(1, 3, 3, 0.0D));

    panelContent.add(new JLabel(Constant.messages.getString("quickstart.panel.proxymsg")),
            LayoutHelper.getGBC(0, 4, 5, 1.0D, new Insets(5, 5, 5, 5)));

    if (Control.getSingleton().getExtensionLoader().getExtension("ExtensionPlugNHack") != null) {
        // Plug-n-Hack extension has been installed - this makes configuration much easier :)
        if (DesktopUtils.canOpenUrlInBrowser()) {
            panelContent.add(new JLabel(Constant.messages.getString("quickstart.label.mitm")),
                    LayoutHelper.getGBC(0, 6, 1, 0.0D, new Insets(5, 5, 5, 5)));
            panelContent.add(this.getConfButton(), LayoutHelper.getGBC(1, 6, 1, 0.0D));

            panelContent.add(new JLabel(Constant.messages.getString("quickstart.label.mitmalt")),
                    LayoutHelper.getGBC(0, 7, 1, 0.0D, new Insets(5, 5, 5, 5)));
        } else {
            panelContent.add(new JLabel(Constant.messages.getString("quickstart.label.mitmurl")),
                    LayoutHelper.getGBC(0, 7, 1, 0.0D, new Insets(5, 5, 5, 5)));
        }
        panelContent.add(this.getConfField(), LayoutHelper.getGBC(1, 7, 3, 0.25D));

    } else {
        panelContent.add(new JLabel(Constant.messages.getString("quickstart.panel.helpmsg")),
                LayoutHelper.getGBC(0, 5, 5, 1.0D, new Insets(5, 5, 5, 5)));

    }

    panelContent.add(new JLabel(""), LayoutHelper.getGBC(0, 10, 4, 1.D, 1.0D)); // Padding at bottom

    this.setMode(Control.getSingleton().getMode());
}

From source file:com.vgi.mafscaling.VECalc.java

protected void createControlPanel(JPanel dataPanel) {
    JPanel cntlPanel = new JPanel();
    GridBagConstraints gbl_ctrlPanel = new GridBagConstraints();
    gbl_ctrlPanel.insets = insets3;/*from w  w  w  . j av a2  s .c o m*/
    gbl_ctrlPanel.anchor = GridBagConstraints.NORTH;
    gbl_ctrlPanel.fill = GridBagConstraints.HORIZONTAL;
    gbl_ctrlPanel.gridx = 0;
    gbl_ctrlPanel.gridy = 0;
    gbl_ctrlPanel.weightx = 1.0;
    gbl_ctrlPanel.gridwidth = 2;
    dataPanel.add(cntlPanel, gbl_ctrlPanel);

    GridBagLayout gbl_cntlPanel = new GridBagLayout();
    gbl_cntlPanel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
    gbl_cntlPanel.rowHeights = new int[] { 0 };
    gbl_cntlPanel.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            1.0 };
    gbl_cntlPanel.rowWeights = new double[] { 0 };
    cntlPanel.setLayout(gbl_cntlPanel);

    addButton(cntlPanel, 0, "Load Log", "loadlog", GridBagConstraints.WEST);
    addButton(cntlPanel, 1, "Clear SD Data", "clearorig", GridBagConstraints.WEST);
    addButton(cntlPanel, 2, "Clear Run Data", "clearlog", GridBagConstraints.WEST);
    addButton(cntlPanel, 3, "Clear All", "clearall", GridBagConstraints.WEST);
    addLabel(cntlPanel, 4, "SD");
    sdType = addComboBox(cntlPanel, 5, new String[] { "RR SD", "Cobb SD" });
    addLabel(cntlPanel, 6, "MP");
    mpType = addComboBox(cntlPanel, 7,
            new String[] { "Torr/mmHG Abs", "Torr/mmHG Rel Sea Lvl", "Psi Abs", "Psi Rel Sea Lvl" });
    addLabel(cntlPanel, 8, "Run");
    dataType = addComboBox(cntlPanel, 9, new String[] { "MAF Builder", "AFR Tuner" });
    addCheckBox(cntlPanel, 10, "Hide Log Table", "hidelogtable");
    compareTableCheckBox = addCheckBox(cntlPanel, 11, "Compare Tables", "comparetables");
    addButton(cntlPanel, 12, "GO", "go", GridBagConstraints.EAST);
}

From source file:com.limegroup.gnutella.gui.LicenseWindow.java

protected void createNotValid() {
    GridBagConstraints c = new GridBagConstraints();
    URI licenseURI = LICENSE.getLicenseURI();
    JComponent comp;//from   w  w w.j a v a2s  .  c  o  m

    comp = new JLabel(getWarningIcon());
    c.anchor = GridBagConstraints.NORTH;
    c.insets = new Insets(0, 0, 0, 5);
    DETAILS.add(comp, c);

    String invalidText = getInvalidString();
    if (licenseURI != null && allowRetryLink())
        invalidText += "  " + getRetryString();
    comp = newTextArea(invalidText);
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1;
    c.weighty = 1;
    c.insets = new Insets(7, 0, 0, 0);
    DETAILS.add(comp, c);

    c.gridwidth = 1;
    c.gridheight = 2;
    c.weightx = 0;
    c.weighty = 0;
    DETAILS.add(javax.swing.Box.createGlue(), c);

    JButton button = new JButton(getVerifyString());
    button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ev) {
            LICENSE.verify(LicenseWindow.this);
            buildDetails();
        }
    });
    button.setVisible(licenseURI != null && allowVerifyLookup());
    c.gridwidth = GridBagConstraints.RELATIVE;
    c.gridheight = 2;
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.CENTER;
    c.insets = new Insets(0, 0, 0, 100);
    DETAILS.add(button, c);

    if (LICENSE.getLicenseDeed(URN) == null || !allowClaimedDeedLink()) {
        comp = new JLabel();
        comp.setVisible(false);
    } else {
        comp = new URLLabel(LICENSE.getLicenseDeed(URN), getClaimedDeedString());
    }
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.gridheight = 1;
    c.anchor = GridBagConstraints.WEST;
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 0;
    c.weighty = 0;
    c.insets = new Insets(0, 0, 3, 0);
    DETAILS.add(comp, c);

    if (licenseURI == null || !allowVerificationLink()) {
        comp = new JLabel();
        comp.setVisible(false);
    } else {
        comp = new URLLabel(licenseURI, getVerificationString());
    }
    c.insets = new Insets(0, 0, 3, 0);
    DETAILS.add(comp, c);
}