X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationColumnChooser.java;h=f1f78fa1d4fa450e9e7956f9e9ddeb5ad0f7c9fe;hb=HEAD;hp=0b1ad93e49cf9373b3938d47499d0a5faa4deb4d;hpb=2a49f71b0cf62de3942ad625995244db3f291dc6;p=jalview.git diff --git a/src/jalview/gui/AnnotationColumnChooser.java b/src/jalview/gui/AnnotationColumnChooser.java index 0b1ad93..f1f78fa 100644 --- a/src/jalview/gui/AnnotationColumnChooser.java +++ b/src/jalview/gui/AnnotationColumnChooser.java @@ -42,6 +42,7 @@ import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.border.TitledBorder; +import jalview.bin.Console; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.HiddenColumns; import jalview.io.cache.JvCacheableInputBox; @@ -95,8 +96,15 @@ public class AnnotationColumnChooser extends AnnotationRowFilter public AnnotationColumnChooser(AlignViewport av, final AlignmentPanel ap) { + this(av, ap, null); + } + + public AnnotationColumnChooser(AlignViewport av, final AlignmentPanel ap, + AlignmentAnnotation selectedAnnotation) + { super(av, ap); frame = new JInternalFrame(); + frame.setFrameIcon(null); frame.setContentPane(this); frame.setLayer(JLayeredPane.PALETTE_LAYER); Desktop.addInternalFrame(frame, @@ -133,6 +141,18 @@ public class AnnotationColumnChooser extends AnnotationRowFilter percentThreshold .setSelected(lastChooser.percentThreshold.isSelected()); } + if (selectedAnnotation != null) + { + try + { + setCurrentAnnotation(selectedAnnotation); + annotations.setSelectedItem( + getAnnotationMenuLabel(selectedAnnotation)); + } catch (Exception x) + { + Console.error("Couldn't select annotation in column chooser", x); + } + } try { @@ -849,4 +869,11 @@ public class AnnotationColumnChooser extends AnnotationRowFilter gSearchPanel.searchBox.updateCache(); ngSearchPanel.searchBox.updateCache(); } + + public static void displayFor(AlignViewport av, AlignmentPanel ap, + AlignmentAnnotation alignmentAnnotation) + { + AnnotationColumnChooser colchooser = new AnnotationColumnChooser(av, ap, + alignmentAnnotation); + } }