Skip to content

Commit

Permalink
Genome menu changes (GenArk)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Mar 5, 2024
1 parent aaeae0e commit 5cd92b1
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions src/main/java/org/broad/igv/ui/IGVMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ private JMenu createGenomesMenu() {
MessageUtils.showErrorMessage(ex.getMessage(), ex);
}
});

genomeFileItem.setToolTipText("Load a FASTA, .json, or .genome file...");
menu.add(genomeFileItem);

Expand All @@ -363,34 +364,53 @@ private JMenu createGenomesMenu() {
menu.add(loadFromURLItem);



// Track hubs
menu.add(new JSeparator());

JMenuItem genArkItem = new JMenuItem(new UCSCGenArkAction("Search UCSC GenArk Assemblies...", 0, igv));
menu.add(genArkItem);

JMenuItem trackHubItem = new JMenuItem(new LoadFromURLMenuAction(LoadFromURLMenuAction.LOAD_TRACKHUB, KeyEvent.VK_S, igv));
trackHubItem.setToolTipText(UIConstants.LOAD_TRACKHUB_TOOLTIP);
menu.add(trackHubItem);

MenuAction genArkAction = new UCSCGenArkAction("Load Genome from UCSC GenArk...", 0, igv);
menu.add(MenuAndToolbarUtils.createMenuItem(genArkAction));

selectGenomeAnnotationsItem = new JMenuItem(new SelectGenomeAnnotationTracksAction("Select Hub Tracks...", igv));
MenuAction menuAction = new SelectGenomeAnnotationTracksAction("Select GenArk Tracks...", igv);
selectGenomeAnnotationsItem = MenuAndToolbarUtils.createMenuItem(menuAction);
Genome genome = GenomeManager.getInstance().getCurrentGenome();
selectGenomeAnnotationsItem.setEnabled(genome != null && genome.getHub() != null);
menu.add(selectGenomeAnnotationsItem);


menu.add(new JSeparator());

// Add genome to combo box from server
JMenuItem removeItem = new JMenuItem("Remove Genomes...");
removeItem.addActionListener(e -> {
RemoveGenomesDialog dialog2 = new RemoveGenomesDialog(igv.getMainFrame());
dialog2.setVisible(true);
menuAction = new MenuAction("Remove Genomes...", null) {
@Override
public void actionPerformed(ActionEvent event) {
RemoveGenomesDialog dialog2 = new RemoveGenomesDialog(igv.getMainFrame());
dialog2.setVisible(true);
}
};
menuAction.setToolTipText("Remove genomes which appear in the dropdown list");
menu.add(MenuAndToolbarUtils.createMenuItem(menuAction));

menu.addMenuListener(new MenuListener() {
@Override
public void menuSelected(MenuEvent e) {
Genome genome = GenomeManager.getInstance().getCurrentGenome();
selectGenomeAnnotationsItem.setEnabled(genome != null && genome.getHub() != null);
}

@Override
public void menuDeselected(MenuEvent e) {

}

@Override
public void menuCanceled(MenuEvent e) {

}
});
removeItem.setToolTipText("Remove genomes which appear in the dropdown list");
menu.add(removeItem);

return menu;

}


Expand Down

0 comments on commit 5cd92b1

Please sign in to comment.