Search in sources :

Example 1 with WidestStringComboBoxModel

use of org.cytoscape.filter.internal.filters.util.WidestStringComboBoxModel in project cytoscape-impl by cytoscape.

the class FilterMainPanel method initComponents.

/**
 * 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.
 */
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
    GridBagConstraints gridBagConstraints;
    pnlCurrentFilter = new JPanel();
    cmbFilters = new JComboBox();
    cmbFilters.addPopupMenuListener(new WidestStringComboBoxPopupMenuListener());
    // optionButton = new javax.swing.JButton();
    pnlFilterDefinition = new JPanel();
    WidestStringComboBoxModel wscbm = new AttributeSelectWidestStringComboBoxModel();
    cmbAttributes = new JComboBox(wscbm);
    cmbAttributes.addPopupMenuListener(new WidestStringComboBoxPopupMenuListener());
    btnAddFilterWidget = new JButton();
    lbAttribute = new JLabel();
    lbPlaceHolder = new JLabel();
    pnlButton = new JPanel();
    btnApplyFilter = new JButton();
    lbPlaceHolder_pnlFilterDefinition = new JLabel();
    pnlFeedBack = new JPanel();
    tblFeedBack = new JTable();
    btnSelectAll = new JButton();
    btnDeSelect = new JButton();
    pnlScroll = new JScrollPane();
    setLayout(new GridBagLayout());
    pnlCurrentFilter.setLayout(new GridBagLayout());
    pnlCurrentFilter.setBorder(BorderFactory.createTitledBorder("Current Filter"));
    // cmbFilters.setModel(new DefaultComboBoxModel(new String[] { "My First filter", "My second Filter" }));
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    gridBagConstraints.weightx = 0.5;
    gridBagConstraints.insets = new Insets(5, 10, 5, 10);
    pnlCurrentFilter.add(cmbFilters, gridBagConstraints);
    optionButton.setText("Option");
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.insets = new Insets(0, 0, 0, 5);
    pnlCurrentFilter.add(optionButton, gridBagConstraints);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.ipady = 4;
    gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    add(pnlCurrentFilter, gridBagConstraints);
    pnlFilterDefinition.setLayout(new GridBagLayout());
    pnlFilterDefinition.setBorder(BorderFactory.createTitledBorder("Filter Definition"));
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new Insets(10, 10, 0, 10);
    pnlFilterDefinition.add(cmbAttributes, gridBagConstraints);
    btnAddFilterWidget.setText("Add");
    btnAddFilterWidget.setEnabled(false);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = new Insets(10, 0, 0, 5);
    pnlFilterDefinition.add(btnAddFilterWidget, gridBagConstraints);
    lbAttribute.setText("Column/Filter");
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(10, 5, 0, 0);
    pnlFilterDefinition.add(lbAttribute, gridBagConstraints);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlFilterDefinition.add(lbPlaceHolder, gridBagConstraints);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(pnlFilterDefinition, gridBagConstraints);
    // /
    pnlButton.setLayout(new FlowLayout());
    btnApplyFilter.setText("Apply Filter");
    pnlButton.add(btnApplyFilter);
    btnSelectAll.setText("Select All");
    pnlButton.add(btnSelectAll);
    btnDeSelect.setText("Deselect All");
    pnlButton.add(btnDeSelect);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new Insets(10, 0, 10, 0);
    add(pnlButton, gridBagConstraints);
    // lbPlaceHolder_pnlFilterDefinition.setText("jLabel1");
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(lbPlaceHolder_pnlFilterDefinition, gridBagConstraints);
    // feedback panel
    pnlFeedBack.setLayout(new GridBagLayout());
    pnlFeedBack.setBorder(BorderFactory.createTitledBorder(""));
    pnlFeedBack.setMinimumSize(new Dimension(pnlFeedBack.getWidth(), 55));
    // pnlFeedBack.setMinimumSize(new java.awt.Dimension(300,52));
    pnlScroll.setViewportView(tblFeedBack);
    pnlScroll.setBorder(BorderFactory.createEmptyBorder());
    // tblFeedBack.setAutoCreateColumnsFromModel(true);
    // tblFeedBack.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    tblFeedBack.setEnabled(false);
    tblFeedBack.setFocusable(false);
    tblFeedBack.setBorder(BorderFactory.createEmptyBorder());
    // tblFeedBack.setRequestFocusEnabled(false);
    // tblFeedBack.setRowSelectionAllowed(false);
    // tblFeedBack.setTableHeader(null);
    gridBagConstraints = new GridBagConstraints();
    // .HORIZONTAL;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    // gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 1);
    pnlFeedBack.add(pnlScroll, gridBagConstraints);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new Insets(1, 1, 2, 1);
    add(pnlFeedBack, gridBagConstraints);
    // Set customized renderer for attributes/filter combobox
    cmbAttributes.setRenderer(new AttributeFilterRenderer());
// initCMBFilters();
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) FlowLayout(java.awt.FlowLayout) JComboBox(javax.swing.JComboBox) WidestStringComboBoxModel(org.cytoscape.filter.internal.filters.util.WidestStringComboBoxModel) GridBagLayout(java.awt.GridBagLayout) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JTable(javax.swing.JTable) WidestStringComboBoxPopupMenuListener(org.cytoscape.filter.internal.filters.util.WidestStringComboBoxPopupMenuListener)

Aggregations

Dimension (java.awt.Dimension)1 FlowLayout (java.awt.FlowLayout)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 JButton (javax.swing.JButton)1 JComboBox (javax.swing.JComboBox)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 JTable (javax.swing.JTable)1 WidestStringComboBoxModel (org.cytoscape.filter.internal.filters.util.WidestStringComboBoxModel)1 WidestStringComboBoxPopupMenuListener (org.cytoscape.filter.internal.filters.util.WidestStringComboBoxPopupMenuListener)1