import javax.swing.ButtonGroup;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
-import javax.swing.JInternalFrame;
+import jalview.gui.JalviewInternalFrame;
import javax.swing.JLayeredPane;
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;
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 = new JalviewInternalFrame();
frame.setFrameIcon(null);
frame.setContentPane(this);
frame.setLayer(JLayeredPane.PALETTE_LAYER);
}
setOldHiddenColumns(av.getAlignment().getHiddenColumns());
adjusting = true;
-
+
setAnnotations(new JComboBox<>(getAnnotationItems(false)));
populateThresholdComboBox(threshold);
AnnotationColumnChooser lastChooser = av
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
{
gSearchPanel.searchBox.updateCache();
ngSearchPanel.searchBox.updateCache();
}
+
+ public static void displayFor(AlignViewport av, AlignmentPanel ap,
+ AlignmentAnnotation alignmentAnnotation)
+ {
+ AnnotationColumnChooser colchooser = new AnnotationColumnChooser(av, ap, alignmentAnnotation);
+ }
}