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

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

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

JTree.getInsets介绍

暂无

代码示例

代码示例来源:origin: jcbvm/i18n-editor

@Override
public Rectangle getPathBounds(JTree tree, TreePath path) {
  if (tree != null && treeState != null) {
    return getPathBounds(path, tree.getInsets(), new Rectangle());
  }
  return null;
}

代码示例来源:origin: net.java.dev.swing-layout/swing-layout

private int getTreeBaseline(JTree tree, int height) {
  int rowHeight = tree.getRowHeight();
  if (TREE_LABEL == null) {
    TREE_LABEL = new JLabel("X");
    TREE_LABEL.setIcon(UIManager.getIcon("Tree.closedIcon"));
  }
  JLabel label = TREE_LABEL;
  label.setFont(tree.getFont());
  if (rowHeight <= 0) {
    rowHeight = label.getPreferredSize().height;
  }
  return getLabelBaseline(label, rowHeight) + tree.getInsets().top;
}

代码示例来源:origin: net.java.dev.swing-layout/swing-layout

private static int getTreeBaseline(JTree tree, int height) {
  int rowHeight = tree.getRowHeight();
  if (TREE_LABEL == null) {
    TREE_LABEL = new JLabel("X");
    TREE_LABEL.setIcon(UIManager.getIcon("Tree.closedIcon"));
  }
  JLabel label = TREE_LABEL;
  label.setFont(tree.getFont());
  if (rowHeight <= 0) {
    rowHeight = label.getPreferredSize().height;
  }
  return getLabelBaseline(label, rowHeight) + tree.getInsets().top;
}

代码示例来源:origin: org.java.net.substance/substance

@Override
public Rectangle getPathBounds(JTree tree, TreePath path) {
  Rectangle result = super.getPathBounds(tree, path);
  if (result != null) {
    if (tree.getComponentOrientation().isLeftToRight()) {
      result.width = tree.getWidth() - tree.getInsets().right
          - result.x;
    } else {
      int delta = result.x - tree.getInsets().left;
      result.x -= delta;
      result.width += delta;
    }
  }
  return result;
}

代码示例来源:origin: com.github.insubstantial/substance

@Override
public Rectangle getPathBounds(JTree tree, TreePath path) {
  Rectangle result = super.getPathBounds(tree, path);
  if (result != null) {
    if (!tree.getComponentOrientation().isLeftToRight()) {
      int delta = result.x - tree.getInsets().left;
      result.x -= delta;
      result.width += delta;
    }
  }
  return result;
}

代码示例来源:origin: com.github.insubstantial/substance

@Override
  public void run() {
    if (SubstanceTreeUI.this.tree == null) {
      // may happen if the LAF was switched in the meantime
      return;
    }
    Rectangle boundsBuffer = new Rectangle();
    Rectangle bounds = treeState.getBounds(treePath,
        boundsBuffer);
    if (bounds != null) {
      // still visible
      // fix for defect 180 - refresh the entire row
      bounds.x = 0;
      bounds.width = tree.getWidth();
      // fix for defect 188 - rollover effects for trees
      // with insets
      Insets insets = tree.getInsets();
      bounds.x += insets.left;
      bounds.y += insets.top;
      tree.repaint(bounds);
    }
  }
});

代码示例来源:origin: org.java.net.substance/substance

public void run() {
    if (SubstanceTreeUI.this.tree == null) {
      // may happen if the LAF was switched in the meantime
      return;
    }
    Rectangle boundsBuffer = new Rectangle();
    Rectangle bounds = treeState.getBounds(treePath,
        boundsBuffer);
    if (bounds != null) {
      // still visible
      // fix for defect 180 - refresh the entire row
      bounds.x = 0;
      bounds.width = tree.getWidth();
      // fix for defect 188 - rollover effects for trees
      // with insets
      Insets insets = tree.getInsets();
      bounds.x += insets.left;
      bounds.y += insets.top;
      tree.repaint(bounds);
    }
  }
});

代码示例来源:origin: com.github.insubstantial/substance

Rectangle bounds;
TreePath path;
Insets insets = tree.getInsets();

代码示例来源:origin: org.java.net.substance/substance

Rectangle bounds;
TreePath path;
Insets insets = tree.getInsets();

代码示例来源:origin: org.java.net.substance/substance

Insets insets = tree.getInsets();

代码示例来源:origin: com.github.insubstantial/substance

Insets insets = tree.getInsets();

代码示例来源:origin: org.java.net.substance/substance

Rectangle rowRectangle = new Rectangle(this.tree.getInsets().left,
    bounds.y, this.tree.getWidth() - this.tree.getInsets().right
        - this.tree.getInsets().left, bounds.height);
if (dropLocation != null && dropLocation.getChildIndex() == -1
    && tree.getRowForPath(dropLocation.getPath()) == row) {
this.rendererPane.paintComponent(g2d, renderer, this.tree, bounds.x,
    bounds.y, Math.max(this.tree.getWidth()
        - this.tree.getInsets().right
        - this.tree.getInsets().left - bounds.x, bounds.width),
    bounds.height, true);
if (!newOpaque)

代码示例来源:origin: com.github.insubstantial/substance

Rectangle rowRectangle = new Rectangle(this.tree.getInsets().left,
    bounds.y, this.tree.getWidth() - this.tree.getInsets().right
        - this.tree.getInsets().left, bounds.height);
if (dropLocation != null && dropLocation.getChildIndex() == -1
    && tree.getRowForPath(dropLocation.getPath()) == row) {
this.rendererPane.paintComponent(g2d, renderer, this.tree, bounds.x,
    bounds.y, Math.max(this.tree.getWidth()
        - this.tree.getInsets().right
        - this.tree.getInsets().left - bounds.x, bounds.width),
    bounds.height, true);
if (!newOpaque)

代码示例来源:origin: khuxtable/seaglass

Insets insets = tree.getInsets();
TreePath initialPath = getClosestPathForLocation(tree, 0, paintBounds.y);
Enumeration paintingEnumerator = treeState.getVisiblePathsFrom(initialPath);

相关文章

JTree类方法