Skip to content

Commit

Permalink
Genomes -- use radio buttons for genome download options.
Browse files Browse the repository at this point in the history
Rename encode menu items
  • Loading branch information
jrobinso committed Dec 4, 2024
1 parent a67652a commit 900ca32
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 28 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/broad/igv/ui/IGVMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,15 @@ JMenu createFileMenu() {

// Post 2012 ENCODE menu
JMenuItem chipItem = new JMenuItem();
chipItem.setAction(new BrowseEncodeAction("ENCODE: ChIP Signals ...", 0, BrowseEncodeAction.Type.SIGNALS_CHIP, igv));
chipItem.setAction(new BrowseEncodeAction("ENCODE ChIP Signals ...", 0, BrowseEncodeAction.Type.SIGNALS_CHIP, igv));
encodeMenuItems.add(chipItem);

JMenuItem otherSignalsItem = new JMenuItem();
otherSignalsItem.setAction(new BrowseEncodeAction("ENCODE: Other Signals ...", 0, BrowseEncodeAction.Type.SIGNALS_OTHER, igv));
otherSignalsItem.setAction(new BrowseEncodeAction("ENCODE Other Signals ...", 0, BrowseEncodeAction.Type.SIGNALS_OTHER, igv));
encodeMenuItems.add(otherSignalsItem);

JMenuItem otherItem = new JMenuItem();
otherItem.setAction(new BrowseEncodeAction("ENCODE: Other ...", 0, BrowseEncodeAction.Type.OTHER, igv));
otherItem.setAction(new BrowseEncodeAction("ENCODE Other ...", 0, BrowseEncodeAction.Type.OTHER, igv));
encodeMenuItems.add(otherItem);

for(JComponent item : encodeMenuItems) {
Expand All @@ -330,7 +330,7 @@ JMenu createFileMenu() {

// UCSC hosted ENCODE menu.
encodeUCSCMenuItem = MenuAndToolbarUtils.createMenuItem(
new BrowseEncodeAction("ENCODE: UCSC Repository (2012) ...", KeyEvent.VK_E, BrowseEncodeAction.Type.UCSC, igv));
new BrowseEncodeAction("ENCODE 2012 UCSC Repository ...", KeyEvent.VK_E, BrowseEncodeAction.Type.UCSC, igv));
encodeUCSCMenuItem.setVisible(EncodeTrackChooser.genomeSupportedUCSC(genomeId));
menuItems.add(encodeUCSCMenuItem);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ public class HostedGenomeSelectionDialog extends org.broad.igv.ui.IGVDialog {
private JList<GenomeListItem> genomeList;
private JCheckBox downloadSequenceCB;
private JCheckBox downloadAnnotationsCB;


JPanel downloadSequencePanel;
ButtonGroup downloadSequenceGroup;
private JRadioButton downloadSequenceRB;
private JRadioButton remoteSequenceRB;

JPanel downloadAnnotationsPanel;
ButtonGroup downloadAnnotationsGroup;
private JRadioButton downloadAnnotationsRB;
private JRadioButton remoteAnnotationsRB;
private boolean isCanceled;
private List<GenomeListItem> allListItems;
private DefaultListModel genomeListModel;
Expand Down Expand Up @@ -181,11 +192,11 @@ public GenomeListItem getSelectedValue() {
}

public boolean isDownloadSequence() {
return downloadSequenceCB.isSelected();
return downloadSequenceRB.isSelected();
}

public boolean isDownloadAnnotations() {
return downloadAnnotationsCB.isSelected();
return downloadAnnotationsRB.isSelected();
}

public boolean isCanceled() {
Expand All @@ -209,8 +220,13 @@ private void configureDownloadButtons(GenomeListItem item) {
if (item != null) {
final boolean sequenceDownloadable = GenomeDownloadUtils.isSequenceDownloadable(item.getPath());
final boolean annotationsDownloadable = GenomeDownloadUtils.isAnnotationsDownloadable(item.getPath());
downloadSequenceCB.setEnabled(sequenceDownloadable);
downloadAnnotationsCB.setEnabled(annotationsDownloadable);
// downloadSequenceCB.setEnabled(sequenceDownloadable);
downloadSequenceRB.setVisible(sequenceDownloadable);
remoteSequenceRB.setVisible(sequenceDownloadable);

// downloadAnnotationsCB.setEnabled(annotationsDownloadable);
downloadAnnotationsRB.setVisible(annotationsDownloadable);
remoteAnnotationsRB.setVisible(annotationsDownloadable);
}
}

Expand All @@ -227,7 +243,7 @@ private void initComponents() {

JPanel dialogPane = new JPanel();
dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
dialogPane.setPreferredSize(new Dimension(350, 500));
dialogPane.setPreferredSize(new Dimension(500, 500));
dialogPane.setLayout(new BorderLayout());

//======== contentPanel ========
Expand Down Expand Up @@ -297,25 +313,63 @@ public void keyReleased(KeyEvent e) {

contentPanel.add(scrollPane1);

//---- downloadSequenceCB ----
downloadSequenceCB = new JCheckBox("Download sequence");
downloadSequenceCB.setAlignmentX(1.0F);
downloadSequenceCB.setToolTipText("Download the full sequence data for the genome. Note that these files can be large (human is about 1 gigabyte).");
downloadSequenceCB.setMaximumSize(new Dimension(1000, 23));
downloadSequenceCB.setPreferredSize(new Dimension(300, 23));
downloadSequenceCB.setMinimumSize(new Dimension(300, 23));
downloadSequenceCB.setEnabled(false); // Disabled until a genome is selected.
contentPanel.add(downloadSequenceCB);

//---- downloadAnnotationsCB ----
downloadAnnotationsCB = new JCheckBox("Download annotations");
downloadAnnotationsCB.setAlignmentX(1.0F);
downloadAnnotationsCB.setToolTipText("Download all annotation files referenced by the genome definition.");
downloadAnnotationsCB.setMaximumSize(new Dimension(1000, 23));
downloadAnnotationsCB.setPreferredSize(new Dimension(300, 23));
downloadAnnotationsCB.setMinimumSize(new Dimension(300, 23));
downloadAnnotationsCB.setEnabled(false); // Disabled until a genome is selected
contentPanel.add(downloadAnnotationsCB);
JPanel p1 = new JPanel();
p1.setLayout(new GridLayout(2, 0));
p1.setPreferredSize(new Dimension(500, 50));
p1.setMinimumSize(new Dimension(500, 50));
p1.setMaximumSize(new Dimension(1000, 50));

downloadSequenceRB = new JRadioButton("Download sequence");
remoteSequenceRB = new JRadioButton("Remote sequence");
remoteSequenceRB.setSelected(true);
downloadSequenceRB.setVisible(false);
remoteSequenceRB.setVisible(false);
downloadSequenceGroup = new ButtonGroup();
downloadSequenceGroup.add(downloadSequenceRB);
downloadSequenceGroup.add(remoteSequenceRB);
downloadSequencePanel = new JPanel();
FlowLayout layout = new FlowLayout(FlowLayout.LEFT);
downloadSequencePanel.setLayout(layout);
downloadSequencePanel.add(downloadSequenceRB);
downloadSequencePanel.add(remoteSequenceRB);
p1.add(downloadSequencePanel);

downloadAnnotationsRB = new JRadioButton("Download annotations");
remoteAnnotationsRB = new JRadioButton("Remote annotations");
remoteAnnotationsRB.setSelected(true);
downloadAnnotationsRB.setVisible(false);
remoteAnnotationsRB.setVisible(false);
downloadAnnotationsGroup = new ButtonGroup();
downloadAnnotationsGroup.add(downloadAnnotationsRB);
downloadAnnotationsGroup.add(remoteAnnotationsRB);
downloadAnnotationsPanel = new JPanel();
FlowLayout layout1 = new FlowLayout(FlowLayout.LEFT);
downloadAnnotationsPanel.setLayout(layout1);
downloadAnnotationsPanel.add(downloadAnnotationsRB);
downloadAnnotationsPanel.add(remoteAnnotationsRB);
p1.add(downloadAnnotationsPanel);

contentPanel.add(p1);

// //---- downloadSequenceCB ----
// downloadSequenceCB = new JCheckBox("Download sequence");
// downloadSequenceCB.setAlignmentX(1.0F);
// downloadSequenceCB.setToolTipText("Download the full sequence data for the genome. Note that these files can be large (human is about 1 gigabyte).");
// downloadSequenceCB.setMaximumSize(new Dimension(1000, 23));
// downloadSequenceCB.setPreferredSize(new Dimension(300, 23));
// downloadSequenceCB.setMinimumSize(new Dimension(300, 23));
// downloadSequenceCB.setEnabled(false); // Disabled until a genome is selected.
// contentPanel.add(downloadSequenceCB);
//
// //---- downloadAnnotationsCB ----
// downloadAnnotationsCB = new JCheckBox("Download annotations");
// downloadAnnotationsCB.setAlignmentX(1.0F);
// downloadAnnotationsCB.setToolTipText("Download all annotation files referenced by the genome definition.");
// downloadAnnotationsCB.setMaximumSize(new Dimension(1000, 23));
// downloadAnnotationsCB.setPreferredSize(new Dimension(300, 23));
// downloadAnnotationsCB.setMinimumSize(new Dimension(300, 23));
// downloadAnnotationsCB.setEnabled(false); // Disabled until a genome is selected
// contentPanel.add(downloadAnnotationsCB);


dialogPane.add(contentPanel, BorderLayout.CENTER);
Expand Down

0 comments on commit 900ca32

Please sign in to comment.