本文整理了Java中javafx.scene.Node.setCacheHint()
方法的一些代码示例,展示了Node.setCacheHint()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.setCacheHint()
方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:setCacheHint
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
public void restore() {
if (isCached.getAndSet(false)) {
node.setCache(cache);
node.setCacheHint(cacheHint);
if (node instanceof Region) {
((Region) node).setCacheShape(cacheShape);
((Region) node).setSnapToPixel(snapToPixel);
}
}
}
}
代码示例来源: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.jfoenix/jfoenix
public void restore() {
if (isCached.getAndSet(false)) {
node.setCache(cache);
node.setCacheHint(cacheHint);
if (node instanceof Region) {
((Region) node).setCacheShape(cacheShape);
((Region) node).setSnapToPixel(snapToPixel);
}
}
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void setContentItem(Node content) {
content.setCache(true);
content.setCacheHint(CacheHint.SPEED);
scroll.setContent(content);
NodeHelper.setHVGrow(content);
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void setCenter(Node node) {
node.setCache(true);
node.setCacheHint(CacheHint.SPEED);
Platform.runLater(() -> {
centerFixedAreaSection.getChildren().clear();
centerFixedAreaSection.getChildren().add(node);
});
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void setCenter(Node node) {
Platform.runLater(() -> {
node.setCache(true);
node.setCacheHint(CacheHint.SPEED);
centerFixedAreaSection.getChildren().clear();
centerFixedAreaSection.getChildren().add(node);
});
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void doBuildRightPane() {
try {
righSection = (FullTableViewController) StandardViewUtils.forId(getRootStructure(), structureContentController, rightSectionView);
Platform.runLater(() -> {
final Node rightSectionNode = righSection.processedView();
rightSectionNode.setCache(true);
rightSectionNode.setCacheHint(CacheHint.SPEED);
rightPane.getChildren().clear();
rightPane.getChildren().add(rightSectionNode);
});
} catch (final Exception ex) {
ex.printStackTrace();
}
}
代码示例来源: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);
}
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void doBuildCenterPane() {
try {
centerSectionView = getRootComponent().getPropertyValue("centerSectionView");
if (StringUtils.isNotBlank(centerSectionView)) {
centerViewController = StandardViewUtils.forId(getRootStructure(), structureContentController, centerSectionView);
NodeHelper.styleClassSetAll(rightPane, getRootComponent(), "centerSectionAreaStyleClass", "");
centerViewController.setParent(this);
Platform.runLater(() -> {
final Node centerSectionNode = centerViewController.processedView();
centerSectionNode.setCache(true);
centerSectionNode.setCacheHint(CacheHint.SPEED);
centerPane.getChildren().clear();
centerPane.getChildren().add(centerSectionNode);
});
}
} catch (final Exception ex) {
ex.printStackTrace();
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void doBuildRightPane() {
try {
final String rightSectionView = getRootComponent().getPropertyValue("rightSectionView");
if (StringUtils.isNotBlank(rightSectionView)) {
rightController = StandardViewUtils.forId(getRootStructure(), structureContentController, rightSectionView);
NodeHelper.styleClassSetAll(rightPane, getRootComponent(), "rightSectionAreaStyleClass", "");
rightController.setParent(this);
Platform.runLater(() -> {
final Node rightSectionNode = rightController.processedView();
rightSectionNode.setCache(true);
rightSectionNode.setCacheHint(CacheHint.SPEED);
rightPane.getChildren().clear();
rightPane.getChildren().add(rightSectionNode);
});
}
} catch (final Exception ex) {
ex.printStackTrace();
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void doBuildCenterPane() {
try {
centerSectionView = getRootComponent().getPropertyValue("centerSectionView");
if (StringUtils.isNotBlank(centerSectionView)) {
tableViewController = (FullTableViewController) StandardViewUtils.forId(getRootStructure(), structureContentController, centerSectionView);
NodeHelper.styleClassSetAll(centerPane, getRootComponent(), "centerSectionAreaStyleClass", "");
tableViewController.getStructureContent().setCurrentEditingTableStructure(tableViewController);
tableViewController.setParent(this);
tableViewController.forceLoadFirstPage();
Platform.runLater(() -> {
final Node centerSectionNode = tableViewController.processedView();
centerSectionNode.setCache(true);
centerSectionNode.setCacheHint(CacheHint.SPEED);
centerPane.getChildren().clear();
centerPane.getChildren().add(centerSectionNode);
});
}
} catch (final Exception ex) {
ex.printStackTrace();
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void doBuildRightPane() {
try {
rightSectionView = getRootComponent().getPropertyValue("rightSectionView");
if (StringUtils.isNotBlank(rightSectionView)) {
tableViewController = StandardViewUtils.forId(getRootStructure(), structureContentController, rightSectionView);
NodeHelper.styleClassSetAll(rightPane, getRootComponent(), "rightSectionAreaStyleClass", "");
if(tableViewController instanceof FullTableStructureController) {
tableViewController.getStructureContent().setCurrentEditingTableStructure(tableViewController);
}
tableViewController.setParent(this);
// tableViewController.forceLoadFirstPage();
Platform.runLater(() -> {
final Node rightSectionNode = tableViewController.processedView();
rightSectionNode.setCache(true);
rightSectionNode.setCacheHint(CacheHint.SPEED);
rightPane.getChildren().clear();
rightPane.getChildren().add(rightSectionNode);
});
}
} catch (final Exception ex) {
ex.printStackTrace();
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
toDisplay.setOpacity(1);
toDisplay.setCache(true);
toDisplay.setCacheHint(CacheHint.SPEED);
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
final Node primaryMenu = controller.processedView();
primaryMenu.setCache(true);
primaryMenu.setCacheHint(CacheHint.SPEED);
内容来源于网络,如有侵权,请联系作者删除!