javafx.scene.Node.setCacheHint()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中javafx.scene.Node.setCacheHint()方法的一些代码示例,展示了Node.setCacheHint()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.setCacheHint()方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:setCacheHint

Node.setCacheHint介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

  1. public void restore() {
  2. if (isCached.getAndSet(false)) {
  3. node.setCache(cache);
  4. node.setCacheHint(cacheHint);
  5. if (node instanceof Region) {
  6. ((Region) node).setCacheShape(cacheShape);
  7. ((Region) node).setSnapToPixel(snapToPixel);
  8. }
  9. }
  10. }
  11. }

代码示例来源:origin: jfoenixadmin/JFoenix

  1. /**
  2. * this method will cache the node only if it wasn't cached before
  3. */
  4. public void cache() {
  5. if (!isCached.getAndSet(true)) {
  6. this.cache = node.isCache();
  7. this.cacheHint = node.getCacheHint();
  8. node.setCache(true);
  9. node.setCacheHint(CacheHint.SPEED);
  10. if (node instanceof Region) {
  11. this.cacheShape = ((Region) node).isCacheShape();
  12. this.snapToPixel = ((Region) node).isSnapToPixel();
  13. ((Region) node).setCacheShape(true);
  14. ((Region) node).setSnapToPixel(true);
  15. }
  16. }
  17. }

代码示例来源:origin: com.jfoenix/jfoenix

  1. public void restore() {
  2. if (isCached.getAndSet(false)) {
  3. node.setCache(cache);
  4. node.setCacheHint(cacheHint);
  5. if (node instanceof Region) {
  6. ((Region) node).setCacheShape(cacheShape);
  7. ((Region) node).setSnapToPixel(snapToPixel);
  8. }
  9. }
  10. }
  11. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. public void setContentItem(Node content) {
  2. content.setCache(true);
  3. content.setCacheHint(CacheHint.SPEED);
  4. scroll.setContent(content);
  5. NodeHelper.setHVGrow(content);
  6. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. public void setCenter(Node node) {
  2. node.setCache(true);
  3. node.setCacheHint(CacheHint.SPEED);
  4. Platform.runLater(() -> {
  5. centerFixedAreaSection.getChildren().clear();
  6. centerFixedAreaSection.getChildren().add(node);
  7. });
  8. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. public void setCenter(Node node) {
  2. Platform.runLater(() -> {
  3. node.setCache(true);
  4. node.setCacheHint(CacheHint.SPEED);
  5. centerFixedAreaSection.getChildren().clear();
  6. centerFixedAreaSection.getChildren().add(node);
  7. });
  8. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. public void doBuildRightPane() {
  2. try {
  3. righSection = (FullTableViewController) StandardViewUtils.forId(getRootStructure(), structureContentController, rightSectionView);
  4. Platform.runLater(() -> {
  5. final Node rightSectionNode = righSection.processedView();
  6. rightSectionNode.setCache(true);
  7. rightSectionNode.setCacheHint(CacheHint.SPEED);
  8. rightPane.getChildren().clear();
  9. rightPane.getChildren().add(rightSectionNode);
  10. });
  11. } catch (final Exception ex) {
  12. ex.printStackTrace();
  13. }
  14. }

代码示例来源:origin: com.github.giulianini.jestures/jestures

  1. /**
  2. * Cache deeply.
  3. *
  4. * @param node
  5. * the {@link Node}
  6. */
  7. public static void cacheDeeply(final Node node) {
  8. if (!node.isCache()) {
  9. node.setCache(true);
  10. node.setCacheHint(CacheHint.SPEED);
  11. }
  12. if (node instanceof Parent) {
  13. final Parent parent = (Parent) node;
  14. final ObservableList<Node> children = parent.getChildrenUnmodifiable();
  15. for (final Node child : children) {
  16. ViewUtilities.cacheDeeply(child);
  17. }
  18. }
  19. }

代码示例来源:origin: com.jfoenix/jfoenix

  1. /**
  2. * this method will cache the node only if it wasn't cached before
  3. */
  4. public void cache() {
  5. if (!isCached.getAndSet(true)) {
  6. this.cache = node.isCache();
  7. this.cacheHint = node.getCacheHint();
  8. node.setCache(true);
  9. node.setCacheHint(CacheHint.SPEED);
  10. if (node instanceof Region) {
  11. this.cacheShape = ((Region) node).isCacheShape();
  12. this.snapToPixel = ((Region) node).isSnapToPixel();
  13. ((Region) node).setCacheShape(true);
  14. ((Region) node).setSnapToPixel(true);
  15. }
  16. }
  17. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. public void doBuildCenterPane() {
  2. try {
  3. centerSectionView = getRootComponent().getPropertyValue("centerSectionView");
  4. if (StringUtils.isNotBlank(centerSectionView)) {
  5. centerViewController = StandardViewUtils.forId(getRootStructure(), structureContentController, centerSectionView);
  6. NodeHelper.styleClassSetAll(rightPane, getRootComponent(), "centerSectionAreaStyleClass", "");
  7. centerViewController.setParent(this);
  8. Platform.runLater(() -> {
  9. final Node centerSectionNode = centerViewController.processedView();
  10. centerSectionNode.setCache(true);
  11. centerSectionNode.setCacheHint(CacheHint.SPEED);
  12. centerPane.getChildren().clear();
  13. centerPane.getChildren().add(centerSectionNode);
  14. });
  15. }
  16. } catch (final Exception ex) {
  17. ex.printStackTrace();
  18. }
  19. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. public void doBuildRightPane() {
  2. try {
  3. final String rightSectionView = getRootComponent().getPropertyValue("rightSectionView");
  4. if (StringUtils.isNotBlank(rightSectionView)) {
  5. rightController = StandardViewUtils.forId(getRootStructure(), structureContentController, rightSectionView);
  6. NodeHelper.styleClassSetAll(rightPane, getRootComponent(), "rightSectionAreaStyleClass", "");
  7. rightController.setParent(this);
  8. Platform.runLater(() -> {
  9. final Node rightSectionNode = rightController.processedView();
  10. rightSectionNode.setCache(true);
  11. rightSectionNode.setCacheHint(CacheHint.SPEED);
  12. rightPane.getChildren().clear();
  13. rightPane.getChildren().add(rightSectionNode);
  14. });
  15. }
  16. } catch (final Exception ex) {
  17. ex.printStackTrace();
  18. }
  19. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. public void doBuildCenterPane() {
  2. try {
  3. centerSectionView = getRootComponent().getPropertyValue("centerSectionView");
  4. if (StringUtils.isNotBlank(centerSectionView)) {
  5. tableViewController = (FullTableViewController) StandardViewUtils.forId(getRootStructure(), structureContentController, centerSectionView);
  6. NodeHelper.styleClassSetAll(centerPane, getRootComponent(), "centerSectionAreaStyleClass", "");
  7. tableViewController.getStructureContent().setCurrentEditingTableStructure(tableViewController);
  8. tableViewController.setParent(this);
  9. tableViewController.forceLoadFirstPage();
  10. Platform.runLater(() -> {
  11. final Node centerSectionNode = tableViewController.processedView();
  12. centerSectionNode.setCache(true);
  13. centerSectionNode.setCacheHint(CacheHint.SPEED);
  14. centerPane.getChildren().clear();
  15. centerPane.getChildren().add(centerSectionNode);
  16. });
  17. }
  18. } catch (final Exception ex) {
  19. ex.printStackTrace();
  20. }
  21. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. public void doBuildRightPane() {
  2. try {
  3. rightSectionView = getRootComponent().getPropertyValue("rightSectionView");
  4. if (StringUtils.isNotBlank(rightSectionView)) {
  5. tableViewController = StandardViewUtils.forId(getRootStructure(), structureContentController, rightSectionView);
  6. NodeHelper.styleClassSetAll(rightPane, getRootComponent(), "rightSectionAreaStyleClass", "");
  7. if(tableViewController instanceof FullTableStructureController) {
  8. tableViewController.getStructureContent().setCurrentEditingTableStructure(tableViewController);
  9. }
  10. tableViewController.setParent(this);
  11. // tableViewController.forceLoadFirstPage();
  12. Platform.runLater(() -> {
  13. final Node rightSectionNode = tableViewController.processedView();
  14. rightSectionNode.setCache(true);
  15. rightSectionNode.setCacheHint(CacheHint.SPEED);
  16. rightPane.getChildren().clear();
  17. rightPane.getChildren().add(rightSectionNode);
  18. });
  19. }
  20. } catch (final Exception ex) {
  21. ex.printStackTrace();
  22. }
  23. }

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. toDisplay.setOpacity(1);
  2. toDisplay.setCache(true);
  3. toDisplay.setCacheHint(CacheHint.SPEED);

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. final Node primaryMenu = controller.processedView();
  2. primaryMenu.setCache(true);
  3. primaryMenu.setCacheHint(CacheHint.SPEED);

相关文章

Node类方法