JavaFXTable.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:JVx.javafx 作者:
/**
 * Checks if the given {@link MouseEvent} is on the selected cell.
 * 
 * @param pMouseEvent the {@link MouseEvent}.
 * @return {@code true} if the given event is on the selected cell.
 */
private boolean isOnSelectedCell(MouseEvent pMouseEvent)
{
    EventTarget target = pMouseEvent.getTarget();

    if (target instanceof Node)
    {
        boolean isCellSelection = resource.getSelectionModel().isCellSelectionEnabled();

        Node targetNode = (Node)target;

        while (targetNode != null && !(targetNode instanceof FXDataBookView))
        {
            if (isCellSelection && targetNode instanceof TableCell<?, ?>)
            {
                return ((TableCell<?, ?>)targetNode).isSelected();
            }
            else if (!isCellSelection && targetNode instanceof TableRow<?>)
            {
                return ((TableRow<?>)targetNode).isSelected();
            }

            targetNode = targetNode.getParent();
        }
    }

    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号