Example usage for java.awt GridBagConstraints NORTHWEST

List of usage examples for java.awt GridBagConstraints NORTHWEST

Introduction

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

Prototype

int NORTHWEST

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

Click Source Link

Document

Put the component at the top-left corner of its display area.

Usage

From source file:net.datacrow.console.windows.itemformsettings.TabDesignPanel.java

private void build() {
    setLayout(Layout.getGBL());//  www  .  j  a v  a  2s . c  om
    pnlFields = new FieldSelectionPanel(module, false, true, true);
    pnlFields.setFieldSelectionListener(this);

    add(pnlFields, Layout.getGBC(0, 0, 1, 1, 40.0, 40.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
            new Insets(0, 5, 5, 5), 0, 0));
}

From source file:savant.view.dialog.LoadGenomeDialog.java

/** This method is called from within the constructor to
 * initialize the form./*from  ww w.j a v  a2 s  .com*/
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    withoutSequenceButtonGroup = new javax.swing.ButtonGroup();
    javax.swing.JLabel fromLabel = new javax.swing.JLabel();
    fromFileButton = new javax.swing.JButton();
    fromURLButton = new javax.swing.JButton();
    fromOtherButton = new javax.swing.JButton();
    javax.swing.JSeparator jSeparator1 = new javax.swing.JSeparator();
    publishedGenomeRadio = new javax.swing.JRadioButton();
    javax.swing.JLabel speciesLabel = new javax.swing.JLabel();
    genomesCombo = new javax.swing.JComboBox();
    auxiliaryPanel = new javax.swing.JPanel();
    javax.swing.JSeparator jSeparator2 = new javax.swing.JSeparator();
    userSpecifiedRadio = new javax.swing.JRadioButton();
    javax.swing.JLabel nameLabel = new javax.swing.JLabel();
    nameField = new javax.swing.JTextField();
    javax.swing.JLabel lengthLabel = new javax.swing.JLabel();
    lengthField = new javax.swing.JTextField();
    javax.swing.JSeparator jSeparator3 = new javax.swing.JSeparator();
    okButton = new javax.swing.JButton();
    javax.swing.JButton cancelButton = new javax.swing.JButton();

    withoutSequenceButtonGroup.add(publishedGenomeRadio);
    withoutSequenceButtonGroup.add(userSpecifiedRadio);

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Load Genome");
    getContentPane().setLayout(new java.awt.GridBagLayout());

    fromLabel.setText("Load from:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(30, 30, 3, 3);
    getContentPane().add(fromLabel, gridBagConstraints);

    fromFileButton.setText("File");
    fromFileButton.setPreferredSize(new java.awt.Dimension(150, 29));
    fromFileButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            fromFileButtonActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
    getContentPane().add(fromFileButton, gridBagConstraints);

    fromURLButton.setText("URL");
    fromURLButton.setPreferredSize(new java.awt.Dimension(150, 29));
    fromURLButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            fromURLButtonActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
    getContentPane().add(fromURLButton, gridBagConstraints);

    fromOtherButton.setText("Other Datasource");
    fromOtherButton.setPreferredSize(new java.awt.Dimension(150, 29));
    fromOtherButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            fromOtherButtonActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
    getContentPane().add(fromOtherButton, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.ipadx = 9;
    gridBagConstraints.ipady = 9;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 15, 3, 15);
    getContentPane().add(jSeparator1, gridBagConstraints);

    publishedGenomeRadio.setSelected(true);
    publishedGenomeRadio.setText("Published Genome");
    publishedGenomeRadio.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            publishedGenomeRadioActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 30, 3, 3);
    getContentPane().add(publishedGenomeRadio, gridBagConstraints);

    speciesLabel.setText("Genome:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(3, 30, 3, 3);
    getContentPane().add(speciesLabel, gridBagConstraints);

    genomesCombo.setToolTipText("Species of a published genome to load");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 30);
    getContentPane().add(genomesCombo, gridBagConstraints);

    auxiliaryPanel.setLayout(new java.awt.GridBagLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.ipadx = 30;
    gridBagConstraints.ipady = 30;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 30);
    getContentPane().add(auxiliaryPanel, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.ipadx = 9;
    gridBagConstraints.ipady = 9;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 15, 3, 15);
    getContentPane().add(jSeparator2, gridBagConstraints);

    userSpecifiedRadio.setText("User-specified");
    userSpecifiedRadio.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            userSpecifiedRadioActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 30, 3, 3);
    getContentPane().add(userSpecifiedRadio, gridBagConstraints);

    nameLabel.setText("Name:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 8;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    getContentPane().add(nameLabel, gridBagConstraints);

    nameField.setToolTipText("Name of reference (must correspond to name in records)");
    nameField.setEnabled(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 8;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 90);
    getContentPane().add(nameField, gridBagConstraints);

    lengthLabel.setText("Length:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 9;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    getContentPane().add(lengthLabel, gridBagConstraints);

    lengthField.setToolTipText("Length in basepairs of reference");
    lengthField.setEnabled(false);
    lengthField.addFocusListener(new java.awt.event.FocusAdapter() {
        public void focusLost(java.awt.event.FocusEvent evt) {
            lengthFieldFocusLost(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 9;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 150);
    getContentPane().add(lengthField, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 10;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.ipadx = 9;
    gridBagConstraints.ipady = 9;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 15, 3, 15);
    getContentPane().add(jSeparator3, gridBagConstraints);

    okButton.setText("OK");
    okButton.setPreferredSize(new java.awt.Dimension(90, 29));
    okButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            okButtonActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 5;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 30, 30);
    getContentPane().add(okButton, gridBagConstraints);

    cancelButton.setText("Cancel");
    cancelButton.setPreferredSize(new java.awt.Dimension(90, 29));
    cancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cancelButtonActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
    gridBagConstraints.weightx = 0.5;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 30, 3);
    getContentPane().add(cancelButton, gridBagConstraints);

    pack();
}

From source file:org.openconcerto.erp.core.finance.accounting.ui.PlanComptableGPanel.java

private void uiInit() {
    this.setLayout(new GridBagLayout());
    final GridBagConstraints c = new DefaultGridBagConstraints();

    this.setOpaque(false);
    this.panelCompte.setOpaque(false);
    this.panelInfosCompte.setOpaque(false);
    this.panelDetails.setOpaque(false);

    this.panelCompte.setLayout(new GridBagLayout());
    this.panelInfosCompte.setLayout(new GridBagLayout());
    this.panelDetails.setLayout(new GridBagLayout());

    /*******************************************************************************************
     * * RadioButton Selection du mode d'affichage du PCG abrege, base ou developp Panel
     * Details/*from w  ww .  j  a  v a2 s .co  m*/
     ******************************************************************************************/
    this.panelDetails.add(this.radioCompteBase, c);
    this.radioCompteBase.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateCompteTable();
        }
    });

    c.gridy++;
    this.panelDetails.add(this.radioCompteAbrege, c);
    this.radioCompteAbrege.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateCompteTable();
        }
    });

    c.gridy++;
    this.panelDetails.add(this.radioCompteDeveloppe, c);
    this.radioCompteDeveloppe.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateCompteTable();
        }

    });

    ButtonGroup grp1 = new ButtonGroup();
    grp1.add(this.radioCompteBase);
    grp1.add(this.radioCompteAbrege);
    grp1.add(this.radioCompteDeveloppe);

    this.radioCompteBase.setSelected(true);

    /*******************************************************************************************
     * ** Panel Compte
     ******************************************************************************************/
    c.insets = new Insets(2, 2, 1, 2);
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = 1;
    c.gridheight = 1;
    c.weightx = 0;
    c.weighty = 0;
    this.panelDetails.setBorder(BorderFactory.createTitledBorder("Dtails"));
    this.panelCompte.add(this.panelDetails, c);

    /*******************************************************************************************
     * * Affichage du plan comptable
     ******************************************************************************************/
    SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
    SQLTable classeCompteTable = base.getTable("CLASSE_COMPTE");

    SQLSelect selClasse = new SQLSelect(base);

    selClasse.addSelect(classeCompteTable.getField("ID"));
    selClasse.addSelect(classeCompteTable.getField("NOM"));
    selClasse.addSelect(classeCompteTable.getField("TYPE_NUMERO_COMPTE"));

    selClasse.addRawOrder("\"CLASSE_COMPTE\".\"TYPE_NUMERO_COMPTE\"");

    String reqClasse = selClasse.asString();
    Object obClasse = base.getDataSource().execute(reqClasse, new ArrayListHandler());

    List myListClasse = (List) obClasse;

    if (myListClasse.size() != 0) {
        for (int k = 0; k < myListClasse.size(); k++) {
            Object[] objTmp = (Object[]) myListClasse.get(k);
            ClasseCompte ccTmp = new ClasseCompte(Integer.parseInt(objTmp[0].toString()), objTmp[1].toString(),
                    objTmp[2].toString());
            this.classeComptes.add(ccTmp);

            JTable tab = creerJTable(ccTmp);
            this.tables.add(tab);
            this.tabbedClasse.add(ccTmp.getNom(), new JScrollPane(tab));
        }
    }
    c.gridwidth = 4;
    c.gridheight = 6;
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1;
    c.weighty = 1;
    c.gridx++;
    c.gridy = 0;
    this.panelCompte.add(this.tabbedClasse, c);

    /*******************************************************************************************
     * * Informations sur le compte selectionn Panel Infos Compte
     ******************************************************************************************/
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridheight = 1;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.weightx = 1;
    c.weighty = 0;
    c.gridy = 0;
    c.gridx = 0;
    TitledSeparator sep = new TitledSeparator("Informations sur le compte");
    this.panelInfosCompte.add(sep, c);

    GridBagConstraints cInfos = new GridBagConstraints();
    cInfos.insets = new Insets(0, 0, 0, 0);
    cInfos.fill = GridBagConstraints.BOTH;
    cInfos.anchor = GridBagConstraints.NORTHWEST;
    cInfos.gridx = 0;
    cInfos.gridy = 0;
    cInfos.gridwidth = 1;
    cInfos.gridheight = 1;
    cInfos.weightx = 1;
    cInfos.weighty = 1;
    this.textInfos.setFont(this.getFont());
    this.textInfos.setEditable(false);
    JPanel infos = new JPanel(new GridBagLayout());
    infos.add(this.textInfos, cInfos);

    JScrollPane scrollInfos = new JScrollPane(infos);
    c.insets = new Insets(0, 0, 0, 0);
    c.gridx = 0;
    c.gridy++;
    c.weightx = 1;
    c.weighty = 1;
    c.fill = GridBagConstraints.BOTH;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.gridheight = GridBagConstraints.REMAINDER;

    this.panelInfosCompte.add(scrollInfos, c);
    this.panelInfosCompte.setMinimumSize(new Dimension(100, 80));

    JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT, this.panelCompte, this.panelInfosCompte);
    split.setBorder(null);
    this.add(split, c);
}

From source file:org.zaproxy.zap.extension.spiderAjax.SpiderPanel.java

/**
 * /*www  .  j  av a 2 s .co  m*/
 * @return the AJAX Spider Panel
 */
private javax.swing.JPanel getAJAXSpiderPanel() {
    if (AJAXSpiderPanel == null) {

        AJAXSpiderPanel = new javax.swing.JPanel();
        AJAXSpiderPanel.setLayout(new java.awt.GridBagLayout());
        AJAXSpiderPanel.setName("Spider AJAX Panel");

        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();

        gridBagConstraints1.gridx = 0;
        gridBagConstraints1.gridy = 0;
        gridBagConstraints1.weightx = 1.0D;
        gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
        gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;

        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.gridy = 1;
        gridBagConstraints2.weightx = 1.0;
        gridBagConstraints2.weighty = 1.0;
        gridBagConstraints2.insets = new java.awt.Insets(0, 0, 0, 0);
        gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints2.anchor = java.awt.GridBagConstraints.NORTHWEST;

        AJAXSpiderPanel.add(this.getPanelToolbar(), gridBagConstraints1);
        AJAXSpiderPanel.add(getScrollLog(), gridBagConstraints2);

    }
    return AJAXSpiderPanel;
}

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

/** Builds and lays out the UI. */
private void buildGUI() {
    removeAll();//w  w w  . j a  va  2s  .  c o m

    if (!model.isAnnotationLoaded())
        return;

    pane = new JScrollPane(commentArea);
    pane.setBorder(null);

    setLayout(new GridBagLayout());

    constraints = new GridBagConstraints();
    constraints.insets = new Insets(2, 0, 2, 0);
    constraints.fill = GridBagConstraints.BOTH;
    constraints.anchor = GridBagConstraints.NORTHWEST;
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.weightx = 1;
    constraints.weighty = 1;
    add(pane, constraints);
    constraints.gridy++;

    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    add(addButton, constraints);
    constraints.gridy++;

    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.NORTHWEST;
}

From source file:org.n52.oxf.ui.swing.ReducedChartDialog.java

/**
 * initializes (or updates) the JFreeChart->ChartPanel.
 * /* w  w w  .  ja v  a 2s.c o m*/
 * @param parameters
 * @param selectedfeatures
 */
private void initChartPanel(OXFFeatureCollection observations, ParameterContainer paramCon) {

    // String[] foiIdArray = (String[])
    // paramCon.getParameterShellWithServiceSidedName("featureOfInterest").getSpecifiedValueArray();

    MyGridBagLayout mainLayout = (MyGridBagLayout) getContentPane().getLayout();

    if (getContentPane().getComponentCount() > 2) {
        getContentPane().remove(2);
    }

    JFreeChart chart = chartRenderer.renderChart(observations, paramCon);
    org.jfree.chart.ChartPanel chartPanel = new org.jfree.chart.ChartPanel(chart);
    chartPanel.setMouseZoomable(true, false);

    mainLayout.addComponent(0, chartPanel, 0, 0, 1, 1, 100, 100, GridBagConstraints.NORTHWEST,
            GridBagConstraints.BOTH, new Insets(9, 9, 9, 9));

    getContentPane().validate();
}

From source file:org.executequery.gui.ExecuteProcedurePanel.java

private void init() throws Exception {

    tableModel = new ParameterTableModel();
    table = new DefaultTable(tableModel);
    table.getTableHeader().setReorderingAllowed(false);
    table.setCellSelectionEnabled(true);
    table.setColumnSelectionAllowed(false);
    table.setRowSelectionAllowed(false);

    connectionsCombo = WidgetFactory.createComboBox();
    schemaCombo = WidgetFactory.createComboBox();

    combosGroup = new TableSelectionCombosGroup(connectionsCombo, schemaCombo, null);
    combosGroup.addItemSelectionListener(this);

    objectTypeCombo = WidgetFactory.createComboBox(createAvailableObjectTypes());
    objectTypeCombo.setToolTipText("Select the database object type");
    objectTypeCombo.addItemListener(this);

    proceduresModel = new DynamicComboBoxModel();
    procedureCombo = WidgetFactory.createComboBox(proceduresModel);
    procedureCombo.setActionCommand("procedureSelectionChanged");
    procedureCombo.setToolTipText("Select the database object name");
    procedureCombo.addActionListener(this);

    JPanel base = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.insets = new Insets(5, 7, 5, 8);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.gridy++;//from  ww w.j  a  va2  s. co m
    base.add(new JLabel("Connection:"), gbc);
    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.insets.left = 0;
    base.add(connectionsCombo, gbc);
    gbc.gridx = 0;
    gbc.weightx = 0;
    gbc.gridy++;
    gbc.insets.left = 7;
    gbc.insets.top = 0;
    base.add(new JLabel("Schema:"), gbc);
    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.insets.left = 0;
    base.add(schemaCombo, gbc);
    gbc.gridx = 0;
    gbc.weightx = 0;
    gbc.gridy++;
    gbc.insets.left = 7;
    gbc.insets.top = 0;
    base.add(new JLabel("Object Type:"), gbc);
    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.insets.left = 0;
    base.add(objectTypeCombo, gbc);
    gbc.gridx = 0;
    gbc.weightx = 0;
    gbc.gridy++;
    gbc.insets.left = 7;
    base.add(new JLabel("Object Name:"), gbc);
    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.insets.left = 0;
    base.add(procedureCombo, gbc);

    resultsPanel = new QueryEditorResultsPanel();
    JPanel resultsBase = new JPanel(new BorderLayout());
    resultsBase.add(resultsPanel, BorderLayout.CENTER);

    JSplitPane splitPane = new SplitPaneFactory().create(JSplitPane.VERTICAL_SPLIT, new JScrollPane(table),
            resultsBase);
    splitPane.setResizeWeight(0.5);
    splitPane.setDividerLocation(0.75);
    splitPane.setDividerSize(5);

    gbc.gridy++;
    gbc.gridx = 0;
    gbc.weighty = 1.0;
    gbc.insets.left = 7;
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    base.add(splitPane, gbc);

    JButton executeButton = ActionUtilities.createButton(this, "Execute", "execute");

    gbc.gridy++;
    gbc.weighty = 0;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.insets.top = 0;
    gbc.insets.bottom = 20;
    base.add(executeButton, gbc);

    base.setBorder(BorderFactory.createEtchedBorder());
    setBorder(BorderFactory.createEmptyBorder(5, 5, 7, 5));

    add(base, BorderLayout.CENTER);

    EventMediator.registerListener(this);

    connectionSelectionMade();
}

From source file:pcgen.gui2.tabs.bio.BiographyInfoPane.java

private void initComponents() {
    setLayout(new GridBagLayout());
    Box vbox = Box.createVerticalBox();

    allButton.setText(LanguageBundle.getString("in_all")); //$NON-NLS-1$
    allButton.setActionCommand(ALL_COMMAND);
    noneButton.setText(LanguageBundle.getString("in_none")); //$NON-NLS-1$
    noneButton.setActionCommand(NONE_COMMAND);

    Box hbox = Box.createHorizontalBox();
    hbox.add(new JLabel(LanguageBundle.getString("in_descCheckItem"))); //$NON-NLS-1$
    hbox.add(Box.createRigidArea(new Dimension(5, 0)));
    hbox.add(allButton);/*w  w  w.j a v a  2 s.c  om*/
    hbox.add(Box.createRigidArea(new Dimension(3, 0)));
    hbox.add(noneButton);
    vbox.add(hbox);

    itemsPanel.setLayout(new GridBagLayout());
    itemsPanel.setBorder(new EmptyBorder(8, 5, 8, 5));

    vbox.add(Box.createVerticalStrut(10));
    detailsScroll = new JScrollPane(itemsPanel);
    detailsScroll.setPreferredSize(detailsScroll.getMaximumSize());
    detailsScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    detailsScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    detailsScroll.setMinimumSize(new Dimension(600, 0));
    vbox.add(detailsScroll);
    vbox.add(Box.createVerticalStrut(10));

    hbox = Box.createHorizontalBox();
    hbox.add(Box.createHorizontalGlue());
    addCustomItemButton = new JButton();
    hbox.add(addCustomItemButton);
    hbox.add(Box.createHorizontalGlue());
    vbox.add(hbox);
    vbox.add(Box.createVerticalGlue());

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.weightx = 1;
    gbc.fill = GridBagConstraints.VERTICAL;
    gbc.weighty = 1;
    gbc.insets = new Insets(5, 5, 5, 5);
    add(vbox, gbc);
}

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

protected void createNotValid() {
    GridBagConstraints c = new GridBagConstraints();
    URI licenseURI = LICENSE.getLicenseURI();
    JComponent comp;//w  ww . j a v a  2 s  .  co 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);
}

From source file:de.fhbingen.wbs.wpOverview.tabs.APCalendarPanel.java

/**
 * Initialize the work package calendar panel inclusive the listeners.
 *//*  ww  w. ja v  a2  s . c  o  m*/
private void init() {
    List<Workpackage> userWp = new ArrayList<Workpackage>(WpManager.getUserWp(WPOverview.getUser()));

    Collections.sort(userWp, new APLevelComparator());

    dataset = createDataset(userWp);
    chart = createChart(dataset);

    final ChartPanel chartPanel = new ChartPanel(chart);

    final JPopupMenu popup = new JPopupMenu();
    JMenuItem miSave = new JMenuItem(LocalizedStrings.getButton().save(LocalizedStrings.getWbs().timeLine()));
    miSave.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(final ActionEvent arg0) {

            JFileChooser chooser = new JFileChooser();
            chooser.setFileFilter(new ExtensionAndFolderFilter("jpg", "jpeg")); //NON-NLS
            chooser.setSelectedFile(new File("chart-" //NON-NLS
                    + System.currentTimeMillis() + ".jpg"));
            int returnVal = chooser.showSaveDialog(reference);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                try {
                    File outfile = chooser.getSelectedFile();
                    ChartUtilities.saveChartAsJPEG(outfile, chart, chartPanel.getWidth(),
                            chartPanel.getWidth());
                    Controller.showMessage(
                            LocalizedStrings.getMessages().timeLineSaved(outfile.getCanonicalPath()));
                } catch (IOException e) {
                    Controller.showError(LocalizedStrings.getErrorMessages().timeLineExportError());
                }
            }
        }

    });
    popup.add(miSave);

    chartPanel.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(final MouseEvent e) {
            if (e.getButton() == MouseEvent.BUTTON3) {
                popup.show(e.getComponent(), e.getX(), e.getY());
            }
        }

    });
    chartPanel.setMinimumDrawHeight(50 + 15 * userWp.size());
    chartPanel.setMaximumDrawHeight(50 + 15 * userWp.size());
    chartPanel.setMaximumDrawWidth(9999);
    chartPanel.setPreferredSize(
            new Dimension((int) chartPanel.getPreferredSize().getWidth(), 50 + 15 * userWp.size()));

    chartPanel.setPopupMenu(null);

    this.setLayout(new BorderLayout());

    this.removeAll();

    JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.weightx = 1;
    constraints.weighty = 1;
    constraints.anchor = GridBagConstraints.NORTHWEST;
    panel.add(chartPanel, constraints);

    panel.setBackground(Color.white);
    this.add(panel, BorderLayout.CENTER);

    GanttRenderer.setDefaultShadowsVisible(false);
    GanttRenderer.setDefaultBarPainter(new BarPainter() {

        @Override
        public void paintBar(final Graphics2D g, final BarRenderer arg1, final int row, final int col,
                final RectangularShape rect, final RectangleEdge arg5) {

            String wpName = (String) dataset.getColumnKey(col);
            int i = 0;
            int spaceCount = 0;
            while (wpName.charAt(i++) == ' ' && spaceCount < 17) {
                spaceCount++;
            }

            g.setColor(new Color(spaceCount * 15, spaceCount * 15, spaceCount * 15));
            g.fill(rect);
            g.setColor(Color.black);
            g.setStroke(new BasicStroke());
            g.draw(rect);
        }

        @Override
        public void paintBarShadow(final Graphics2D arg0, final BarRenderer arg1, final int arg2,
                final int arg3, final RectangularShape arg4, final RectangleEdge arg5, final boolean arg6) {

        }

    });

    ((CategoryPlot) chart.getPlot()).setRenderer(new GanttRenderer() {
        private static final long serialVersionUID = -6078915091070733812L;

        public void drawItem(final Graphics2D g2, final CategoryItemRendererState state,
                final Rectangle2D dataArea, final CategoryPlot plot, final CategoryAxis domainAxis,
                final ValueAxis rangeAxis, final CategoryDataset dataset, final int row, final int column,
                final int pass) {
            super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset, row, column, pass);
        }
    });

}