本文整理汇总了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;
}
示例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;
}
示例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;
}