MCPcopy Create free account
hub / github.com/rambaut/figtree / showTree

Method showTree

src/figtree/treeviewer/DefaultTreeViewer.java:172–190  ·  view source on GitHub ↗
(int index)

Source from the content-addressed store, hash-verified

170 }
171
172 public void showTree(int index) {
173 if (isRootingOn() && getRootingType() == TreePane.RootingType.USER_ROOTING) {
174 JOptionPane.showMessageDialog(frame, "Cannot switch trees when user rooting option is on.\n" +
175 "Turn this option off to switch trees",
176 "Unable to switch trees",
177 JOptionPane.ERROR_MESSAGE);
178 return;
179 }
180
181 Tree tree = trees.get(index);
182 if (tree instanceof RootedTree) {
183 treePane.setTree((RootedTree)tree);
184 } else {
185 treePane.setTree(Utils.rootTheTree(tree));
186 }
187
188 currentTreeIndex = index;
189 fireTreeChanged();
190 }
191
192 public void showNextTree() {
193 if (currentTreeIndex < trees.size() - 1) {

Callers 5

setTreeMethod · 0.95
setTreesMethod · 0.95
addTreesMethod · 0.95
showNextTreeMethod · 0.95
showPreviousTreeMethod · 0.95

Calls 5

isRootingOnMethod · 0.95
getRootingTypeMethod · 0.95
fireTreeChangedMethod · 0.95
getMethod · 0.65
setTreeMethod · 0.45

Tested by

no test coverage detected