当前位置: 首页>>代码示例>>Java>>正文


Java Bounds.contains方法代码示例

本文整理汇总了Java中javafx.geometry.Bounds.contains方法的典型用法代码示例。如果您正苦于以下问题:Java Bounds.contains方法的具体用法?Java Bounds.contains怎么用?Java Bounds.contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.geometry.Bounds的用法示例。


在下文中一共展示了Bounds.contains方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIndexAt

import javafx.geometry.Bounds; //导入方法依赖的package包/类
protected int getIndexAt(ListView<?> listView, Point2D point) {
    if (point == null) {
        return listView.getSelectionModel().getSelectedIndex();
    }
    point = listView.localToScene(point);
    Set<Node> lookupAll = getListCells(listView);
    ListCell<?> selected = null;
    for (Node cellNode : lookupAll) {
        Bounds boundsInScene = cellNode.localToScene(cellNode.getBoundsInLocal(), true);
        if (boundsInScene.contains(point)) {
            selected = (ListCell<?>) cellNode;
            break;
        }
    }
    if (selected == null) {
        return -1;
    }
    return selected.getIndex();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:JavaFXElementPropertyAccessor.java

示例2: getRowAt

import javafx.geometry.Bounds; //导入方法依赖的package包/类
public int getRowAt(TreeView<?> treeView, Point2D point) {
    if (point == null) {
        return treeView.getSelectionModel().getSelectedIndex();
    }
    point = treeView.localToScene(point);
    int itemCount = treeView.getExpandedItemCount();
    @SuppressWarnings("rawtypes")
    List<TreeCell> cells = new ArrayList<>();
    for (int i = 0; i < itemCount; i++) {
        cells.add(getCellAt(treeView, i));
    }
    TreeCell<?> selected = null;
    for (Node cellNode : cells) {
        Bounds boundsInScene = cellNode.localToScene(cellNode.getBoundsInLocal(), true);
        if (boundsInScene.contains(point)) {
            selected = (TreeCell<?>) cellNode;
            break;
        }
    }
    if (selected == null) {
        return -1;
    }
    return selected.getIndex();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:25,代码来源:JavaFXElementPropertyAccessor.java

示例3: checkHit

import javafx.geometry.Bounds; //导入方法依赖的package包/类
private void checkHit(Node child, double x, double y, List<Node> hits, String indent) {
    Bounds boundsInParent = child.getBoundsInParent();
    if (boundsInParent.contains(x, y)) {
        hits.add(child);
        if (!(child instanceof Parent)) {
            return;
        }
        ObservableList<Node> childrenUnmodifiable = ((Parent) child).getChildrenUnmodifiable();
        for (Node node : childrenUnmodifiable) {
            checkHit(node, x, y, hits, "    " + indent);
        }
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:14,代码来源:FXEventQueueDevice.java

示例4: getTableCellAt

import javafx.geometry.Bounds; //导入方法依赖的package包/类
private TableCell<?, ?> getTableCellAt(TableView<?> tableView, Point2D point) {
    point = tableView.localToScene(point);
    Set<Node> lookupAll = getTableCells(tableView);
    TableCell<?, ?> selected = null;
    for (Node cellNode : lookupAll) {
        Bounds boundsInScene = cellNode.localToScene(cellNode.getBoundsInLocal(), true);
        if (boundsInScene.contains(point)) {
            selected = (TableCell<?, ?>) cellNode;
            break;
        }
    }
    return selected;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:14,代码来源:JavaFXElementPropertyAccessor.java

示例5: getTreeTableCellAt

import javafx.geometry.Bounds; //导入方法依赖的package包/类
public TreeTableCell<?, ?> getTreeTableCellAt(TreeTableView<?> treeTableView, Point2D point) {
    point = treeTableView.localToScene(point);
    Set<Node> lookupAll = getTreeTableCells(treeTableView);
    TreeTableCell<?, ?> selected = null;
    for (Node cellNode : lookupAll) {
        Bounds boundsInScene = cellNode.localToScene(cellNode.getBoundsInLocal(), true);
        if (boundsInScene.contains(point)) {
            selected = (TreeTableCell<?, ?>) cellNode;
            break;
        }
    }
    return selected;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:14,代码来源:JavaFXElementPropertyAccessor.java

示例6: positionToButtonIndex

import javafx.geometry.Bounds; //导入方法依赖的package包/类
/**
 * Get the index into the panes children that this node should be inserted to.
 * @param screenX Drop screen x position
 * @param screenY Drop screen y position
 * @param pane The pane of interest.
 * @return The index to insert the button into the panes children.
 */
private int positionToButtonIndex(Pane pane, double screenX, double screenY) {
    int idx = pane.getChildren().size();
    for (Node node: pane.getChildren()) {
        Bounds bounds = node.localToScreen(node.getBoundsInLocal());
        if (bounds.contains(screenX, screenY)) {
            idx = pane.getChildren().indexOf(node);
        }
    }
    return idx;
}
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:18,代码来源:DragPaneDecorator.java


注:本文中的javafx.geometry.Bounds.contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。