Search in sources :

Example 1 with DataPanel

use of dr.app.beauti.datapanel.DataPanel in project beast-mcmc by beast-dev.

the class BeautiFrame method initializeComponents.

public void initializeComponents() {
    dataPanel = new DataPanel(this, getImportAction(), getDeleteAction());
    tipDatesPanel = new TipDatesPanel(this);
    traitsPanel = new TraitsPanel(this, dataPanel, getImportTraitsAction());
    taxonSetPanel = new TaxonSetPanel(this);
    speciesSetPanel = new SpeciesSetPanel(this);
    siteModelsPanel = new SiteModelsPanel(this, getDeleteAction());
    ancestralStatesPanel = new AncestralStatesPanel(this);
    clockModelsPanel = new ClockModelsPanel(this);
    //        clockModelsPanel = new OldClockModelsPanel(this);
    //        oldTreesPanel = new OldTreesPanel(this);
    treesPanel = new TreesPanel(this, getDeleteAction());
    //        speciesTreesPanel = new SpeciesTreesPanel(this);
    priorsPanel = new PriorsPanel(this, false);
    operatorsPanel = new OperatorsPanel(this);
    mcmcPanel = new MCMCPanel(this);
    int index = 0;
    tabbedPane.addTab(DATA_PARTITIONS, dataPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Import sequence alignments, organize data partitions,<br>" + "link models between partitions and select *BEAST</html>");
    tabbedPane.addTab(TAXON_SETS, taxonSetPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Create and edit sets of taxa which can be used to <br>" + "define times of most recent common ancestors and <br>" + "to keep groups monophyletic.</html>");
    //        tabbedPane.addTab("Species Sets", speciesSetPanel);
    tabbedPane.addTab(TIP_DATES, tipDatesPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Specify sampling dates of tips for use in temporal <br>" + "analyses of measurably evolving populations.</html>");
    tabbedPane.addTab(TRAITS, traitsPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Import and organize continuous and discrete traits <br>" + "for taxa, convert them into data partitions for evolutionary<br>" + "analysis.</html>");
    tabbedPane.addTab(SITE_MODELS, siteModelsPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Select evolutionary models to be used for each data <br>" + "partition including substitution models, codon partitioning<br>" + "and trait evolution models.</html>");
    tabbedPane.addTab(CLOCK_MODELS, clockModelsPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Select relaxed molecular clock models to be used across <br>" + "the tree. Specify sampling of rates.</html>");
    tabbedPane.addTab(TREES, treesPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Select the priors on trees including coalescent models<br>" + "birth-death speciation models and the *BEAST gene tree,<br>" + "species tree options.</html>");
    tabbedPane.addTab(ANCESTRAL_STATES, ancestralStatesPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Select options for sampling ancestral states at specific<br>" + "or all common ancestors, models of counting state changes<br>" + "and models of sequencing error for data partitions.</html>");
    tabbedPane.addTab(PRIORS, priorsPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Specify prior probability distributions on each and every<br>" + "parameter of the current model.</html>");
    tabbedPane.addTab(OPERATORS, operatorsPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Select and adjust the menu of operators that will be used<br>" + "to propose changes to the parameters. Switch off operators<br>" + "on certain parameters to fix them to initial values.</html>");
    tabbedPane.addTab(MCMC, mcmcPanel);
    tabbedPane.setToolTipTextAt(index++, "<html>" + "Specify the details of MCMC sampling. This includes chain<br>" + "length, sampling frequencies, log file names and more.</html>");
    for (int i = 1; i < tabbedPane.getTabCount(); i++) {
        tabbedPane.setEnabledAt(i, false);
    }
    currentPanel = (BeautiPanel) tabbedPane.getSelectedComponent();
    tabbedPane.addChangeListener(new ChangeListener() {

        public void stateChanged(ChangeEvent e) {
            BeautiPanel selectedPanel = (BeautiPanel) tabbedPane.getSelectedComponent();
            if (selectedPanel == dataPanel) {
                dataPanel.selectionChanged();
            } else {
                getDeleteAction().setEnabled(false);
            }
            currentPanel.getOptions(options);
            setAllOptions();
            currentPanel = selectedPanel;
        }
    });
    JPanel basePanel = new JPanel(new BorderLayout(6, 6));
    basePanel.setBorder(new BorderUIResource.EmptyBorderUIResource(new java.awt.Insets(12, 12, 12, 12)));
    //        basePanel.setPreferredSize(new java.awt.Dimension(800, 600));
    getExportAction().setEnabled(false);
    JButton generateButton = new JButton(getExportAction());
    generateButton.putClientProperty("JButton.buttonType", "roundRect");
    JPanel panel2 = new JPanel(new BorderLayout(6, 6));
    panel2.add(statusLabel, BorderLayout.WEST);
    panel2.add(generateButton, BorderLayout.EAST);
    panel2.setMinimumSize(new java.awt.Dimension(10, 10));
    basePanel.add(tabbedPane, BorderLayout.CENTER);
    basePanel.add(panel2, BorderLayout.SOUTH);
    add(basePanel, BorderLayout.CENTER);
    Toolkit tk = Toolkit.getDefaultToolkit();
    Dimension d = tk.getScreenSize();
    if (d.width < 1000 || d.height < 700) {
        setSize(new java.awt.Dimension(700, 550));
    } else {
        setSize(new java.awt.Dimension(1024, 768));
    }
    if (OSType.isMac()) {
        setMinimumSize(new java.awt.Dimension(640, 480));
    }
    setAllOptions();
    Color focusColor = UIManager.getColor("Focus.color");
    Border focusBorder = BorderFactory.createMatteBorder(2, 2, 2, 2, focusColor);
    dataPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    new FileDrop(null, dataPanel, focusBorder, new FileDrop.Listener() {

        public void filesDropped(java.io.File[] files) {
            importFiles(files);
        }
    });
// end FileDrop.Listener
}
Also used : AncestralStatesPanel(dr.app.beauti.ancestralStatesPanel.AncestralStatesPanel) PriorsPanel(dr.app.beauti.priorsPanel.PriorsPanel) BorderUIResource(javax.swing.plaf.BorderUIResource) SpeciesSetPanel(dr.app.beauti.taxonsetspanel.SpeciesSetPanel) FileDrop(dr.app.gui.FileDrop) TraitsPanel(dr.app.beauti.traitspanel.TraitsPanel) TipDatesPanel(dr.app.beauti.tipdatepanel.TipDatesPanel) TaxonSetPanel(dr.app.beauti.taxonsetspanel.TaxonSetPanel) MCMCPanel(dr.app.beauti.mcmcpanel.MCMCPanel) OperatorsPanel(dr.app.beauti.operatorspanel.OperatorsPanel) ClockModelsPanel(dr.app.beauti.clockModelsPanel.ClockModelsPanel) ChangeListener(javax.swing.event.ChangeListener) TreesPanel(dr.app.beauti.treespanel.TreesPanel) SiteModelsPanel(dr.app.beauti.siteModelsPanel.SiteModelsPanel) ChangeEvent(javax.swing.event.ChangeEvent) DataPanel(dr.app.beauti.datapanel.DataPanel) Border(javax.swing.border.Border) java.awt(java.awt)

Aggregations

AncestralStatesPanel (dr.app.beauti.ancestralStatesPanel.AncestralStatesPanel)1 ClockModelsPanel (dr.app.beauti.clockModelsPanel.ClockModelsPanel)1 DataPanel (dr.app.beauti.datapanel.DataPanel)1 MCMCPanel (dr.app.beauti.mcmcpanel.MCMCPanel)1 OperatorsPanel (dr.app.beauti.operatorspanel.OperatorsPanel)1 PriorsPanel (dr.app.beauti.priorsPanel.PriorsPanel)1 SiteModelsPanel (dr.app.beauti.siteModelsPanel.SiteModelsPanel)1 SpeciesSetPanel (dr.app.beauti.taxonsetspanel.SpeciesSetPanel)1 TaxonSetPanel (dr.app.beauti.taxonsetspanel.TaxonSetPanel)1 TipDatesPanel (dr.app.beauti.tipdatepanel.TipDatesPanel)1 TraitsPanel (dr.app.beauti.traitspanel.TraitsPanel)1 TreesPanel (dr.app.beauti.treespanel.TreesPanel)1 FileDrop (dr.app.gui.FileDrop)1 java.awt (java.awt)1 Border (javax.swing.border.Border)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ChangeListener (javax.swing.event.ChangeListener)1 BorderUIResource (javax.swing.plaf.BorderUIResource)1