Java JTree getStopRow(JTree tree, int startRow)

Here you can find the source of getStopRow(JTree tree, int startRow)

Description

get Stop Row

License

Open Source License

Declaration

private static int getStopRow(JTree tree, int startRow) 

Method Source Code

//package com.java2s;

import javax.swing.JTree;

public class Main {
    private static int getStopRow(JTree tree, int startRow) {
        int startDepth = tree.getPathForRow(startRow).getPathCount();
        int last = tree.getRowCount();
        int stopRow = last;
        for (int i = startRow + 1; i < last; ++i) {
            int depth = tree.getPathForRow(i).getPathCount();
            if (depth <= startDepth) {
                stopRow = i;//from  w  ww  .j  a v  a  2s .co  m
                break;
            }
        }
        return stopRow;
    }
}

Related

  1. findTree(Container container)
  2. getCurrentWidth(JTree tree, int row)
  3. getExpansionState(JTree tree, int row)
  4. getProjectTree()
  5. getSelectionFromTree(JTree tree)
  6. getTreeImage(String imageName)
  7. getTreeObject(JTree tree, Class type)
  8. getTreeSelectionBorderColor()
  9. isPointOnTree(JTree tree, Point location)