Search in sources :

Example 56 with JCheckBox

use of javax.swing.JCheckBox in project EnrichmentMapApp by BaderLab.

the class HeatMapMainPanel method createToolbarPanel.

private JPanel createToolbarPanel() {
    gradientLegendPanel = new GradientLegendPanel(table);
    showValuesCheck = new JCheckBox("Show Values");
    JLabel operatorLabel = new JLabel("Genes:");
    operatorCombo = new JComboBox<>();
    JLabel normLabel = new JLabel("Expressions:");
    normCombo = new JComboBox<>();
    SwingUtil.makeSmall(operatorLabel, operatorCombo, normLabel, normCombo, showValuesCheck);
    operatorCombo.addItem(new ComboItem<>(Operator.UNION, "Union"));
    operatorCombo.addItem(new ComboItem<>(Operator.INTERSECTION, "Intersection"));
    operatorCombo.setSelectedItem(ComboItem.of(Operator.UNION));
    normCombo.addItem(new ComboItem<>(Transform.AS_IS, "Expression Values"));
    normCombo.addItem(new ComboItem<>(Transform.ROW_NORMALIZE, "Row Normalize"));
    normCombo.addItem(new ComboItem<>(Transform.LOG_TRANSFORM, "Log Transform"));
    normCombo.addItem(new ComboItem<>(Transform.COMPRESS_MEDIAN, "Compress (Median)"));
    normCombo.addItem(new ComboItem<>(Transform.COMPRESS_MIN, "Compress (Min)"));
    normCombo.addItem(new ComboItem<>(Transform.COMPRESS_MAX, "Compress (Max)"));
    normCombo.setSelectedItem(ComboItem.of(Transform.COMPRESS_MEDIAN));
    operatorCombo.addActionListener(operatorActionListener = e -> updateSetting_Operator(getOperator()));
    normCombo.addActionListener(normActionListener = e -> updateSetting_Transform(getTransform()));
    showValuesCheck.addActionListener(showValueActionListener = e -> updateSetting_ShowValues(isShowValues()));
    JButton plusButton = SwingUtil.createIconButton(iconManager, IconManager.ICON_PLUS, "Add Rankings...");
    JButton gearButton = SwingUtil.createIconButton(iconManager, IconManager.ICON_GEAR, "Settings");
    JButton menuButton = SwingUtil.createIconButton(iconManager, IconManager.ICON_EXTERNAL_LINK, "Export");
    LookAndFeelUtil.equalizeSize(gearButton, menuButton);
    plusButton.addActionListener(e -> addRankings());
    gearButton.addActionListener(e -> settingsPanel.popup(gearButton));
    menuButton.addActionListener(this::showExportMenu);
    JPanel panel = new JPanel();
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateContainerGaps(false);
    layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
    layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(gradientLegendPanel, 180, 180, 180).addGap(0, 0, Short.MAX_VALUE).addComponent(operatorLabel).addComponent(operatorCombo, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addGap(5).addComponent(normLabel).addComponent(normCombo, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addGap(5).addComponent(showValuesCheck).addGap(5).addComponent(plusButton).addComponent(gearButton).addComponent(menuButton));
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(gradientLegendPanel).addComponent(operatorLabel).addComponent(operatorCombo).addComponent(normLabel).addComponent(normCombo).addComponent(showValuesCheck).addComponent(plusButton).addComponent(gearButton).addComponent(menuButton));
    panel.setOpaque(false);
    return panel;
}
Also used : JCheckBox(javax.swing.JCheckBox) Arrays(java.util.Arrays) Inject(com.google.inject.Inject) AfterInjection(org.baderlab.csplugins.enrichmentmap.AfterInjection) HeatMapTableModel(org.baderlab.csplugins.enrichmentmap.view.heatmap.table.HeatMapTableModel) Operator(org.baderlab.csplugins.enrichmentmap.view.heatmap.HeatMapParams.Operator) JTableHeader(javax.swing.table.JTableHeader) TableCellRenderer(javax.swing.table.TableCellRenderer) IconManager(org.cytoscape.util.swing.IconManager) Assisted(com.google.inject.assistedinject.Assisted) ComboItem(org.baderlab.csplugins.enrichmentmap.view.util.ComboItem) Map(java.util.Map) BorderLayout(java.awt.BorderLayout) JComboBox(javax.swing.JComboBox) DEFAULT_SIZE(javax.swing.GroupLayout.DEFAULT_SIZE) Set(java.util.Set) ColorAndValueRenderer(org.baderlab.csplugins.enrichmentmap.view.heatmap.table.ColorAndValueRenderer) Distance(org.baderlab.csplugins.enrichmentmap.view.heatmap.HeatMapParams.Distance) Component(java.awt.Component) Collectors(java.util.stream.Collectors) TableRowSorter(javax.swing.table.TableRowSorter) Sets(com.google.common.collect.Sets) PREFERRED_SIZE(javax.swing.GroupLayout.PREFERRED_SIZE) List(java.util.List) Alignment(javax.swing.GroupLayout.Alignment) EMDataSet(org.baderlab.csplugins.enrichmentmap.model.EMDataSet) LookAndFeelUtil(org.cytoscape.util.swing.LookAndFeelUtil) SwingUtil(org.baderlab.csplugins.enrichmentmap.view.util.SwingUtil) ColumnHeaderRankOptionRenderer(org.baderlab.csplugins.enrichmentmap.view.heatmap.table.ColumnHeaderRankOptionRenderer) JCheckBox(javax.swing.JCheckBox) Optional(java.util.Optional) JTable(javax.swing.JTable) ColumnHeaderVerticalRenderer(org.baderlab.csplugins.enrichmentmap.view.heatmap.table.ColumnHeaderVerticalRenderer) RankValue(org.baderlab.csplugins.enrichmentmap.view.heatmap.table.RankValue) JPanel(javax.swing.JPanel) ListSelectionModel(javax.swing.ListSelectionModel) ActionListener(java.awt.event.ActionListener) TableColumnModel(javax.swing.table.TableColumnModel) SortKey(javax.swing.RowSorter.SortKey) EnrichmentMap(org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap) CompletableFuture(java.util.concurrent.CompletableFuture) GradientLegendPanel(org.baderlab.csplugins.enrichmentmap.view.heatmap.table.GradientLegendPanel) ArrayList(java.util.ArrayList) SwingUtilities(javax.swing.SwingUtilities) EMStyleBuilder(org.baderlab.csplugins.enrichmentmap.style.EMStyleBuilder) JButton(javax.swing.JButton) Transform(org.baderlab.csplugins.enrichmentmap.view.heatmap.HeatMapParams.Transform) TableColumn(javax.swing.table.TableColumn) JPopupMenu(javax.swing.JPopupMenu) ActionEvent(java.awt.event.ActionEvent) RankOptionErrorHeader(org.baderlab.csplugins.enrichmentmap.view.heatmap.table.RankOptionErrorHeader) RankValueRenderer(org.baderlab.csplugins.enrichmentmap.view.heatmap.table.RankValueRenderer) JScrollPane(javax.swing.JScrollPane) JLabel(javax.swing.JLabel) GroupLayout(javax.swing.GroupLayout) ColorRenderer(org.baderlab.csplugins.enrichmentmap.view.heatmap.table.ColorRenderer) Comparator(java.util.Comparator) JPanel(javax.swing.JPanel) GradientLegendPanel(org.baderlab.csplugins.enrichmentmap.view.heatmap.table.GradientLegendPanel) JButton(javax.swing.JButton) GroupLayout(javax.swing.GroupLayout) JLabel(javax.swing.JLabel)

Example 57 with JCheckBox

use of javax.swing.JCheckBox in project EnrichmentMapApp by BaderLab.

the class DataSetSelector method updateTable.

private void updateTable() {
    final Object[][] data = new Object[items.size()][HEARDER_NAMES.length];
    int i = 0;
    for (AbstractDataSet ds : items) {
        data[i][SELECTED_COL_IDX] = checkedItems.get(ds);
        data[i][TYPE_COL_IDX] = ds;
        data[i][NAME_COL_IDX] = ds;
        data[i][GENES_COL_IDX] = ds.getGeneSetsOfInterest().size();
        i++;
    }
    final DefaultTableModel model = new DefaultTableModel(data, HEARDER_NAMES) {

        @Override
        public boolean isCellEditable(int row, int column) {
            // TODO Allow renaming?
            return false;
        }
    };
    getTable().setModel(model);
    JCheckBox tmpField = new JCheckBox();
    makeSmall(tmpField);
    getTable().getColumnModel().getColumn(TYPE_COL_IDX).setMaxWidth(16);
    getTable().getColumnModel().getColumn(SELECTED_COL_IDX).setMaxWidth(tmpField.getPreferredSize().width);
    getTable().getColumnModel().getColumn(GENES_COL_IDX).setMaxWidth(48);
    getTable().getColumnModel().getColumn(TYPE_COL_IDX).setResizable(false);
    getTable().getColumnModel().getColumn(SELECTED_COL_IDX).setResizable(false);
}
Also used : JCheckBox(javax.swing.JCheckBox) AbstractDataSet(org.baderlab.csplugins.enrichmentmap.model.AbstractDataSet) DefaultTableModel(javax.swing.table.DefaultTableModel)

Example 58 with JCheckBox

use of javax.swing.JCheckBox in project zaproxy by zaproxy.

the class OptionsSpiderPanel method getChkPostForm.

/**
	 * This method initializes the checkbox for POST form option. This option should not be enabled if the
	 * forms are not processed at all.
	 * 
	 * @return javax.swing.JCheckBox
	 */
private JCheckBox getChkPostForm() {
    if (chkPostForm == null) {
        chkPostForm = new JCheckBox();
        chkPostForm.setText(Constant.messages.getString("spider.options.label.post"));
        if (!getChkProcessForm().isSelected()) {
            chkPostForm.setEnabled(false);
        }
    }
    return chkPostForm;
}
Also used : JCheckBox(javax.swing.JCheckBox)

Example 59 with JCheckBox

use of javax.swing.JCheckBox in project zaproxy by zaproxy.

the class OptionsSpiderPanel method getChkParseSitemapXml.

/**
	 * This method initializes the Parse sitemap.xml checkbox.
	 * 
	 * @return javax.swing.JCheckBox
	 */
private JCheckBox getChkParseSitemapXml() {
    if (parseSitemapXml == null) {
        parseSitemapXml = new JCheckBox();
        parseSitemapXml.setText(Constant.messages.getString("spider.options.label.sitemapxml"));
    }
    return parseSitemapXml;
}
Also used : JCheckBox(javax.swing.JCheckBox)

Example 60 with JCheckBox

use of javax.swing.JCheckBox in project zaproxy by zaproxy.

the class OptionsSpiderPanel method getChkParseRobotsTxt.

/**
	 * This method initializes the Parse robots.txt checkbox.
	 * 
	 * @return javax.swing.JCheckBox
	 */
private JCheckBox getChkParseRobotsTxt() {
    if (parseRobotsTxt == null) {
        parseRobotsTxt = new JCheckBox();
        parseRobotsTxt.setText(Constant.messages.getString("spider.options.label.robotstxt"));
    }
    return parseRobotsTxt;
}
Also used : JCheckBox(javax.swing.JCheckBox)

Aggregations

JCheckBox (javax.swing.JCheckBox)491 JPanel (javax.swing.JPanel)199 JLabel (javax.swing.JLabel)155 JButton (javax.swing.JButton)108 ActionEvent (java.awt.event.ActionEvent)98 ActionListener (java.awt.event.ActionListener)93 JTextField (javax.swing.JTextField)88 GridBagConstraints (java.awt.GridBagConstraints)82 GridBagLayout (java.awt.GridBagLayout)77 Insets (java.awt.Insets)66 BorderLayout (java.awt.BorderLayout)63 Dimension (java.awt.Dimension)59 BoxLayout (javax.swing.BoxLayout)56 JScrollPane (javax.swing.JScrollPane)38 ItemEvent (java.awt.event.ItemEvent)37 ItemListener (java.awt.event.ItemListener)34 FlowLayout (java.awt.FlowLayout)33 JComboBox (javax.swing.JComboBox)33 JRadioButton (javax.swing.JRadioButton)32 Box (javax.swing.Box)30