javax.swing.JTree.getVisibleRect()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中javax.swing.JTree.getVisibleRect()方法的一些代码示例,展示了JTree.getVisibleRect()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.getVisibleRect()方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:getVisibleRect

JTree.getVisibleRect介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-explorer

void scrollTreeToVisible(TreePath path, TreeNode child) {
  Rectangle base = tree.getVisibleRect();
  Rectangle b1 = tree.getPathBounds(path);
  Rectangle b2 = tree.getPathBounds(new TreePath(treeModel.getPathToRoot(child)));
  if ((base != null) && (b1 != null) && (b2 != null)) {
    tree.scrollRectToVisible(new Rectangle(base.x, b1.y, 1, b2.y - b1.y + b2.height));
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

void scrollTreeToVisible(TreePath path, TreeNode child) {
  Rectangle base = tree.getVisibleRect();
  Rectangle b1 = tree.getPathBounds(path);
  Rectangle b2 = tree.getPathBounds(new TreePath(treeModel.getPathToRoot(child)));
  if (base != null && b1 != null && b2 != null) {
    tree.scrollRectToVisible(new Rectangle(base.x, b1.y, 1, b2.y - b1.y + b2.height));
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

void scrollTreeToVisible(TreePath path, TreeNode child) {
  Rectangle base = tree.getVisibleRect();
  Rectangle b1 = tree.getPathBounds(path);
  Rectangle b2 = tree.getPathBounds(new TreePath(treeModel.getPathToRoot(child)));
  if (base != null && b1 != null && b2 != null) {
    tree.scrollRectToVisible(new Rectangle(base.x, b1.y, 1, b2.y - b1.y + b2.height));
  }
}

代码示例来源:origin: gurkenlabs/litiengine

bounds.height = this.tree.getVisibleRect().height;
this.tree.scrollRectToVisible(bounds);
return true;

代码示例来源:origin: info.aduna.commons/aduna-commons-swing

row = tree.getRowForPath(path);
bounds = tree.getPathBounds(path);
Rectangle visibleRect = tree.getVisibleRect();

代码示例来源:origin: org.biomoby/taverna-biomoby

public void mouseMoved(MouseEvent me) {
    path = tree.getPathForLocation(me.getX(), me.getY());
    if (path == null) {
      resetGlassPane();
      return;
    }
    row = tree.getRowForPath(path);
    bounds = tree.getPathBounds(path);
    if (!tree.getVisibleRect().contains(bounds)) {
      if (oldGlassPane == null) {
        oldGlassPane = tree.getRootPane().getGlassPane();
        c.setOpaque(false);
        tree.getRootPane().setGlassPane(c);
        c.setVisible(true);
      } else
        tree.getRootPane().repaint();
    } else {
      resetGlassPane();
    }
  }
}

相关文章

JTree类方法