本文整理了Java中javax.swing.JTree.isPathSelected()
方法的一些代码示例,展示了JTree.isPathSelected()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.isPathSelected()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:isPathSelected
暂无
代码示例来源:origin: org.zaproxy/zap
@Override
public void mousePressed(MouseEvent e) {
TreePath path = treeParam.getClosestPathForLocation(e.getX(), e.getY());
if (path != null && !treeParam.isPathSelected(path)) {
treeParam.setSelectionPath(path);
}
}
});
代码示例来源:origin: joel-costigliola/assertj-swing
@Override
protected Pair<Boolean, Point> executeInEDT() {
boolean isSelected = (!singleSelectionRequired || tree.getSelectionCount() == 1) && tree.isPathSelected(path);
return Pair.of(isSelected, scrollToTreePath(tree, path, location));
}
});
代码示例来源:origin: UISpec4J/UISpec4J
private Rectangle setVisible(TreePath treePath) {
jTree.expandPath(treePath.getParentPath());
if (!jTree.isPathSelected(treePath)) {
jTree.setSelectionPath(treePath);
}
return getRectangle(treePath);
}
代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-extra
public Component getRendererComponent() {
TreeModel treeModel = tree.getModel();
TreePath treePath = tree.getPathForRow(rowIndex);
TreeCellRenderer renderer = tree.getCellRenderer();
boolean isSelected = tree.isPathSelected(treePath);
boolean isExpanded = tree.isExpanded(treePath);
boolean hasFocus = tree.hasFocus() && rowIndex == tree.getLeadSelectionRow();
Object item = treePath.getLastPathComponent();
boolean isLeaf = treeModel.isLeaf(item);
Component component = renderer.getTreeCellRendererComponent(tree, item, isSelected, isExpanded, isLeaf, rowIndex, hasFocus);
component.setFont(tree.getFont());
// FIX Nimbus white foreground on white background
if (isSelected) {
component.setForeground(UIManager.getColor("Tree.textForeground"));
}
return component;
}
代码示例来源:origin: org.nuiton/nuiton-widgets
public Component getRendererComponent() {
TreeModel treeModel = tree.getModel();
TreePath treePath = tree.getPathForRow(rowIndex);
TreeCellRenderer renderer = tree.getCellRenderer();
boolean isSelected = tree.isPathSelected(treePath);
boolean isExpanded = tree.isExpanded(treePath);
boolean hasFocus = tree.hasFocus() && rowIndex == tree.getLeadSelectionRow();
Object item = treePath.getLastPathComponent();
boolean isLeaf = treeModel.isLeaf(item);
Component component = renderer.getTreeCellRendererComponent(tree, item, isSelected, isExpanded, isLeaf, rowIndex, hasFocus);
component.setFont(tree.getFont());
// FIX Nimbus white foreground on white background
if (isSelected) {
component.setForeground(UIManager.getColor("Tree.textForeground"));
}
return component;
}
代码示例来源:origin: org.jspresso.framework/jspresso-swing-application
if (!tree.isPathSelected(path)) {
tree.setSelectionPath(path);
代码示例来源:origin: org.jspresso/jspresso-swing-application
if (!tree.isPathSelected(path)) {
tree.setSelectionPath(path);
代码示例来源:origin: google/sagetv
if (getTree().isPathSelected(path))
代码示例来源:origin: org.zaproxy/zap
TreePath nodePath = paths[i];
int childCount = ((DefaultMutableTreeNode) nodePath.getLastPathComponent()).getChildCount();
count += childCount != 0 ? childCount : (treeAlert.isPathSelected(nodePath.getParentPath()) ? 0 : 1);
内容来源于网络,如有侵权,请联系作者删除!