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:de.tor.tribes.ui.views.DSWorkbenchFormFrame.java

/** This method is called from within the constructor to
 * initialize the form./*  w ww  .  j ava 2 s  . c  om*/
 * 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;

    jFormTablePanel = new org.jdesktop.swingx.JXPanel();
    infoPanel = new org.jdesktop.swingx.JXCollapsiblePane();
    jXLabel1 = new org.jdesktop.swingx.JXLabel();
    jScrollPane4 = new javax.swing.JScrollPane();
    jFormPanel = new javax.swing.JPanel();
    jAlwaysOnTop = new javax.swing.JCheckBox();
    capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel();

    jFormTablePanel.setLayout(new java.awt.BorderLayout());

    infoPanel.setCollapsed(true);
    infoPanel.setInheritAlpha(false);

    jXLabel1.setText("Keine Meldung");
    jXLabel1.setOpaque(true);
    jXLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            fireHideInfoEvent(evt);
        }
    });
    infoPanel.add(jXLabel1, java.awt.BorderLayout.CENTER);

    jFormTablePanel.add(infoPanel, java.awt.BorderLayout.SOUTH);

    jFormsTable
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    jScrollPane4.setViewportView(jFormsTable);

    jFormTablePanel.add(jScrollPane4, java.awt.BorderLayout.CENTER);

    setTitle("Zeichnungen");
    getContentPane().setLayout(new java.awt.GridBagLayout());

    jFormPanel.setBackground(new java.awt.Color(239, 235, 223));
    jFormPanel.setLayout(new java.awt.BorderLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipadx = 439;
    gridBagConstraints.ipady = 319;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    getContentPane().add(jFormPanel, gridBagConstraints);

    jAlwaysOnTop.setText("Immer im Vordergrund");
    jAlwaysOnTop.setOpaque(false);
    jAlwaysOnTop.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            fireFormFrameAlwaysOnTopEvent(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    getContentPane().add(jAlwaysOnTop, gridBagConstraints);

    capabilityInfoPanel1.setPastable(false);
    capabilityInfoPanel1.setSearchable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    getContentPane().add(capabilityInfoPanel1, gridBagConstraints);

    pack();
}

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

/**
 * Lays out the passed components./* ww  w  .j  a  v a  2s . com*/
 * 
 * @param pane The main pane.
 * @param components The components to lay out.
 */
private void layoutComponents(JPanel pane, Map<JLabel, JComponent> components) {
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.WEST;
    c.insets = new Insets(0, 2, 2, 0);
    Entry<JLabel, JComponent> entry;

    Iterator<Entry<JLabel, JComponent>> i = components.entrySet().iterator();
    c.gridy = 0;
    while (i.hasNext()) {
        c.gridx = 0;
        entry = i.next();
        ++c.gridy;
        c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
        c.fill = GridBagConstraints.NONE; //reset to default
        c.weightx = 0.0;
        pane.add(entry.getKey(), c);
        c.gridx++;
        pane.add(Box.createHorizontalStrut(5), c);
        c.gridx++;
        c.gridwidth = GridBagConstraints.REMAINDER;//end row
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        pane.add(entry.getValue(), c);
    }
}

From source file:es.mityc.firmaJava.libreria.pkcs7.ValidaTarjeta.java

/**
 * This method initializes jContentPane   
 *    /*  w  ww.ja va  2 s  .  com*/
 * @return javax.swing.JPanel   
 */
private JPanel getJContentPane() {
    if (jContentPane == null) {
        GridBagConstraints gridBagConstraints16 = new GridBagConstraints(); // Botn Cancelar
        gridBagConstraints16.gridx = 2;
        gridBagConstraints16.gridy = 3;
        gridBagConstraints16.weightx = 0.5;
        gridBagConstraints16.insets = new Insets(10, 0, 20, 0);

        GridBagConstraints gridBagConstraints15 = new GridBagConstraints(); // Botn Aceptar
        gridBagConstraints15.gridx = 1;
        gridBagConstraints15.gridy = 3;
        gridBagConstraints15.weightx = 0.5;
        gridBagConstraints15.insets = new Insets(10, 0, 20, 0);

        GridBagConstraints gridBagConstraints14 = new GridBagConstraints(); // Botn Examinar
        gridBagConstraints14.gridx = 3;
        gridBagConstraints14.gridy = 2;
        gridBagConstraints14.insets = new Insets(0, 10, 10, 10);

        GridBagConstraints gridBagConstraints13 = new GridBagConstraints(); // Campo de texto Librera de la Tarjeta
        gridBagConstraints13.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints13.gridy = 2;
        gridBagConstraints13.weightx = 1.0;
        gridBagConstraints13.gridx = 1;
        gridBagConstraints13.gridwidth = 2;
        gridBagConstraints13.insets = new Insets(0, 10, 10, 0);

        GridBagConstraints gridBagConstraints10 = new GridBagConstraints(); // Campo de texto Nombre de la Tarjeta
        gridBagConstraints10.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints10.gridy = 1;
        gridBagConstraints10.weightx = 1.0;
        gridBagConstraints10.gridx = 1;
        gridBagConstraints10.gridwidth = 2;
        gridBagConstraints10.insets = new Insets(0, 10, 10, 0);

        GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); // Label Librera de la tarjeta
        gridBagConstraints9.gridx = 0;
        gridBagConstraints9.gridy = 2;
        gridBagConstraints9.anchor = GridBagConstraints.WEST;
        gridBagConstraints9.insets = new Insets(0, 10, 10, 0);
        jNuevaLibreriaLabel = new JLabel();
        jNuevaLibreriaLabel.setText(I18n.getResource(LIBRERIAXADES_VALIDARTARJETA_TEXTO_25));

        GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); // Label Nombre de la Tarjeta
        gridBagConstraints8.gridx = 0;
        gridBagConstraints8.gridy = 1;
        gridBagConstraints8.anchor = GridBagConstraints.WEST;
        gridBagConstraints8.insets = new Insets(0, 10, 10, 0);
        jNombreTarjetaLabel = new JLabel();
        jNombreTarjetaLabel.setText(I18n.getResource(LIBRERIAXADES_VALIDARTARJETA_TEXTO_26));

        GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); // Ttulo del panel principal
        gridBagConstraints7.gridx = 0;
        gridBagConstraints7.gridy = 0;
        gridBagConstraints7.gridwidth = 4;
        gridBagConstraints7.anchor = GridBagConstraints.WEST;
        gridBagConstraints7.insets = new Insets(10, 10, 20, 0);
        jAgregarLabel = new JLabel();
        jAgregarLabel.setText(I18n.getResource(LIBRERIAXADES_VALIDARTARJETA_TEXTO_27));

        jContentPane = new JPanel();
        jContentPane.setLayout(new GridBagLayout());
        jContentPane.add(jAgregarLabel, gridBagConstraints7);
        jContentPane.add(jNombreTarjetaLabel, gridBagConstraints8);
        jContentPane.add(jNuevaLibreriaLabel, gridBagConstraints9);
        jContentPane.add(getJNombreTarjetaTextField(), gridBagConstraints10);
        jContentPane.add(getJNuevaLibreriaTextField(), gridBagConstraints13);
        jContentPane.add(getJExaminarButton1(), gridBagConstraints14);
        jContentPane.add(getJAceptarAgregarButton(), gridBagConstraints15);
        jContentPane.add(getJCancelarAgregarButton(), gridBagConstraints16);
    }
    return jContentPane;
}

From source file:com.lp.client.frame.component.PanelDokumentenablage.java

private void jbInit() throws Throwable {
    if (LPMain.getInstance().getDesktop()
            .darfAnwenderAufZusatzfunktionZugreifen(MandantFac.ZUSATZFUNKTION_DOKUMENTENABLAGE)) {
        if (!(new HeliumDocPath()).equals(fullDocPath)) {
            bHatDokumentenablage = true;
        }/*w  ww .  jav  a2 s  .co  m*/
    }
    if (bShowExitButton) {
        String[] aWhichButtonIUse = new String[] { PanelBasis.ACTION_NEW, PanelBasis.ACTION_UPDATE,
                PanelBasis.ACTION_SAVE, PanelBasis.ACTION_DISCARD };
        enableToolsPanelButtons(aWhichButtonIUse);
        createAndSaveAndShowButton("/com/lp/client/res/scanner.png", "TWAIN-Import", BUTTON_SCAN, null);
    }
    dropArea.setCenterText(LPMain.getTextRespectUISPr("lp.datei.draganddrop.ablegen"));
    dropArea.setBackground(Color.LIGHT_GRAY);
    dropArea.setSupportFiles(true);
    dropArea.addDropListener(this);
    dropArea.setMinimumSize(new Dimension(200, 100));

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);

    JPanel leftPane = new JPanel();
    JPanel rightPane = new JPanel();

    JLayeredPane rightLayered = new JLayeredPane();
    rightLayered.setLayout(new GridBagLayout());
    rightLayered.add(rightPane, new GridBagConstraints(1, 1, 1, 1, 1, 1, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    // rightLayered.setLayer(rightPane, 0, 1);
    if (bShowExitButton && bHatDokumentenablage)
        rightLayered.add(dropArea, new GridBagConstraints(1, 2, 1, 1, 1, 1, GridBagConstraints.CENTER,
                GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    // rightLayered.setLayer(dropArea, 1, 1);

    rightPane.setLayout(new GridBagLayout());

    tree = new WrapperJTree(treeModel);
    tree.setEditable(false);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.setShowsRootHandles(true);
    tree.setRowHeight(0);

    tree.setCellRenderer(new ToolTipCellRenderer());
    ToolTipManager.sharedInstance().registerComponent(tree);

    tree.addTreeSelectionListener(this);

    refresh();

    personalDto = DelegateFactory.getInstance().getPersonalDelegate()
            .personalFindByPrimaryKey(LPMain.getTheClient().getIDPersonal());
    dokumentbelegartDto = DelegateFactory.getInstance().getJCRDocDelegate()
            .dokumentbelegartfindbyMandant(LPMain.getTheClient().getMandant());
    for (int i = 0; i < dokumentbelegartDto.length; i++) {
        if (!JCRDocFac.DEFAULT_ARCHIV_BELEGART.equals(dokumentbelegartDto[i].getCNr()))
            wcbBelegart.addItem(dokumentbelegartDto[i].getCNr());
    }
    dokumentgruppierungDto = DelegateFactory.getInstance().getJCRDocDelegate()
            .dokumentgruppierungfindbyMandant(LPMain.getTheClient().getMandant());
    for (int i = 0; i < dokumentgruppierungDto.length; i++) {
        if (!JCRDocFac.DEFAULT_ARCHIV_GRUPPE.equals(dokumentgruppierungDto[i].getCNr())
                || !JCRDocFac.DEFAULT_KOPIE_GRUPPE.equals(dokumentgruppierungDto[i].getCNr())
                || !JCRDocFac.DEFAULT_VERSANDAUFTRAG_GRUPPE.equals(dokumentgruppierungDto[i].getCNr())) {
            wcbGruppierung.addItem(dokumentgruppierungDto[i].getCNr());
        }
    }

    // Listen for when the selection changes.
    tree.addTreeExpansionListener(this);

    wcbVersteckteAnzeigen.setEnabled(true);
    wcbVersteckteAnzeigen.addActionListener(actionListener);

    wtfSuche.setEditable(true);
    wbuSuche.setEnabled(true);
    wbuSuche.addActionListener(actionListener);
    wbuPartner = new WrapperButton();

    wbuPartner.setText(LPMain.getTextRespectUISPr("button.partner"));
    wbuPartner.setToolTipText(LPMain.getTextRespectUISPr("button.partner.tooltip"));

    wbuPartner.setActionCommand(ACTION_SPECIAL_PARTNER);
    wbuPartner.addActionListener(this);
    wbuChooseDoc.setActionCommand(ACTION_SPECIAL_CHOOSE);
    wbuChooseDoc.addActionListener(this);
    wbuShowDoc.setActionCommand(ACTION_SPECIAL_SHOW);
    wbuShowDoc.addActionListener(this);
    wbuSaveDoc.setActionCommand(ACTION_SPECIAL_SAVE);
    wbuSaveDoc.addActionListener(this);

    wtfPartner = new WrapperTextField();
    wtfPartner.setColumnsMax(Facade.MAX_UNBESCHRAENKT);
    wtfPartner.setActivatable(false);
    wtfAnleger.setActivatable(false);
    wdfZeitpunkt.setActivatable(false);
    wtfBelegnummer.setActivatable(false);
    wtfTable.setActivatable(false);
    wtfRow.setActivatable(false);
    wtfFilename.setActivatable(false);
    wtfFilename.setColumnsMax(100);
    wtfMIME.setActivatable(false);
    wcbVersteckt.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            wtfSchlagworte.setMandatoryField(!wcbVersteckt.isSelected());
        }
    });

    if (bHatStufe0) {
        wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_NONE);
    }
    if (bHatStufe1) {
        wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_LOW);
    }
    if (bHatStufe2) {
        wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_MEDIUM);
    }
    if (bHatStufe3) {
        wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_HIGH);
    }
    if (bHatStufe99) {
        wcbSicherheitsstufe.addItem(JCRDocFac.SECURITY_ARCHIV);
    }

    wtfTable.setMandatoryField(true);
    wtfName.setMandatoryField(true);
    wtfName.setColumnsMax(200);
    wtfBelegnummer.setMandatoryField(true);
    wtfRow.setMandatoryField(true);
    wtfFilename.setMandatoryField(true);
    wtfMIME.setMandatoryField(true);
    wtfAnleger.setMandatoryField(true);
    wtfSchlagworte.setMandatoryField(true);
    wtfSchlagworte.setColumnsMax(300);
    wdfZeitpunkt.setMandatoryField(true);
    wtfPartner.setMandatoryField(true);

    treeView = new JScrollPane(tree);
    treeView.setMinimumSize(new Dimension(200, 10));
    treeView.setPreferredSize(new Dimension(200, 10));

    iZeile = 0;
    if (!bShowExitButton) {
        jpaWorkingOn.add(wtfSuche, new GridBagConstraints(0, iZeile, 1, 1, 0.2, 0.0, GridBagConstraints.WEST,
                GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
        jpaWorkingOn.add(wbuSuche, new GridBagConstraints(1, iZeile, 1, 1, 0.1, 0.0, GridBagConstraints.WEST,
                GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
        iZeile++;
    }
    jpaWorkingOn.add(wcbVersteckteAnzeigen, new GridBagConstraints(0, iZeile, 1, 1, 1, 0.0,
            GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    iZeile++;
    leftPane.add(treeView);

    jpaWorkingOn.add(splitPane, new GridBagConstraints(0, iZeile, 3, 1, 1.0, 1.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    iZeile = 0;
    rightPane.add(wlaName, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    rightPane.add(wtfName, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    rightPane.add(wlaTable, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfTable, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaSchlagworte, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfSchlagworte, new GridBagConstraints(1, iZeile, 6, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaZeitpunkt, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wdfZeitpunkt, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wlaSicherheitsstufe, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wcbSicherheitsstufe, new GridBagConstraints(5, iZeile, 1, 1, 1.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wcbVersteckt, new GridBagConstraints(6, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaBelegnummer, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfBelegnummer, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wlaRow, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfRow, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaFilename, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfFilename, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wlaMIME, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfMIME, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaBelegart, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wcbBelegart, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wlaGruppierung, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wcbGruppierung, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wbuPartner, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfPartner, new GridBagConstraints(1, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wlaAnleger, new GridBagConstraints(4, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wtfAnleger, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    iZeile++;

    rightPane.add(wbuChooseDoc, new GridBagConstraints(0, iZeile, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));

    rightPane.add(wbuShowDoc, new GridBagConstraints(3, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    rightPane.add(wbuSaveDoc, new GridBagConstraints(5, iZeile, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wlaVorschau, new GridBagConstraints(0, iZeile, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    iZeile++;
    rightPane.add(wmcMedia, new GridBagConstraints(0, iZeile, 7, 4, 1.0, 0.5, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    splitPane.setLeftComponent(treeView);
    splitPane.setRightComponent(rightLayered);
}

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

/**
 * Builds the panel hosting the user's details.
 * /* w  w w .  ja  v a2  s  .  c om*/
 * @return See above.
 */
private JPanel buildContentPanel() {
    ExperimenterData user = (ExperimenterData) model.getRefObject();
    boolean editable = model.isUserOwner(user);
    if (!editable)
        editable = MetadataViewerAgent.isAdministrator();
    details = EditorUtil.convertExperimenter(user);
    JPanel content = new JPanel();
    content.setBorder(BorderFactory.createTitledBorder("User"));
    content.setBackground(UIUtilities.BACKGROUND_COLOR);
    Entry<String, String> entry;
    Iterator<Entry<String, String>> i = details.entrySet().iterator();
    JComponent label;
    JTextField area;
    String key, value;
    content.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.WEST;
    c.insets = new Insets(0, 2, 2, 0);
    //Add log in name but cannot edit.
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = GridBagConstraints.REMAINDER;//end row
    c.fill = GridBagConstraints.HORIZONTAL;
    content.add(buildProfileCanvas(), c);
    c.gridy++;
    c.gridx = 0;
    label = EditorUtil.getLabel(EditorUtil.DISPLAY_NAME, true);
    label.setBackground(UIUtilities.BACKGROUND_COLOR);
    c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
    c.fill = GridBagConstraints.NONE;//reset to default
    c.weightx = 0.0;
    content.add(label, c);
    c.gridx++;
    content.add(Box.createHorizontalStrut(5), c);
    c.gridx++;
    c.gridwidth = GridBagConstraints.REMAINDER;//end row
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1.0;
    loginArea.setText(user.getUserName());
    loginArea.setEnabled(false);
    loginArea.setEditable(false);
    if (MetadataViewerAgent.isAdministrator() && !model.isSystemUser(user.getId()) && !model.isSelf()) {
        loginArea.setEnabled(true);
        loginArea.getDocument().addDocumentListener(this);
    }
    content.add(loginArea, c);
    while (i.hasNext()) {
        ++c.gridy;
        c.gridx = 0;
        entry = i.next();
        key = entry.getKey();
        value = entry.getValue();
        label = EditorUtil.getLabel(key, EditorUtil.FIRST_NAME.equals(key) || EditorUtil.LAST_NAME.equals(key));
        area = new JTextField(value);
        area.setBackground(UIUtilities.BACKGROUND_COLOR);
        area.setEditable(editable);
        area.setEnabled(editable);
        if (editable)
            area.getDocument().addDocumentListener(this);
        items.put(key, area);
        label.setBackground(UIUtilities.BACKGROUND_COLOR);
        c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
        c.fill = GridBagConstraints.NONE;//reset to default
        c.weightx = 0.0;
        content.add(label, c);
        c.gridx++;
        content.add(Box.createHorizontalStrut(5), c);
        c.gridx++;
        c.gridwidth = GridBagConstraints.REMAINDER;//end row
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        content.add(area, c);
    }
    c.gridx = 0;
    c.gridy++;
    label = EditorUtil.getLabel(EditorUtil.DEFAULT_GROUP, false);
    c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
    c.fill = GridBagConstraints.NONE;//reset to default
    c.weightx = 0.0;
    content.add(label, c);
    c.gridx++;
    content.add(Box.createHorizontalStrut(5), c);
    c.gridx++;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1.0;
    content.add(groupsBox, c);
    c.gridy++;
    content.add(permissionsPane, c);
    c.gridx = 0;
    c.gridy++;
    label = EditorUtil.getLabel(EditorUtil.GROUP_OWNER, false);
    c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
    c.fill = GridBagConstraints.NONE; //reset to default
    c.weightx = 0.0;
    content.add(label, c);
    c.gridx++;
    content.add(Box.createHorizontalStrut(5), c);
    c.gridx++;
    c.gridwidth = GridBagConstraints.REMAINDER; //end row
    c.fill = GridBagConstraints.NONE;
    c.weightx = 1.0;
    content.add(ownerBox, c);
    if (activeBox.isVisible()) {
        c.gridx = 0;
        c.gridy++;
        label = EditorUtil.getLabel(EditorUtil.ACTIVE, false);
        c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
        c.fill = GridBagConstraints.NONE;
        c.weightx = 0.0;
        content.add(label, c);
        c.gridx++;
        content.add(Box.createHorizontalStrut(5), c);
        c.gridx++;
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.fill = GridBagConstraints.NONE;
        c.weightx = 1.0;
        content.add(activeBox, c);
    }
    if (adminBox.isVisible()) {
        c.gridx = 0;
        c.gridy++;
        label = EditorUtil.getLabel(EditorUtil.ADMINISTRATOR, false);
        c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
        c.fill = GridBagConstraints.NONE;
        c.weightx = 0.0;
        content.add(label, c);
        c.gridx++;
        content.add(Box.createHorizontalStrut(5), c);
        c.gridx++;
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.fill = GridBagConstraints.NONE;
        c.weightx = 1.0;
        content.add(adminBox, c);
    }
    c.gridx = 0;
    c.gridy++;
    content.add(Box.createHorizontalStrut(10), c);
    c.gridy++;
    label = UIUtilities.setTextFont(EditorUtil.MANDATORY_DESCRIPTION, Font.ITALIC);
    label.setForeground(UIUtilities.REQUIRED_FIELDS_COLOR);
    c.weightx = 0.0;
    content.add(label, c);
    return content;
}

From source file:net.technicpack.launcher.ui.InstallerFrame.java

private void setupPortableMode(JPanel panel) {
    panel.setLayout(new GridBagLayout());

    JLabel portableSpiel = new JLabel("<html><body align=\"left\" style='margin-right:10px;'>"
            + resources.getString("launcher.installer.portablespiel") + "</body></html>");
    portableSpiel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    portableSpiel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    portableSpiel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    panel.add(portableSpiel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(9, 8, 9, 3), 0, 0));

    panel.add(Box.createGlue(), new GridBagConstraints(0, 1, 3, 1, 1.0, 0.7, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));

    JLabel installFolderLabel = new JLabel(resources.getString("launcher.installer.folder"));
    installFolderLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 18));
    installFolderLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(installFolderLabel, new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.WEST,
            GridBagConstraints.NONE, new Insets(0, 24, 0, 8), 0, 0));

    String installDir = "";
    if (settings.isPortable())
        installDir = settings.getTechnicRoot().getAbsolutePath();

    portableInstallDir = new JTextField(installDir);
    portableInstallDir.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 18));
    portableInstallDir.setForeground(LauncherFrame.COLOR_BLUE);
    portableInstallDir.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    portableInstallDir.setHighlighter(null);
    portableInstallDir.setEditable(false);
    portableInstallDir.setCursor(null);/*w  w  w .  j a v  a 2  s.c om*/
    portableInstallDir.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 8));
    panel.add(portableInstallDir, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 0));

    RoundedButton selectInstall = new RoundedButton(resources.getString("launcher.installer.select"));
    selectInstall.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 18));
    selectInstall.setContentAreaFilled(false);
    selectInstall.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    selectInstall.setHoverForeground(LauncherFrame.COLOR_BLUE);
    selectInstall.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            selectPortable();
        }
    });
    panel.add(selectInstall, new GridBagConstraints(2, 2, 1, 1, 0, 0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 5, 0, 16), 0, 0));

    panel.add(Box.createGlue(), new GridBagConstraints(0, 3, 3, 1, 1.0, 1.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));

    String defaultLocaleText = resources.getString("launcheroptions.language.default");
    if (!resources.isDefaultLocaleSupported()) {
        defaultLocaleText = defaultLocaleText
                .concat(" (" + resources.getString("launcheroptions.language.unavailable") + ")");
    }

    portableLanguages = new JComboBox();
    portableLanguages.addItem(new LanguageItem(ResourceLoader.DEFAULT_LOCALE, defaultLocaleText, resources));
    for (int i = 0; i < ResourceLoader.SUPPORTED_LOCALES.length; i++) {
        portableLanguages
                .addItem(new LanguageItem(resources.getCodeFromLocale(ResourceLoader.SUPPORTED_LOCALES[i]),
                        ResourceLoader.SUPPORTED_LOCALES[i].getDisplayName(ResourceLoader.SUPPORTED_LOCALES[i]),
                        resources.getVariant(ResourceLoader.SUPPORTED_LOCALES[i])));
    }
    if (!settings.getLanguageCode().equalsIgnoreCase(ResourceLoader.DEFAULT_LOCALE)) {
        Locale loc = resources.getLocaleFromCode(settings.getLanguageCode());

        for (int i = 0; i < ResourceLoader.SUPPORTED_LOCALES.length; i++) {
            if (loc.equals(ResourceLoader.SUPPORTED_LOCALES[i])) {
                portableLanguages.setSelectedIndex(i + 1);
                break;
            }
        }
    }
    portableLanguages.setBorder(new RoundBorder(LauncherFrame.COLOR_SCROLL_THUMB, 1, 10));
    portableLanguages.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 14));
    portableLanguages.setUI(new LanguageCellUI(resources));
    portableLanguages.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    portableLanguages.setBackground(LauncherFrame.COLOR_SELECTOR_BACK);
    portableLanguages.setRenderer(new LanguageCellRenderer(resources, "globe.png",
            LauncherFrame.COLOR_SELECTOR_BACK, LauncherFrame.COLOR_WHITE_TEXT));
    portableLanguages.setEditable(false);
    portableLanguages.setFocusable(false);
    portableLanguages.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            portableLanguageChanged();
        }
    });
    panel.add(portableLanguages, new GridBagConstraints(0, 4, 1, 0, 0, 0, GridBagConstraints.SOUTHWEST,
            GridBagConstraints.NONE, new Insets(0, 8, 8, 0), 0, 0));

    portableInstallButton = new RoundedButton(resources.getString("launcher.installer.install"));
    portableInstallButton.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 18));
    portableInstallButton.setContentAreaFilled(false);
    portableInstallButton.setForeground(LauncherFrame.COLOR_GREY_TEXT);
    portableInstallButton.setHoverForeground(LauncherFrame.COLOR_BLUE);
    portableInstallButton.setBorder(BorderFactory.createEmptyBorder(8, 56, 8, 56));
    portableInstallButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            portableInstall();
        }
    });
    portableInstallButton.setEnabled(false);

    if (!installDir.equals("")) {
        portableInstallButton.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
        portableInstallButton.setEnabled(true);
    }

    panel.add(portableInstallButton, new GridBagConstraints(1, 4, 2, 1, 0, 0, GridBagConstraints.EAST,
            GridBagConstraints.VERTICAL, new Insets(0, 0, 8, 8), 0, 0));
}

From source file:pcgen.gui2.tabs.SummaryInfoTab.java

private void addGridBagLayer(JPanel panel, Font font, Insets insets, String text, JComponent comp) {
    GridBagConstraints gbc = new GridBagConstraints();
    JLabel label = new JLabel(LanguageBundle.getString(text));
    label.setFont(font);/*w  ww  .j  a v  a 2 s.  c  om*/
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridwidth = 2;
    panel.add(label, gbc);

    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.fill = GridBagConstraints.BOTH;
    if (insets != null) {
        gbc.insets = insets;
    }
    panel.add(comp, gbc);
}

From source file:com.sec.ose.osi.ui.frm.main.identification.codematch.JPanCodeMatchMain.java

/**
 * This method initializes jPanel2   /*from  w  w  w  . j  a v  a 2  s .com*/
 *    
 * @return javax.swing.JPanel   
 */
private JPanel getJPanelViewBtn() {
    if (jPanelViewBtn == null) {
        GridBagConstraints gridBagConstraints18 = new GridBagConstraints();
        gridBagConstraints18.gridx = 1;
        gridBagConstraints18.anchor = GridBagConstraints.EAST;
        gridBagConstraints18.fill = GridBagConstraints.NONE;
        gridBagConstraints18.insets = new Insets(0, 0, 10, 10);
        gridBagConstraints18.weightx = 1.0;
        GridBagConstraints gridBagConstraints16 = new GridBagConstraints();
        gridBagConstraints16.gridx = 0;
        gridBagConstraints16.weightx = 1.0;
        gridBagConstraints16.anchor = GridBagConstraints.WEST;
        gridBagConstraints16.insets = new Insets(0, 10, 0, 0);
        gridBagConstraints16.gridy = 0;
        jLabelStringSearchIdentifyInfo = new JLabel();
        jLabelStringSearchIdentifyInfo
                .setText("This file is identified as (StringSearchLicense) by String Search");
        jPanelViewBtn = new JPanel();
        jPanelViewBtn.setLayout(new GridBagLayout());
        jPanelViewBtn.add(getJButtonView(), gridBagConstraints18);
        jPanelViewBtn.add(jLabelStringSearchIdentifyInfo, gridBagConstraints16);
    }
    return jPanelViewBtn;
}

From source file:org.freeplane.view.swing.features.time.mindmapmode.nodelist.NodeList.java

public void startup() {
    if (dialog != null) {
        dialog.toFront();//from w w  w . ja v  a 2s  .co  m
        return;
    }
    NodeList.COLUMN_MODIFIED = TextUtils.getText(PLUGINS_TIME_LIST_XML_MODIFIED);
    NodeList.COLUMN_CREATED = TextUtils.getText(PLUGINS_TIME_LIST_XML_CREATED);
    NodeList.COLUMN_ICONS = TextUtils.getText(PLUGINS_TIME_LIST_XML_ICONS);
    NodeList.COLUMN_TEXT = TextUtils.getText(PLUGINS_TIME_LIST_XML_TEXT);
    NodeList.COLUMN_DETAILS = TextUtils.getText(PLUGINS_TIME_LIST_XML_DETAILS);
    NodeList.COLUMN_DATE = TextUtils.getText(PLUGINS_TIME_LIST_XML_DATE);
    NodeList.COLUMN_NOTES = TextUtils.getText(PLUGINS_TIME_LIST_XML_NOTES);
    dialog = new JDialog(Controller.getCurrentController().getViewController().getFrame(), modal /* modal */);
    String windowTitle;
    if (showAllNodes) {
        windowTitle = PLUGINS_TIME_MANAGEMENT_XML_WINDOW_TITLE_ALL_NODES;
    } else {
        windowTitle = PLUGINS_TIME_MANAGEMENT_XML_WINDOW_TITLE;
    }
    dialog.setTitle(TextUtils.getText(windowTitle));
    dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    final WindowAdapter windowListener = new WindowAdapter() {

        @Override
        public void windowGainedFocus(WindowEvent e) {
            mFilterTextSearchField.getEditor().selectAll();
        }

        @Override
        public void windowClosing(final WindowEvent event) {
            disposeDialog();
        }
    };
    dialog.addWindowListener(windowListener);
    dialog.addWindowFocusListener(windowListener);
    UITools.addEscapeActionToDialog(dialog, new AbstractAction() {
        /**
         *
         */
        private static final long serialVersionUID = 1L;

        public void actionPerformed(final ActionEvent arg0) {
            disposeDialog();
        }
    });
    final Container contentPane = dialog.getContentPane();
    final GridBagLayout gbl = new GridBagLayout();
    contentPane.setLayout(gbl);
    final GridBagConstraints layoutConstraints = new GridBagConstraints();
    layoutConstraints.gridx = 0;
    layoutConstraints.gridy = 0;
    layoutConstraints.gridwidth = 1;
    layoutConstraints.gridheight = 1;
    layoutConstraints.weightx = 0.0;
    layoutConstraints.weighty = 0.0;
    layoutConstraints.anchor = GridBagConstraints.WEST;
    layoutConstraints.fill = GridBagConstraints.HORIZONTAL;
    contentPane.add(new JLabel(TextUtils.getText(PLUGINS_TIME_MANAGEMENT_XML_FIND)), layoutConstraints);
    layoutConstraints.gridwidth = 1;
    layoutConstraints.gridx++;
    contentPane.add(Box.createHorizontalStrut(40), layoutConstraints);
    layoutConstraints.gridx++;
    contentPane.add(new JLabel(TextUtils.getText("filter_match_case")), layoutConstraints);
    layoutConstraints.gridx++;
    contentPane.add(matchCase, layoutConstraints);
    layoutConstraints.gridx++;
    contentPane.add(Box.createHorizontalStrut(40), layoutConstraints);
    layoutConstraints.gridx++;
    contentPane.add(new JLabel(TextUtils.getText("regular_expressions")), layoutConstraints);
    layoutConstraints.gridx++;
    contentPane.add(useRegexInFind, layoutConstraints);
    layoutConstraints.gridx = 0;
    layoutConstraints.weightx = 1.0;
    layoutConstraints.gridwidth = GridBagConstraints.REMAINDER;
    layoutConstraints.gridy++;
    contentPane.add(/* new JScrollPane */(mFilterTextSearchField), layoutConstraints);
    layoutConstraints.gridy++;
    layoutConstraints.weightx = 0.0;
    layoutConstraints.gridwidth = 1;
    contentPane.add(new JLabel(TextUtils.getText(PLUGINS_TIME_MANAGEMENT_XML_REPLACE)), layoutConstraints);
    layoutConstraints.gridx = 5;
    contentPane.add(new JLabel(TextUtils.getText("regular_expressions")), layoutConstraints);
    layoutConstraints.gridx++;
    contentPane.add(useRegexInReplace, layoutConstraints);
    layoutConstraints.gridx = 0;
    layoutConstraints.weightx = 1.0;
    layoutConstraints.gridwidth = GridBagConstraints.REMAINDER;
    layoutConstraints.gridy++;
    contentPane.add(/* new JScrollPane */(mFilterTextReplaceField), layoutConstraints);
    dateRenderer = new DateRenderer();
    textRenderer = new TextRenderer();
    iconsRenderer = new IconsRenderer();
    tableView = new FlatNodeTable();
    tableView.addKeyListener(new FlatNodeTableKeyListener());
    tableView.addMouseListener(new FlatNodeTableMouseAdapter());
    tableView.getTableHeader().setReorderingAllowed(false);
    tableModel = updateModel();
    mFlatNodeTableFilterModel = new FlatNodeTableFilterModel(tableModel,
            new int[] { NodeList.NODE_TEXT_COLUMN, NodeList.NODE_DETAILS_COLUMN, NodeList.NODE_NOTES_COLUMN });
    sorter = new TableSorter(mFlatNodeTableFilterModel);
    tableView.setModel(sorter);
    sorter.setTableHeader(tableView.getTableHeader());
    sorter.setColumnComparator(Date.class, TableSorter.COMPARABLE_COMPARATOR);
    sorter.setColumnComparator(NodeModel.class, TableSorter.LEXICAL_COMPARATOR);
    sorter.setColumnComparator(IconsHolder.class, TableSorter.COMPARABLE_COMPARATOR);
    sorter.setSortingStatus(NodeList.DATE_COLUMN, TableSorter.ASCENDING);
    final JScrollPane pane = new JScrollPane(tableView);
    UITools.setScrollbarIncrement(pane);
    layoutConstraints.gridy++;
    GridBagConstraints tableConstraints = (GridBagConstraints) layoutConstraints.clone();
    tableConstraints.weightx = 1;
    tableConstraints.weighty = 10;
    tableConstraints.fill = GridBagConstraints.BOTH;
    contentPane.add(pane, tableConstraints);
    mTreeLabel = new JLabel();
    layoutConstraints.gridy++;
    GridBagConstraints treeConstraints = (GridBagConstraints) layoutConstraints.clone();
    treeConstraints.fill = GridBagConstraints.BOTH;
    @SuppressWarnings("serial")
    JScrollPane scrollPane = new JScrollPane(mTreeLabel) {
        @Override
        public boolean isValidateRoot() {
            return false;
        }
    };
    contentPane.add(scrollPane, treeConstraints);
    final AbstractAction exportAction = new AbstractAction(
            TextUtils.getText("plugins/TimeManagement.xml_Export")) {
        /**
             *
             */
        private static final long serialVersionUID = 1L;

        public void actionPerformed(final ActionEvent arg0) {
            exportSelectedRowsAndClose();
        }
    };
    final JButton exportButton = new JButton(exportAction);
    final AbstractAction replaceAllAction = new AbstractAction(
            TextUtils.getText("plugins/TimeManagement.xml_Replace_All")) {
        /**
             *
             */
        private static final long serialVersionUID = 1L;

        public void actionPerformed(final ActionEvent arg0) {
            replace(new HolderAccessor(false));
        }
    };
    final JButton replaceAllButton = new JButton(replaceAllAction);
    final AbstractAction replaceSelectedAction = new AbstractAction(
            TextUtils.getText("plugins/TimeManagement.xml_Replace_Selected")) {
        /**
             *
             */
        private static final long serialVersionUID = 1L;

        public void actionPerformed(final ActionEvent arg0) {
            replace(new HolderAccessor(true));
        }
    };
    final JButton replaceSelectedButton = new JButton(replaceSelectedAction);
    final AbstractAction gotoAction = new AbstractAction(TextUtils.getText("plugins/TimeManagement.xml_Goto")) {
        /**
             *
             */
        private static final long serialVersionUID = 1L;

        public void actionPerformed(final ActionEvent arg0) {
            selectSelectedRows();
        }
    };
    final JButton gotoButton = new JButton(gotoAction);
    final AbstractAction disposeAction = new AbstractAction(
            TextUtils.getText(PLUGINS_TIME_MANAGEMENT_XML_CLOSE)) {
        /**
             *
             */
        private static final long serialVersionUID = 1L;

        public void actionPerformed(final ActionEvent arg0) {
            disposeDialog();
        }
    };
    final JButton cancelButton = new JButton(disposeAction);
    /* Initial State */
    gotoAction.setEnabled(false);
    exportAction.setEnabled(false);
    replaceSelectedAction.setEnabled(false);
    final Box bar = Box.createHorizontalBox();
    bar.add(Box.createHorizontalGlue());
    bar.add(cancelButton);
    bar.add(exportButton);
    bar.add(replaceAllButton);
    bar.add(replaceSelectedButton);
    bar.add(gotoButton);
    bar.add(Box.createHorizontalGlue());
    layoutConstraints.gridy++;
    contentPane.add(/* new JScrollPane */(bar), layoutConstraints);
    final JMenuBar menuBar = new JMenuBar();
    final JMenu menu = new JMenu(TextUtils.getText("plugins/TimeManagement.xml_menu_actions"));
    final AbstractAction[] actionList = new AbstractAction[] { gotoAction, replaceSelectedAction,
            replaceAllAction, exportAction, disposeAction };
    for (int i = 0; i < actionList.length; i++) {
        final AbstractAction action = actionList[i];
        final JMenuItem item = menu.add(action);
        item.setIcon(new BlindIcon(UIBuilder.ICON_SIZE));
    }
    menuBar.add(menu);
    dialog.setJMenuBar(menuBar);
    final ListSelectionModel rowSM = tableView.getSelectionModel();
    rowSM.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(final ListSelectionEvent e) {
            if (e.getValueIsAdjusting()) {
                return;
            }
            final ListSelectionModel lsm = (ListSelectionModel) e.getSource();
            final boolean enable = !(lsm.isSelectionEmpty());
            replaceSelectedAction.setEnabled(enable);
            gotoAction.setEnabled(enable);
            exportAction.setEnabled(enable);
        }
    });
    rowSM.addListSelectionListener(new ListSelectionListener() {
        String getNodeText(final NodeModel node) {
            return TextController.getController().getShortText(node)
                    + ((node.isRoot()) ? "" : (" <- " + getNodeText(node.getParentNode())));
        }

        public void valueChanged(final ListSelectionEvent e) {
            if (e.getValueIsAdjusting()) {
                return;
            }
            final ListSelectionModel lsm = (ListSelectionModel) e.getSource();
            if (lsm.isSelectionEmpty()) {
                mTreeLabel.setText("");
                return;
            }
            final int selectedRow = lsm.getLeadSelectionIndex();
            final NodeModel mindMapNode = getMindMapNode(selectedRow);
            mTreeLabel.setText(getNodeText(mindMapNode));
        }
    });
    final String marshalled = ResourceController.getResourceController()
            .getProperty(NodeList.WINDOW_PREFERENCE_STORAGE_PROPERTY);
    final WindowConfigurationStorage result = TimeWindowConfigurationStorage.decorateDialog(marshalled, dialog);
    final WindowConfigurationStorage storage = result;
    if (storage != null) {
        tableView.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        int column = 0;
        for (final TimeWindowColumnSetting setting : ((TimeWindowConfigurationStorage) storage)
                .getListTimeWindowColumnSettingList()) {
            tableView.getColumnModel().getColumn(column).setPreferredWidth(setting.getColumnWidth());
            sorter.setSortingStatus(column, setting.getColumnSorting());
            column++;
        }
    }
    mFlatNodeTableFilterModel.setFilter((String) mFilterTextSearchField.getSelectedItem(),
            matchCase.isSelected(), useRegexInFind.isSelected());
    dialog.setVisible(true);
}

From source file:de.tor.tribes.ui.views.DSWorkbenchConquersFrame.java

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

    jConquersPanel = new javax.swing.JPanel();
    jConquerTablePanel = new org.jdesktop.swingx.JXPanel();
    infoPanel = new org.jdesktop.swingx.JXCollapsiblePane();
    jXLabel1 = new org.jdesktop.swingx.JXLabel();
    jScrollPane4 = new javax.swing.JScrollPane();
    jXPanel2 = new org.jdesktop.swingx.JXPanel();
    jSeparator1 = new javax.swing.JSeparator();
    jLastUpdateLabel = new javax.swing.JLabel();
    jGreyConquersLabel = new javax.swing.JLabel();
    jFriendlyConquersLabel = new javax.swing.JLabel();
    jSelfConquersLabel = new javax.swing.JLabel();
    jxFilterPane = new org.jdesktop.swingx.JXPanel();
    jXPanel3 = new org.jdesktop.swingx.JXPanel();
    jButton12 = new javax.swing.JButton();
    jTextField1 = new javax.swing.JTextField();
    jLabel21 = new javax.swing.JLabel();
    jFilterRows = new javax.swing.JCheckBox();
    jFilterCaseSensitive = new javax.swing.JCheckBox();
    jScrollPane1 = new javax.swing.JScrollPane();
    jXColumnList = new org.jdesktop.swingx.JXList();
    jLabel22 = new javax.swing.JLabel();
    jConquersFrameAlwaysOnTop = new javax.swing.JCheckBox();
    jConquerPanel = new org.jdesktop.swingx.JXPanel();
    capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel();

    jConquersPanel.setBackground(new java.awt.Color(239, 235, 223));
    jConquersPanel.setLayout(new java.awt.BorderLayout());

    jConquerTablePanel.setLayout(new java.awt.BorderLayout());

    infoPanel.setCollapsed(true);
    infoPanel.setInheritAlpha(false);

    jXLabel1.setText("Keine Meldung");
    jXLabel1.setOpaque(true);
    jXLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            fireHideInfoEvent(evt);
        }
    });
    infoPanel.add(jXLabel1, java.awt.BorderLayout.CENTER);

    jConquerTablePanel.add(infoPanel, java.awt.BorderLayout.SOUTH);

    jConquersTable
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    jScrollPane4.setViewportView(jConquersTable);

    jConquerTablePanel.add(jScrollPane4, java.awt.BorderLayout.CENTER);

    jConquersPanel.add(jConquerTablePanel, java.awt.BorderLayout.CENTER);

    jXPanel2.setOpaque(false);
    jXPanel2.setLayout(new java.awt.GridBagLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(10, 0, 10, 0);
    jXPanel2.add(jSeparator1, gridBagConstraints);

    jLastUpdateLabel.setText("Letzte Aktualisierung:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5);
    jXPanel2.add(jLastUpdateLabel, gridBagConstraints);

    jGreyConquersLabel.setBackground(new java.awt.Color(255, 204, 204));
    jGreyConquersLabel.setText("Grau-Adelungen:");
    jGreyConquersLabel.setOpaque(true);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5);
    jXPanel2.add(jGreyConquersLabel, gridBagConstraints);

    jFriendlyConquersLabel.setBackground(new java.awt.Color(0, 255, 255));
    jFriendlyConquersLabel.setText("Aufadelungen:");
    jFriendlyConquersLabel.setOpaque(true);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5);
    jXPanel2.add(jFriendlyConquersLabel, gridBagConstraints);

    jSelfConquersLabel.setBackground(new java.awt.Color(213, 255, 128));
    jSelfConquersLabel.setText("Selbstadelungen:");
    jSelfConquersLabel.setOpaque(true);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5);
    jXPanel2.add(jSelfConquersLabel, gridBagConstraints);

    jConquersPanel.add(jXPanel2, java.awt.BorderLayout.SOUTH);

    jxFilterPane.setOpaque(false);
    jxFilterPane.setLayout(new java.awt.GridBagLayout());

    jXPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jXPanel3.setInheritAlpha(false);

    jButton12.setText("Anwenden");
    jButton12.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            jButton12fireHideGlassPaneEvent(evt);
        }
    });

    jTextField1.addCaretListener(new javax.swing.event.CaretListener() {
        public void caretUpdate(javax.swing.event.CaretEvent evt) {
            jTextField1fireHighlightEvent(evt);
        }
    });

    jLabel21.setText("Suchbegriff");

    jFilterRows.setText("Nur gefilterte Zeilen anzeigen");
    jFilterRows.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            jFilterRowsfireUpdateFilterEvent(evt);
        }
    });

    jFilterCaseSensitive.setText("Gro-/Kleinschreibung beachten");
    jFilterCaseSensitive.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            jFilterCaseSensitivefireUpdateFilterEvent(evt);
        }
    });

    jXColumnList.setModel(new javax.swing.AbstractListModel() {
        String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };

        public int getSize() {
            return strings.length;
        }

        public Object getElementAt(int i) {
            return strings[i];
        }
    });
    jXColumnList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jScrollPane1.setViewportView(jXColumnList);

    jLabel22.setText("Spalten");

    javax.swing.GroupLayout jXPanel3Layout = new javax.swing.GroupLayout(jXPanel3);
    jXPanel3.setLayout(jXPanel3Layout);
    jXPanel3Layout
            .setHorizontalGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            jXPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel3Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(
                                            jLabel21, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGap(18, 18, 18)
                                    .addGroup(jXPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jXPanel3Layout.createSequentialGroup()
                                                    .addComponent(jScrollPane1,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 158,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(18, 18, 18)
                                                    .addGroup(jXPanel3Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addGroup(jXPanel3Layout.createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                                    false)
                                                                    .addComponent(jFilterRows,
                                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            Short.MAX_VALUE)
                                                                    .addComponent(jFilterCaseSensitive,
                                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            Short.MAX_VALUE))
                                                            .addComponent(jButton12)))
                                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    355, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jXPanel3Layout.setVerticalGroup(jXPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel3Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel21)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jXPanel3Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jXPanel3Layout
                                            .createSequentialGroup().addComponent(jFilterCaseSensitive)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jFilterRows)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jButton12))
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 164,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel22))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jxFilterPane.add(jXPanel3, new java.awt.GridBagConstraints());

    setTitle("Eroberungen");
    getContentPane().setLayout(new java.awt.GridBagLayout());

    jConquersFrameAlwaysOnTop.setText("Immer im Vordergrund");
    jConquersFrameAlwaysOnTop.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            fireConquersFrameAlwaysOnTopEvent(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    getContentPane().add(jConquersFrameAlwaysOnTop, gridBagConstraints);

    jConquerPanel.setBackground(new java.awt.Color(239, 235, 223));
    jConquerPanel.setLayout(new java.awt.BorderLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipadx = 661;
    gridBagConstraints.ipady = 354;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    getContentPane().add(jConquerPanel, gridBagConstraints);

    capabilityInfoPanel1.setBbSupport(false);
    capabilityInfoPanel1.setCopyable(false);
    capabilityInfoPanel1.setDeletable(false);
    capabilityInfoPanel1.setPastable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    getContentPane().add(capabilityInfoPanel1, gridBagConstraints);

    pack();
}