Search in sources :

Example 1 with ColorGradientWidget

use of org.mskcc.colorgradient.ColorGradientWidget in project EnrichmentMapApp by BaderLab.

the class GradientLegendPanel method createExpressionLegendPanel.

private static JPanel createExpressionLegendPanel(DataSetColorRange range) {
    JPanel panel = new JPanel();
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateContainerGaps(true);
    layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
    ParallelGroup hGroup = layout.createParallelGroup(Alignment.CENTER, true);
    SequentialGroup vGroup = layout.createSequentialGroup();
    layout.setHorizontalGroup(hGroup);
    layout.setVerticalGroup(vGroup);
    ColorGradientWidget legend = ColorGradientWidget.getInstance("", range.getTheme(), range.getRange(), true, ColorGradientWidget.LEGEND_POSITION.NA);
    hGroup.addComponent(legend, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE);
    vGroup.addComponent(legend, 25, 25, 25);
    if (LookAndFeelUtil.isAquaLAF())
        panel.setOpaque(false);
    panel.revalidate();
    panel.setOpaque(false);
    return panel;
}
Also used : ColorGradientWidget(org.mskcc.colorgradient.ColorGradientWidget) JPanel(javax.swing.JPanel) ParallelGroup(javax.swing.GroupLayout.ParallelGroup) SequentialGroup(javax.swing.GroupLayout.SequentialGroup) GroupLayout(javax.swing.GroupLayout)

Aggregations

GroupLayout (javax.swing.GroupLayout)1 ParallelGroup (javax.swing.GroupLayout.ParallelGroup)1 SequentialGroup (javax.swing.GroupLayout.SequentialGroup)1 JPanel (javax.swing.JPanel)1 ColorGradientWidget (org.mskcc.colorgradient.ColorGradientWidget)1