本文整理汇总了Java中edu.umd.cs.piccolo.PNode.getPickable方法的典型用法代码示例。如果您正苦于以下问题:Java PNode.getPickable方法的具体用法?Java PNode.getPickable怎么用?Java PNode.getPickable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.umd.cs.piccolo.PNode
的用法示例。
在下文中一共展示了PNode.getPickable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNeighbors
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
/**
* Returns all pickable nodes that are 1 hop away from the currently focused
* node. This includes, parent, children, and siblings.
*
* @return list of nodes that are 1 hop away from the current focusNode
*/
public List getNeighbors() {
final ArrayList result = new ArrayList();
if (focusNode == null || focusNode.getParent() == null) {
return result;
}
final PNode focusParent = focusNode.getParent();
final Iterator i = focusParent.getChildrenIterator();
while (i.hasNext()) {
final PNode each = (PNode) i.next();
if (each != focusNode && each.getPickable()) {
result.add(each);
}
}
result.add(focusParent);
result.addAll(focusNode.getChildrenReference());
return result;
}
示例2: accept
import edu.umd.cs.piccolo.PNode; //导入方法依赖的package包/类
/**
* Returns true if the node is an acceptable selection.
*
* @param node node being tested
* @return true if node is an acceptable selection
*/
public boolean accept(final PNode node) {
localBounds.setRect(bounds);
node.globalToLocal(localBounds);
final boolean boundsIntersects = node.intersects(localBounds);
final boolean isMarquee = node == marquee;
return node.getPickable() && boundsIntersects && !isMarquee && !selectableParents.contains(node)
&& !isCameraLayer(node);
}