Search in sources :

Example 1 with GradientScaleBar

use of uk.ac.babraham.SeqMonk.Displays.GradientScaleBar.GradientScaleBar in project SeqMonk by s-andrews.

the class HierarchicalClusterDialog method progressComplete.

public void progressComplete(String command, Object result) {
    clusterPanelGroup = new JPanel();
    clusterPanelGroup.setLayout(new BorderLayout());
    ColourGradient gradient = (ColourGradient) gradients.getSelectedItem();
    if (invertGradient.isSelected()) {
        gradient = new InvertedGradient(gradient);
    }
    if (negativeScale) {
        scaleBar = new GradientScaleBar(gradient, -2, 2);
    } else {
        scaleBar = new GradientScaleBar(gradient, 0, 2);
    }
    JPanel topBottomSplit = new JPanel();
    topBottomSplit.setLayout(new GridLayout(2, 1));
    topBottomSplit.add(new JPanel());
    topBottomSplit.add(scaleBar);
    clusterPanel = new HierarchicalClusterPanel(probes, stores, (ClusterPair) result, normalise, (ColourGradient) gradients.getSelectedItem());
    clusterPanelGroup.add(clusterPanel, BorderLayout.CENTER);
    clusterPanelGroup.add(topBottomSplit, BorderLayout.EAST);
    getContentPane().add(clusterPanelGroup, BorderLayout.CENTER);
    setLocationRelativeTo(SeqMonkApplication.getInstance());
    stateChanged(new ChangeEvent(clusterSlider));
    setVisible(true);
}
Also used : JPanel(javax.swing.JPanel) GradientScaleBar(uk.ac.babraham.SeqMonk.Displays.GradientScaleBar.GradientScaleBar) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) ChangeEvent(javax.swing.event.ChangeEvent) InvertedGradient(uk.ac.babraham.SeqMonk.Gradients.InvertedGradient) ClusterPair(uk.ac.babraham.SeqMonk.DataTypes.Cluster.ClusterPair) ColourGradient(uk.ac.babraham.SeqMonk.Gradients.ColourGradient)

Example 2 with GradientScaleBar

use of uk.ac.babraham.SeqMonk.Displays.GradientScaleBar.GradientScaleBar in project SeqMonk by s-andrews.

the class CorrelationMatrix method progressComplete.

public void progressComplete(String command, Object result) {
    model = new DistanceTableModel();
    tablePanel = new JPanel();
    tablePanel.setLayout(new BorderLayout());
    tablePanel.add(new CorrelationPanel(), BorderLayout.CENTER);
    if (scaleBox.isSelected()) {
        scaleBar = new GradientScaleBar(gradient, -1, 1);
    } else {
        scaleBar = new GradientScaleBar(gradient, model.getMinCorrelation(), model.getMaxCorrelation());
    }
    tablePanel.add(scaleBar, BorderLayout.EAST);
    tablePanel.add(new CorrelationNamePanel(), BorderLayout.WEST);
    getContentPane().add(tablePanel, BorderLayout.CENTER);
    setVisible(true);
}
Also used : JPanel(javax.swing.JPanel) GradientScaleBar(uk.ac.babraham.SeqMonk.Displays.GradientScaleBar.GradientScaleBar) BorderLayout(java.awt.BorderLayout)

Aggregations

BorderLayout (java.awt.BorderLayout)2 JPanel (javax.swing.JPanel)2 GradientScaleBar (uk.ac.babraham.SeqMonk.Displays.GradientScaleBar.GradientScaleBar)2 GridLayout (java.awt.GridLayout)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ClusterPair (uk.ac.babraham.SeqMonk.DataTypes.Cluster.ClusterPair)1 ColourGradient (uk.ac.babraham.SeqMonk.Gradients.ColourGradient)1 InvertedGradient (uk.ac.babraham.SeqMonk.Gradients.InvertedGradient)1