• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java TreeDistribution类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中beast.evolution.tree.TreeDistribution的典型用法代码示例。如果您正苦于以下问题:Java TreeDistribution类的具体用法?Java TreeDistribution怎么用?Java TreeDistribution使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

TreeDistribution类属于beast.evolution.tree包,在下文中一共展示了TreeDistribution类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: validateInput

点赞 3

import beast.evolution.tree.TreeDistribution; //导入依赖的package包/类
@Override
public void validateInput() {
    TreeDistribution distr = (TreeDistribution) m_beastObject;
    // TODO: robustify for the case the tree is not a simple binary tree
    Tree tree = (Tree) distr.treeInput.get();
    if (tree == null) {
        tree = distr.treeIntervalsInput.get().treeInput.get();
    }
    if (tree.hasDateTrait()) {
        if (!distr.canHandleTipDates()) {
            m_validateLabel.setToolTipText("This tree prior cannot handle dated tips. Choose another tree prior.");
            m_validateLabel.m_circleColor = Color.red;
            m_validateLabel.setVisible(true);
            return;
        }
    }

    super.validateInput();
}
 

开发者ID:CompEvol,
项目名称:beast2,
代码行数:20,
代码来源:TreeDistributionInputEditor.java

示例2: init

点赞 3

import beast.evolution.tree.TreeDistribution; //导入依赖的package包/类
@Override
    public void init(Input<?> input, BEASTInterface beastObject, int itemNr, ExpandOption isExpandOption, boolean addButtons) {
        useDefaultBehavior = !((beastObject instanceof beast.math.distributions.Prior) || beastObject instanceof MRCAPrior || beastObject instanceof TreeDistribution);

//    	if (useDefaultBehavior && false) {
//    		super.init(input, beastObject, isExpandOption, addButtons);
//    	} else {
        m_bAddButtons = addButtons;
        m_input = input;
        m_beastObject = beastObject;
		this.itemNr = itemNr;
        if (input.get() != null) {
            super.init(input, beastObject, itemNr, ExpandOption.TRUE, addButtons);
        }
        add(createGraph());
//    	}
    }
 

开发者ID:CompEvol,
项目名称:beast2,
代码行数:18,
代码来源:ParametricDistributionInputEditor.java

示例3: init

点赞 2

import beast.evolution.tree.TreeDistribution; //导入依赖的package包/类
@Override
  public void init(Input<?> input, BEASTInterface beastObject, int itemNr, ExpandOption isExpandOption, boolean addButtons) {
  	List<?> list = (List<?>) input.get();
  	Collections.sort(list, (Object o1, Object o2) -> {
		if (o1 instanceof BEASTInterface && o2 instanceof BEASTInterface) {
			String d1 = ((BEASTInterface)o1).getID();
			String id2 = ((BEASTInterface)o2).getID();
			// first the tree priors
			if (o1 instanceof TreeDistribution) {
				if (o2 instanceof TreeDistribution) {
					TreeInterface tree1 = ((TreeDistribution)o1).treeInput.get();
					if (tree1 == null) {
						tree1 = ((TreeDistribution)o1).treeIntervalsInput.get().treeInput.get();
					}
					TreeInterface tree2 = ((TreeDistribution)o2).treeInput.get();
					if (tree2 == null) {
						tree2 = ((TreeDistribution)o2).treeIntervalsInput.get().treeInput.get();
					}
					return d1.compareTo(id2);
				} else {
					return -1;
				}
			} else if (o1 instanceof MRCAPrior) {
				// last MRCA priors
				if (o2 instanceof MRCAPrior) {
					return d1.compareTo(id2);
				} else {
					return 1;
				}
			} else {
				if (o2 instanceof TreeDistribution) {
					return 1;
				}
				if (o2 instanceof MRCAPrior) {
					return -1;
				}
				if (o1 instanceof Prior) {
					d1 = ((Prior) o1).getParameterName(); 
				}
				if (o2 instanceof Prior) {
					id2 = ((Prior) o2).getParameterName(); 
				}
				return d1.compareTo(id2);
			}
		}
		return 0;
	}
);
  	
  	
      rangeButtons = new ArrayList<>();
      taxonButtons = new ArrayList<>();
      
      //m_buttonStatus = ButtonStatus.NONE;
      super.init(input, beastObject, itemNr, isExpandOption, addButtons);

      
      if (beastObject instanceof BeautiPanelConfig) {
      	BeautiPanelConfig config = (BeautiPanelConfig) beastObject;
      	if (config.parentBEASTObjects != null && config.parentBEASTObjects.size() > 0 && config.parentBEASTObjects.get(0).getID().equals("speciescoalescent")) {
      		m_buttonStatus = ButtonStatus.NONE;
      	}
      }
      
      if (m_buttonStatus == ButtonStatus.ALL || m_buttonStatus == ButtonStatus.ADD_ONLY) {
       addButton = new SmallButton("+ Add Prior", true);
       addButton.setName("addItem");
       addButton.setToolTipText("Add new prior (like an MRCA-prior) to the list of priors");
       addButton.addActionListener(e -> {
               addItem();
           });
       buttonBox.add(addButton);
          buttonBox.add(Box.createHorizontalGlue());
      }
  }
 

开发者ID:CompEvol,
项目名称:beast2,
代码行数:76,
代码来源:PriorListInputEditor.java

示例4: type

点赞 2

import beast.evolution.tree.TreeDistribution; //导入依赖的package包/类
@Override
public Class<?> type() {
    return TreeDistribution.class;
}
 

开发者ID:CompEvol,
项目名称:beast2,
代码行数:5,
代码来源:TreeDistributionInputEditor.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)