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


Java PNode.fullPick方法代码示例

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


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

示例1: fullPick

import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
public boolean fullPick( PPickPath pickPath ) {
    if ( !clipEnabled ) {
        return super.fullPick( pickPath );
    }
    if ( getPickable() && fullIntersects( pickPath.getPickBounds() ) ) {
        pickPath.pushNode( this );
        pickPath.pushTransform( getTransformReference( false ) );

        if ( pick( pickPath ) ) {
            return true;
        }

        if ( getChildrenPickable() && getPathReference().intersects( pickPath.getPickBounds() ) ) {
            int count = getChildrenCount();
            for ( int i = count - 1; i >= 0; i-- ) {
                PNode each = getChild( i );
                if ( each.fullPick( pickPath ) ) {
                    return true;
                }
            }
        }

        if ( pickAfterChildren( pickPath ) ) {
            return true;
        }

        pickPath.popTransform( getTransformReference( false ) );
        pickPath.popNode( this );
    }

    return false;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:33,代码来源:TogglePClip.java

示例2: fullPick

import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
/**
 * Try to pick this node and all of its descendants if they are visible in
 * the clipping region.
 * 
 * @param pickPath the pick path to add the node to if its picked
 * @return true if this node or one of its descendants was picked.
 */
public boolean fullPick(final PPickPath pickPath) {
    if (getPickable() && fullIntersects(pickPath.getPickBounds())) {
        pickPath.pushNode(this);
        pickPath.pushTransform(getTransformReference(false));

        if (pick(pickPath)) {
            return true;
        }

        if (getChildrenPickable() && getPathReference().intersects(pickPath.getPickBounds())) {
            final int count = getChildrenCount();
            for (int i = count - 1; i >= 0; i--) {
                final PNode each = getChild(i);
                if (each.fullPick(pickPath)) {
                    return true;
                }
            }
        }

        if (pickAfterChildren(pickPath)) {
            return true;
        }

        pickPath.popTransform(getTransformReference(false));
        pickPath.popNode(this);
    }

    return false;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:37,代码来源:PClip.java


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