Package org.broad.igv.session

Examples of org.broad.igv.session.History


    }


    public HistoryMenu(String name) {
        super(name);
        final History history = IGV.getInstance().getSession().getHistory();

        clearAllItem = new JMenuItem("Clear all");
        clearAllItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                history.clear();
            }
        });

        //backItem = new JMenuItem("<html>Back&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>Alt &rarr;");
        backItem = new JMenuItem("Back          Alt+Arrow");
        backItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                history.back();
            }
        });

        forwardItem = new JMenuItem("Forward     Alt+Arrow");
        forwardItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                history.forward();
            }
        });


        this.addMenuListener(new MenuListener() {
            public void menuSelected(MenuEvent menuEvent) {

                final History history = IGV.getInstance().getSession().getHistory();


                List<History.Entry> allLoci = IGV.getInstance().getSession().getAllHistory();
               
                boolean hasBack = history.peekBack() != null;
                boolean hasForward = history.peekForward() != null;
                backItem.setEnabled(hasBack);
                forwardItem.setEnabled(hasForward);
                clearAllItem.setEnabled(allLoci.size() > 0);

                // Update history list
View Full Code Here


        final String chrName = getDefaultReferenceFrame().getChrName();
        if (!Globals.CHR_ALL.equals(chrName) && !FrameManager.isGeneListMode()) {
            p = getDefaultReferenceFrame().getFormattedLocusString();
        }
        final String position = p;
        final History history = IGV.getInstance().getSession().getHistory();

        UIUtilities.invokeOnEventThread(new Runnable() {
            public void run() {
                searchTextField.setText(position);
                forwardButton.setEnabled(history.canGoForward());
                backButton.setEnabled(history.canGoBack());
                roiToggleButton.setEnabled(!Globals.CHR_ALL.equals(chrName));
                zoomControl.setEnabled(!Globals.CHR_ALL.equals(chrName));
            }
        });
View Full Code Here

TOP

Related Classes of org.broad.igv.session.History

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.