Search in sources :

Example 1 with AfterInjection

use of org.baderlab.csplugins.enrichmentmap.AfterInjection in project EnrichmentMapApp by BaderLab.

the class ControlPanel method createContents.

@AfterInjection
private void createContents() {
    setMinimumSize(new Dimension(390, 400));
    setPreferredSize(new Dimension(390, 600));
    JButton helpButton = SwingUtil.createOnlineHelpButton(EnrichmentMapBuildProperties.USER_MANUAL_URL, "Online Manual...", serviceRegistrar);
    makeSmall(getAboutButton(), getClosePanelButton());
    final GroupLayout layout = new GroupLayout(this);
    setLayout(layout);
    layout.setAutoCreateContainerGaps(LookAndFeelUtil.isWinLAF());
    layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
    layout.setHorizontalGroup(layout.createParallelGroup(CENTER, true).addGroup(layout.createSequentialGroup().addComponent(getEmViewCombo(), DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(ComponentPlacement.RELATED).addComponent(getCreateEmButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addPreferredGap(ComponentPlacement.RELATED).addComponent(getOptionsButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)).addComponent(getCtrlPanelsContainer(), DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addGroup(layout.createSequentialGroup().addComponent(helpButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getAboutButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addGap(0, 0, Short.MAX_VALUE).addComponent(getClosePanelButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)));
    layout.setVerticalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(CENTER, false).addComponent(getEmViewCombo(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getCreateEmButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getOptionsButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)).addComponent(getCtrlPanelsContainer(), DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addGroup(layout.createParallelGroup(CENTER, false).addComponent(helpButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getAboutButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getClosePanelButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)));
    if (LookAndFeelUtil.isAquaLAF())
        setOpaque(false);
}
Also used : JButton(javax.swing.JButton) GroupLayout(javax.swing.GroupLayout) Dimension(java.awt.Dimension) AfterInjection(org.baderlab.csplugins.enrichmentmap.AfterInjection)

Example 2 with AfterInjection

use of org.baderlab.csplugins.enrichmentmap.AfterInjection in project EnrichmentMapApp by BaderLab.

the class ControlPanelMediator method init.

@AfterInjection
private void init() {
    ControlPanel ctrlPanel = getControlPanel();
    ctrlPanel.getCreateEmButton().addActionListener(evt -> {
        masterMapDialogAction.actionPerformed(evt);
    });
    ctrlPanel.getCreateEmButton().setToolTipText("" + masterMapDialogAction.getValue(Action.NAME));
    ctrlPanel.getOptionsButton().addActionListener(evt -> {
        getOptionsMenu().show(ctrlPanel.getOptionsButton(), 0, ctrlPanel.getOptionsButton().getHeight());
    });
    ctrlPanel.getClosePanelButton().addActionListener(evt -> {
        closeControlPanel();
    });
    ctrlPanel.update(applicationManager.getCurrentNetworkView());
    // Wait until the UI is initialized to add this listener to the combo box
    JComboBox<CyNetworkView> cmb = ctrlPanel.getEmViewCombo();
    cmb.addActionListener(evt -> {
        if (!updating)
            setCurrentView((CyNetworkView) cmb.getSelectedItem());
    });
}
Also used : EMViewControlPanel(org.baderlab.csplugins.enrichmentmap.view.control.ControlPanel.EMViewControlPanel) CyNetworkView(org.cytoscape.view.model.CyNetworkView) AfterInjection(org.baderlab.csplugins.enrichmentmap.AfterInjection)

Example 3 with AfterInjection

use of org.baderlab.csplugins.enrichmentmap.AfterInjection in project EnrichmentMapApp by BaderLab.

the class MannWhitneyRanksDialog method createContents.

@AfterInjection
private void createContents() {
    JPanel dataSetPanel = createDataSetPanel();
    JPanel buttonPanel = createButtonPanel();
    buttonPanel.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIManager.getColor("Separator.foreground")));
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(dataSetPanel, BorderLayout.CENTER);
    panel.add(buttonPanel, BorderLayout.SOUTH);
    setContentPane(panel);
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) AfterInjection(org.baderlab.csplugins.enrichmentmap.AfterInjection)

Example 4 with AfterInjection

use of org.baderlab.csplugins.enrichmentmap.AfterInjection in project EnrichmentMapApp by BaderLab.

the class LegendPanelMediator method init.

@AfterInjection
@SuppressWarnings("serial")
private void init() {
    invokeOnEDTAndWait(() -> {
        dialog = new JDialog(swingApplication.getJFrame(), "EnrichmentMap Legend", ModalityType.MODELESS);
        dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
        dialog.setMinimumSize(new Dimension(440, 380));
        JButton closeButton = new JButton(new AbstractAction("Close") {

            @Override
            public void actionPerformed(ActionEvent e) {
                dialog.dispose();
            }
        });
        creationParamsButton.addActionListener(e -> showCreationParamsDialog());
        JPanel bottomPanel = LookAndFeelUtil.createOkCancelPanel(null, closeButton, creationParamsButton);
        dialog.getContentPane().add(legendPanelProvider.get(), BorderLayout.CENTER);
        dialog.getContentPane().add(bottomPanel, BorderLayout.SOUTH);
        LookAndFeelUtil.setDefaultOkCancelKeyStrokes(dialog.getRootPane(), null, closeButton.getAction());
        dialog.getRootPane().setDefaultButton(closeButton);
        dialog.setLocationRelativeTo(swingApplication.getJFrame());
    });
}
Also used : JPanel(javax.swing.JPanel) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) Dimension(java.awt.Dimension) AbstractAction(javax.swing.AbstractAction) JDialog(javax.swing.JDialog) AfterInjection(org.baderlab.csplugins.enrichmentmap.AfterInjection)

Example 5 with AfterInjection

use of org.baderlab.csplugins.enrichmentmap.AfterInjection in project EnrichmentMapApp by BaderLab.

the class HeatMapParentPanel method CreateContents.

@AfterInjection
public void CreateContents() {
    setLayout(new BorderLayout());
    setOpaque(false);
    showEmptyView();
}
Also used : BorderLayout(java.awt.BorderLayout) AfterInjection(org.baderlab.csplugins.enrichmentmap.AfterInjection)

Aggregations

AfterInjection (org.baderlab.csplugins.enrichmentmap.AfterInjection)12 JPanel (javax.swing.JPanel)8 GroupLayout (javax.swing.GroupLayout)6 BorderLayout (java.awt.BorderLayout)4 Dimension (java.awt.Dimension)2 JButton (javax.swing.JButton)2 GridBagLayout (java.awt.GridBagLayout)1 ActionEvent (java.awt.event.ActionEvent)1 AbstractAction (javax.swing.AbstractAction)1 JCheckBox (javax.swing.JCheckBox)1 JDialog (javax.swing.JDialog)1 AbstractFormatterFactory (javax.swing.JFormattedTextField.AbstractFormatterFactory)1 SimilarityMetric (org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters.SimilarityMetric)1 EMViewControlPanel (org.baderlab.csplugins.enrichmentmap.view.control.ControlPanel.EMViewControlPanel)1 CyNetworkView (org.cytoscape.view.model.CyNetworkView)1