Search in sources :

Example 91 with JPanel

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

the class LegendPanel method createStyleLegendPanel.

private JPanel createStyleLegendPanel(JComponent[][] entries) {
    JPanel p = new JPanel();
    p.setBorder(DEF_LEGEND_BORDER);
    p.setBackground(DEF_LEGEND_BG);
    updateStyleLegendPanel(entries, p);
    return p;
}
Also used : JPanel(javax.swing.JPanel)

Example 92 with JPanel

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

the class ErrorMessageDialog method createButtonPanel.

private JPanel createButtonPanel() {
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
    JButton cancelButton = new JButton("Cancel");
    buttonPanel.add(cancelButton);
    cancelButton.addActionListener(e -> dispose());
    finishButton = new JButton("Continue to Build");
    buttonPanel.add(finishButton);
    finishButton.addActionListener(e -> {
        shouldContinue = true;
        dispose();
    });
    return buttonPanel;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JButton(javax.swing.JButton)

Example 93 with JPanel

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

the class MasterDetailDialogPage method createDataSetPanel.

private JPanel createDataSetPanel() {
    JPanel titlePanel = createTitlePanel();
    dataSetListModel = new IterableListModel<>();
    dataSetList = new DataSetList(dataSetListModel);
    dataSetList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    dataSetList.addListSelectionListener(e -> selectItem(dataSetList.getSelectedValue()));
    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setViewportView(dataSetList);
    dataSetDetailPanel = new JPanel(new BorderLayout());
    dataSetDetailPanel.setBorder(BorderFactory.createLineBorder(UIManager.getColor("Separator.foreground")));
    cardLayout = new CardLayout();
    dataSetDetailPanel.setLayout(cardLayout);
    // Blank page
    dataSetDetailPanel.add(new EditNothingPanel(), "nothing");
    // Common page
    dataSetListModel.addElement(commonParams);
    dataSetDetailPanel.add(commonParams.getDetailPanel().getPanel(), commonParams.id);
    distinctEdgesCheckbox = new JCheckBox("Create separate edges for each dataset");
    SwingUtil.makeSmall(distinctEdgesCheckbox);
    JPanel checkboxPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    checkboxPanel.add(distinctEdgesCheckbox);
    // Make the NORTH area of both panels the same size
    titlePanel.doLayout();
    checkboxPanel.setPreferredSize(titlePanel.getPreferredSize());
    JPanel leftPanel = new JPanel(new BorderLayout());
    leftPanel.add(titlePanel, BorderLayout.NORTH);
    leftPanel.add(scrollPane, BorderLayout.CENTER);
    JPanel rightPanel = new JPanel(new BorderLayout());
    rightPanel.add(checkboxPanel, BorderLayout.NORTH);
    rightPanel.add(dataSetDetailPanel, BorderLayout.CENTER);
    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, rightPanel);
    splitPane.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    splitPane.setResizeWeight(0.3);
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(splitPane, BorderLayout.CENTER);
    return panel;
}
Also used : JScrollPane(javax.swing.JScrollPane) JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) CardLayout(java.awt.CardLayout) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) JSplitPane(javax.swing.JSplitPane)

Example 94 with JPanel

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

the class MasterDetailDialogPage method createTitlePanel.

private JPanel createTitlePanel() {
    JLabel label = new JLabel("Data Sets:");
    SwingUtil.makeSmall(label);
    JButton addButton = SwingUtil.createIconButton(iconManager, IconManager.ICON_PLUS, "Add Data Set");
    scanButton = SwingUtil.createIconButton(iconManager, IconManager.ICON_FOLDER_O, "Scan Folder for Data Sets");
    deleteButton = SwingUtil.createIconButton(iconManager, IconManager.ICON_TRASH_O, "Delete Data Set");
    addButton.addActionListener(e -> addNewDataSetToList());
    deleteButton.addActionListener(e -> deleteSelectedItems());
    scanButton.addActionListener(e -> scan());
    JPanel panel = new JPanel();
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(false);
    layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(label).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(scanButton).addComponent(addButton).addComponent(deleteButton));
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(label).addComponent(scanButton).addComponent(addButton).addComponent(deleteButton));
    return panel;
}
Also used : JPanel(javax.swing.JPanel) JButton(javax.swing.JButton) GroupLayout(javax.swing.GroupLayout) JLabel(javax.swing.JLabel)

Example 95 with JPanel

use of javax.swing.JPanel 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)

Aggregations

JPanel (javax.swing.JPanel)4487 JLabel (javax.swing.JLabel)1843 BorderLayout (java.awt.BorderLayout)1461 JButton (javax.swing.JButton)1180 Dimension (java.awt.Dimension)1107 GridBagLayout (java.awt.GridBagLayout)1071 ActionEvent (java.awt.event.ActionEvent)1019 GridBagConstraints (java.awt.GridBagConstraints)954 JScrollPane (javax.swing.JScrollPane)901 ActionListener (java.awt.event.ActionListener)871 BoxLayout (javax.swing.BoxLayout)801 Insets (java.awt.Insets)724 FlowLayout (java.awt.FlowLayout)667 JTextField (javax.swing.JTextField)532 JCheckBox (javax.swing.JCheckBox)458 GridLayout (java.awt.GridLayout)375 JComboBox (javax.swing.JComboBox)267 EmptyBorder (javax.swing.border.EmptyBorder)252 JTable (javax.swing.JTable)224 Color (java.awt.Color)210