本文整理了Java中javafx.scene.Node.isCache()
方法的一些代码示例,展示了Node.isCache()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.isCache()
方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:isCache
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
/**
* this method will cache the node only if it wasn't cached before
*/
public void cache() {
if (!isCached.getAndSet(true)) {
this.cache = node.isCache();
this.cacheHint = node.getCacheHint();
node.setCache(true);
node.setCacheHint(CacheHint.SPEED);
if (node instanceof Region) {
this.cacheShape = ((Region) node).isCacheShape();
this.snapToPixel = ((Region) node).isSnapToPixel();
((Region) node).setCacheShape(true);
((Region) node).setSnapToPixel(true);
}
}
}
代码示例来源:origin: com.github.giulianini.jestures/jestures
/**
* Cache deeply.
*
* @param node
* the {@link Node}
*/
public static void cacheDeeply(final Node node) {
if (!node.isCache()) {
node.setCache(true);
node.setCacheHint(CacheHint.SPEED);
}
if (node instanceof Parent) {
final Parent parent = (Parent) node;
final ObservableList<Node> children = parent.getChildrenUnmodifiable();
for (final Node child : children) {
ViewUtilities.cacheDeeply(child);
}
}
}
代码示例来源:origin: com.jfoenix/jfoenix
/**
* this method will cache the node only if it wasn't cached before
*/
public void cache() {
if (!isCached.getAndSet(true)) {
this.cache = node.isCache();
this.cacheHint = node.getCacheHint();
node.setCache(true);
node.setCacheHint(CacheHint.SPEED);
if (node instanceof Region) {
this.cacheShape = ((Region) node).isCacheShape();
this.snapToPixel = ((Region) node).isSnapToPixel();
((Region) node).setCacheShape(true);
((Region) node).setSnapToPixel(true);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!