本文整理了Java中org.eclipse.swt.widgets.Tree.getBounds()
方法的一些代码示例,展示了Tree.getBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.getBounds()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:getBounds
暂无
代码示例来源:origin: BiglySoftware/BiglyBT
Rectangle treeBounds = tree.getBounds();
tree.redraw(0, bounds.y, treeBounds.width, bounds.height, true);
} catch (NullPointerException npe) {
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public Image obfuscatedImage(Image image) {
Rectangle treeBounds = tree.getBounds();
SideBarEntrySWT[] sideBarEntries = getEntries(
new SideBarEntrySWT[0]);
for (SideBarEntrySWT entry : sideBarEntries) {
Rectangle entryBounds = entry.swt_getBounds();
if (entryBounds != null && treeBounds.intersects(entryBounds)) {
entry.obfuscatedImage(image);
}
}
return image;
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public void mouseMove(MouseEvent e) {
if (tree.equals(e.getSource())) {
Object o= tree.getItem(new Point(e.x, e.y));
if (o instanceof TreeItem) {
if (!o.equals(fLastItem)) {
fLastItem= (TreeItem)o;
tree.setSelection(new TreeItem[] { fLastItem });
} else if (e.y < tree.getItemHeight() / 4) {
// Scroll up
Point p= tree.toDisplay(e.x, e.y);
Item item= fTreeViewer.scrollUp(p.x, p.y);
if (item instanceof TreeItem) {
fLastItem= (TreeItem)item;
tree.setSelection(new TreeItem[] { fLastItem });
}
} else if (e.y > tree.getBounds().height - tree.getItemHeight() / 4) {
// Scroll down
Point p= tree.toDisplay(e.x, e.y);
Item item= fTreeViewer.scrollDown(p.x, p.y);
if (item instanceof TreeItem) {
fLastItem= (TreeItem)item;
tree.setSelection(new TreeItem[] { fLastItem });
}
}
}
}
}
});
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
@Override
public void mouseMove(MouseEvent e) {
Tree tree = fTreeViewer.getTree();
if (tree.equals(e.getSource())) {
Object o = tree.getItem(new Point(e.x, e.y));
if (o instanceof TreeItem) {
if (!o.equals(fLastItem)) {
fLastItem = (TreeItem) o;
tree.setSelection(new TreeItem[] {fLastItem});
} else if (e.y < tree.getItemHeight() / 4) {
// Scroll up
Point p = tree.toDisplay(e.x, e.y);
Item item = fTreeViewer.scrollUp(p.x, p.y);
if (item instanceof TreeItem) {
fLastItem = (TreeItem) item;
tree.setSelection(new TreeItem[] {fLastItem});
}
} else if (e.y > tree.getBounds().height - tree.getItemHeight() / 4) {
// Scroll down
Point p = tree.toDisplay(e.x, e.y);
Item item = fTreeViewer.scrollDown(p.x, p.y);
if (item instanceof TreeItem) {
fLastItem = (TreeItem) item;
tree.setSelection(new TreeItem[] {fLastItem});
}
}
}
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
} else if (e.y > tree.getBounds().height - tree.getItemHeight() / 4) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
int treeHeight = getViewer().getTree().getBounds().height;
int numVisibleItems = treeHeight
/ getViewer().getTree().getItemHeight();
代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui
public void paintControl(PaintEvent event) {
GC gc = event.gc;
Rectangle treeBounds = fTree.getBounds();
内容来源于网络,如有侵权,请联系作者删除!