本文整理匯總了Java中javafx.scene.text.Text.setCache方法的典型用法代碼示例。如果您正苦於以下問題:Java Text.setCache方法的具體用法?Java Text.setCache怎麽用?Java Text.setCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.text.Text
的用法示例。
在下文中一共展示了Text.setCache方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initGraphics
import javafx.scene.text.Text; //導入方法依賴的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();
}