MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / setSelectionRows

Method setSelectionRows

unused/javax/swing/JTree.java:1726–1738  ·  view source on GitHub ↗

Selects the nodes corresponding to each of the specified rows in the display. If a particular element of rows is < 0 or >= getRowCount , it will be ignored. If none of the elements in rows are valid rows, the selection will be cleared. That is it will be a

(int[] rows)

Source from the content-addressed store, hash-verified

1724 * where 0 indicates the first row in the display
1725 */
1726 public void setSelectionRows(int[] rows) {
1727 TreeUI ui = getUI();
1728
1729 if(ui != null && rows != null) {
1730 int numRows = rows.length;
1731 TreePath[] paths = new TreePath[numRows];
1732
1733 for(int counter = 0; counter < numRows; counter++) {
1734 paths[counter] = ui.getPathForRow(this, rows[counter]);
1735 }
1736 setSelectionPaths(paths);
1737 }
1738 }
1739
1740 /**
1741 * Adds the node identified by the specified <code>TreePath</code>

Callers 1

setSelectionRowMethod · 0.95

Calls 3

getUIMethod · 0.95
setSelectionPathsMethod · 0.95
getPathForRowMethod · 0.80

Tested by

no test coverage detected