use of java.awt.Dimension 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());
});
}
use of java.awt.Dimension in project EnrichmentMapApp by BaderLab.
the class EdgeWidthDialog method createSignatureSetPanel.
private JPanel createSignatureSetPanel() {
JPanel panel = new JPanel();
panel.setBorder(LookAndFeelUtil.createTitledBorder("Signature Set (Post Analysis)"));
panel.setLayout(new GridBagLayout());
GridBagConstraints gbc;
JLabel pValueLabel = new JLabel("p-value: ");
gbc = gridBagConstraints(0, 0);
gbc.weightx = 1.0;
panel.add(pValueLabel, gbc);
JLabel lessThan100 = new JLabel("<= cutoff/100 ");
gbc = gridBagConstraints(1, 0);
panel.add(lessThan100, gbc);
JLabel lessThan10 = new JLabel("<= cutoff/10 ");
gbc = gridBagConstraints(2, 0);
panel.add(lessThan10, gbc);
JLabel greaterThan = new JLabel("> cutoff/10 ");
gbc = gridBagConstraints(3, 0);
panel.add(greaterThan, gbc);
// Width
JLabel widthLabel = new JLabel("Width:");
gbc = gridBagConstraints(0, 1);
panel.add(widthLabel, gbc);
lessThan100Text = new JFormattedTextField(new DecimalFormat());
lessThan100Text.setPreferredSize(new Dimension(50, lessThan100Text.getPreferredSize().height));
lessThan100Text.setHorizontalAlignment(JTextField.RIGHT);
gbc = gridBagConstraints(1, 1);
gbc.insets = new Insets(5, 5, 5, 0);
panel.add(lessThan100Text, gbc);
lessThan10Text = new JFormattedTextField(new DecimalFormat());
lessThan10Text.setPreferredSize(new Dimension(50, lessThan10Text.getPreferredSize().height));
lessThan10Text.setHorizontalAlignment(JTextField.RIGHT);
gbc = gridBagConstraints(2, 1);
gbc.insets = new Insets(5, 5, 5, 0);
panel.add(lessThan10Text, gbc);
greaterThanText = new JFormattedTextField(new DecimalFormat());
greaterThanText.setPreferredSize(new Dimension(50, greaterThanText.getPreferredSize().height));
greaterThanText.setHorizontalAlignment(JTextField.RIGHT);
gbc = gridBagConstraints(3, 1);
gbc.insets = new Insets(5, 5, 5, 0);
panel.add(greaterThanText, gbc);
makeSmall(pValueLabel, lessThan100, lessThan10, greaterThan, widthLabel, lessThan100Text, lessThan10Text, greaterThanText);
return panel;
}
use of java.awt.Dimension in project EnrichmentMapApp by BaderLab.
the class EdgeWidthDialog method createGenesetOverlapPanel.
private JPanel createGenesetOverlapPanel() {
JPanel panel = new JPanel();
panel.setBorder(LookAndFeelUtil.createTitledBorder("Geneset Overlap"));
panel.setLayout(new GridBagLayout());
GridBagConstraints gbc;
// Similarity Coefficient
JLabel similarityLabel = new JLabel("Similarity Coefficient: ");
gbc = gridBagConstraints(0, 0);
gbc.weightx = 1.0;
panel.add(similarityLabel, gbc);
JLabel lowerBound = new JLabel(String.format("%.1f", similarityCutoff));
lowerBound.setHorizontalAlignment(JLabel.RIGHT);
gbc = gridBagConstraints(1, 0);
panel.add(lowerBound, gbc);
// hardcoded
JLabel upperBound = new JLabel("1.0");
upperBound.setHorizontalAlignment(JLabel.RIGHT);
gbc = gridBagConstraints(2, 0);
panel.add(upperBound, gbc);
JLabel spacer = new JLabel("");
gbc = gridBagConstraints(3, 0);
panel.add(spacer, gbc);
// Width
JLabel widthLabel = new JLabel("Width:");
gbc = gridBagConstraints(0, 1);
panel.add(widthLabel, gbc);
emLowerWidthText = new JFormattedTextField(new DecimalFormat());
emLowerWidthText.setPreferredSize(new Dimension(50, emLowerWidthText.getPreferredSize().height));
emLowerWidthText.setHorizontalAlignment(JTextField.RIGHT);
gbc = gridBagConstraints(1, 1);
gbc.insets = new Insets(5, 5, 5, 0);
panel.add(emLowerWidthText, gbc);
emUpperWidthText = new JFormattedTextField(new DecimalFormat());
emUpperWidthText.setPreferredSize(new Dimension(50, emUpperWidthText.getPreferredSize().height));
emUpperWidthText.setHorizontalAlignment(JTextField.RIGHT);
gbc = gridBagConstraints(2, 1);
gbc.insets = new Insets(5, 5, 5, 0);
panel.add(emUpperWidthText, gbc);
JLabel mappingText = new JLabel("(continuous mapping) ");
gbc = gridBagConstraints(3, 1);
panel.add(mappingText, gbc);
makeSmall(similarityLabel, lowerBound, upperBound, spacer, widthLabel, emLowerWidthText, emUpperWidthText, mappingText);
return panel;
}
use of java.awt.Dimension in project EnrichmentMapApp by BaderLab.
the class PostAnalysisInputPanel method getUserInputScrollPane.
JScrollPane getUserInputScrollPane() {
if (userInputScrollPane == null) {
// Default panel
userInputScrollPane = new JScrollPane(getKnownSignaturePanel());
int w = Math.max(getKnownSignaturePanel().getPreferredSize().width, getSignatureDiscoveryPanel().getPreferredSize().width);
userInputScrollPane.setPreferredSize(new Dimension(w + 40, userInputScrollPane.getPreferredSize().height));
}
return userInputScrollPane;
}
use of java.awt.Dimension in project EnrichmentMapApp by BaderLab.
the class JRangeSlider method toScreen.
/**
* Converts from a range value to screen coordinates.
*/
protected int toScreen(int xOrY) {
Dimension sz = getSize();
int min = getMinimum();
double scale;
if (orientation == VERTICAL) {
scale = (sz.height - (2 * ARROW_SZ)) / (double) (getMaximum() - min);
} else {
scale = (sz.width - (2 * ARROW_SZ)) / (double) (getMaximum() - min);
}
// Otherwise, we have to invert the number by subtracting the value from the height
if (direction == LEFTRIGHT_TOPBOTTOM) {
return (int) (ARROW_SZ + ((xOrY - min) * scale) + 0.5);
} else {
if (orientation == VERTICAL) {
return (int) (sz.height - ((xOrY - min) * scale) - ARROW_SZ + 0.5);
} else {
return (int) (sz.width - ((xOrY - min) * scale) - ARROW_SZ + 0.5);
}
}
}
Aggregations