本文整理汇总了Java中javafx.scene.layout.Region.setCache方法的典型用法代码示例。如果您正苦于以下问题:Java Region.setCache方法的具体用法?Java Region.setCache怎么用?Java Region.setCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.Region
的用法示例。
在下文中一共展示了Region.setCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGraphics
import javafx.scene.layout.Region; //导入方法依赖的package包/类
private void initGraphics() {
background = new Region();
background.getStyleClass().setAll("background");
circleFrame = new Region();
circleFrame.getStyleClass().setAll("circle-frame");
circleGears = new Region();
circleGears.getStyleClass().setAll("circle-gears");
circleGears.setCache(true);
circleGears.setCacheHint(CacheHint.SPEED);
rotateTransition = new RotateTransition(Duration.millis(getSkinnable().getAnimationDuration()), circleGears);
blinkTimeline = new Timeline(new KeyFrame(Duration.seconds(0.35), event -> circleFrame.setOpacity(circleFrame.getOpacity() == 0 ? 1 : 0)));
sinCurve = new Region();
sinCurve.getStyleClass().setAll("sin-curve");
nameText = new Text(getSkinnable().getName());
nameText.getStyleClass().setAll("name-text");
pane = new Pane(background, circleFrame, circleGears, sinCurve, nameText);
getChildren().add(pane);
resize();
updateStateAspect();
updateAlarmStatus();
}
示例2: initGraphics
import javafx.scene.layout.Region; //导入方法依赖的package包/类
private void initGraphics() {
main = new Region();
main.getStyleClass().setAll("main");
frame = new Region();
frame.getStyleClass().setAll("frame");
sectionsCanvas = new Canvas(width, barHeight);
sections = sectionsCanvas.getGraphicsContext2D();
currentValuePointer = new Region();
currentValuePointer.getStyleClass().setAll("normal-current-value-pointer");
currentValuePointer.setPrefSize(50, 20);
currentValuePointer.setCache(true);
currentValuePointer.setCacheHint(CacheHint.SPEED);
currentValueText = new Text(Double.toString(getSkinnable().getCurrentValue()));
currentValueText.getStyleClass().setAll("current-value-text");
currentValueText.setCache(true);
currentValueText.setCacheHint(CacheHint.SPEED);
currentValuePointerGroup = new Group(currentValuePointer, currentValueText);
currentValuePointerGroup.setCache(true);
currentValuePointerGroup.setCacheHint(CacheHint.SPEED);
titleText = new Text(getSkinnable().getTitle());
titleText.getStyleClass().setAll("title");
unitText = new Text(getSkinnable().getUnit());
unitText.getStyleClass().setAll("unit");
pane = new Pane();
pane.getChildren().setAll(main,
frame,
sectionsCanvas,
unitText,
titleText,
currentValuePointerGroup);
getChildren().setAll(pane);
resize();
}