X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAnnotationLabels.java;h=28065c38e54d1165217e66e34c380a6bfb998993;hb=fa48c836ad6e85a9e8146177cc865f4a061dc1a4;hp=8930629e5c8cb8c3a6357a484052d4804ffcf1ee;hpb=d8fcaf315395d614059f4345c20ff2f86a4476f1;p=jalview.git diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 8930629..28065c3 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -36,12 +36,10 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.geom.AffineTransform; -import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.Locale; -import java.util.concurrent.Callable; import javax.swing.JCheckBoxMenuItem; import javax.swing.JMenuItem; @@ -52,7 +50,6 @@ import javax.swing.ToolTipManager; import jalview.analysis.AlignSeq; import jalview.analysis.AlignmentUtils; -import jalview.bin.Console; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; @@ -62,15 +59,11 @@ import jalview.datamodel.HiddenColumns; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; -import jalview.io.DataSourceType; import jalview.io.FileFormat; import jalview.io.FormatAdapter; -import jalview.io.NewickFile; -import jalview.schemes.AnnotationColourGradient; import jalview.util.Comparison; import jalview.util.MessageManager; import jalview.util.Platform; -import jalview.ws.datamodel.alphafold.PAEContactMatrix; /** * The panel that holds the labels for alignment annotations, providing @@ -315,7 +308,6 @@ public class AnnotationLabels extends JPanel ap.av.getAlignment().setAnnotationIndex(annotation, 0); } ap.refresh(true); - return null; }); } @@ -493,7 +485,8 @@ public class AnnotationLabels extends JPanel if (cm.hasGroups()) { - JCheckBoxMenuItem chitem = new JCheckBoxMenuItem("Show Groups on Matrix"); + JCheckBoxMenuItem chitem = new JCheckBoxMenuItem(MessageManager.getString("action.show_groups_on_matrix")); + chitem.setToolTipText(MessageManager.getString("action.show_groups_on_matrix_tooltip")); boolean showGroups = alignmentAnnotation.isShowGroupsForContactMatrix(); final AlignmentAnnotation sel_row=alignmentAnnotation; chitem.setState(showGroups); @@ -504,15 +497,18 @@ public class AnnotationLabels extends JPanel public void actionPerformed(ActionEvent e) { sel_row.setShowGroupsForContactMatrix(chitem.getState()); - ap.getAnnotationPanel() - .paint(ap.getAnnotationPanel().getGraphics()); + // so any annotation colour changes are propagated - though they + // probably won't be unless the annotation row colours are removed + // too! + ap.alignmentChanged(); } }); pop.add(chitem); } if (cm.hasTree()) { - item = new JMenuItem("Show Tree for Matrix"); + item = new JMenuItem(MessageManager.getString("action.show_tree_for_matrix")); + item.setToolTipText(MessageManager.getString("action.show_tree_for_matrix_tooltip")); item.addActionListener(new ActionListener() { @@ -528,10 +524,10 @@ public class AnnotationLabels extends JPanel } else { - item = new JMenuItem("Calculate Tree for Matrix"); + item = new JMenuItem(MessageManager.getString("action.cluster_matrix")); + item.setToolTipText(MessageManager.getString("action.cluster_matrix_tooltip")); item.addActionListener(new ActionListener() { - // TODO - refactor to analysis background thread @Override public void actionPerformed(ActionEvent e) { @@ -540,9 +536,14 @@ public class AnnotationLabels extends JPanel @Override public void run() { - AlignmentAnnotation alan = alignmentAnnotation; - cm.setGroupSet(GroupSet.makeGroups(cm, 5f, true)); - ap.alignFrame.showContactMapTree(alan, cm); + final long progBar; + ap.alignFrame.setProgressBar(MessageManager.formatMessage("action.clustering_matrix_for",cm.getAnnotDescr(),5f), progBar = System.currentTimeMillis()); + cm.setGroupSet(GroupSet.makeGroups(cm, true)); + cm.randomlyReColourGroups(); + cm.transferGroupColorsTo(alignmentAnnotation); + ap.alignmentChanged(); + ap.alignFrame.showContactMapTree(alignmentAnnotation, cm); + ap.alignFrame.setProgressBar(null, progBar); } }).start(); }