當前位置: 首頁>>代碼示例>>Java>>正文


Java PPickPath.pushNode方法代碼示例

本文整理匯總了Java中org.piccolo2d.util.PPickPath.pushNode方法的典型用法代碼示例。如果您正苦於以下問題:Java PPickPath.pushNode方法的具體用法?Java PPickPath.pushNode怎麽用?Java PPickPath.pushNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.piccolo2d.util.PPickPath的用法示例。


在下文中一共展示了PPickPath.pushNode方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fullPick

import org.piccolo2d.util.PPickPath; //導入方法依賴的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:piccolo2d,項目名稱:piccolo2d.java,代碼行數:37,代碼來源:PClip.java

示例2: pick

import org.piccolo2d.util.PPickPath; //導入方法依賴的package包/類
/**
 * Generate and return a PPickPath for the point x,y specified in the local
 * coord system of this camera. Picking is done with a rectangle, halo
 * specifies how large that rectangle will be.
 * 
 * @param x the x coordinate of the pick path given in local coordinates
 * @param y the y coordinate of the pick path given in local coordinates
 * @param halo the distance from the x,y coordinate that is considered for
 *            inclusion in the pick path
 * 
 * @return the picked path
 */
public PPickPath pick(final double x, final double y, final double halo) {
    final PBounds b = new PBounds(new Point2D.Double(x, y), -halo, -halo);
    final PPickPath result = new PPickPath(this, b);

    fullPick(result);

    // make sure this camera is pushed.
    if (result.getNodeStackReference().size() == 0) {
        result.pushNode(this);
        result.pushTransform(getTransformReference(false));
    }

    return result;
}
 
開發者ID:piccolo2d,項目名稱:piccolo2d.java,代碼行數:27,代碼來源:PCamera.java

示例3: fullPick

import org.piccolo2d.util.PPickPath; //導入方法依賴的package包/類
/**
 * Try to pick this node and all of its descendants. Most subclasses should
 * not need to override this method. Instead they should override
 * <code>pick</code> or <code>pickAfterChildren</code>.
 * 
 * @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 (getVisible() && (getPickable() || getChildrenPickable()) && fullIntersects(pickPath.getPickBounds())) {
        pickPath.pushNode(this);
        pickPath.pushTransform(transform);

        final boolean thisPickable = getPickable() && pickPath.acceptsNode(this);

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

        if (getChildrenPickable()) {
            final int count = getChildrenCount();
            for (int i = count - 1; i >= 0; i--) {
                final PNode each = (PNode) children.get(i);
                if (each.fullPick(pickPath)) {
                    return true;
                }
            }
        }

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

        pickPath.popTransform(transform);
        pickPath.popNode(this);
    }

    return false;
}
 
開發者ID:piccolo2d,項目名稱:piccolo2d.java,代碼行數:40,代碼來源:PNode.java


注:本文中的org.piccolo2d.util.PPickPath.pushNode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。