Java 类javafx.scene.CacheHint 实例源码
项目:Conan
文件:RowPane.java
public RowPane(boolean isFirstRowInBox, int nrOfClosingBoxes) {
super();
this.isFirstRowInBox = isFirstRowInBox;
this.setNrOfClosingBoxes(nrOfClosingBoxes);
this.numberOfPrompts = 0;
TextField tfExpression = new TextField();
tfExpression.setPromptText("Formula");
tfExpression.setId("expression");
tfExpression.getStyleClass().add("myText");
tfExpression.setPrefWidth(580);
this.setCenter(tfExpression);
this.setRight(new RulePane());
this.setCache(true);
this.setCacheShape(true);
this.setCacheHint(CacheHint.DEFAULT);
}
项目:marathonv5
文件:UnitedStatesMapPane.java
public UnitedStatesMapPane() {
getStyleClass().add("map-pane");
setMinSize(USE_PREF_SIZE, USE_PREF_SIZE);
setPrefHeight(450);
setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
liveMap.setId("liveMap");
liveMap.setManaged(false);
liveMap.setCache(true);
liveMap.setCacheHint(CacheHint.SCALE);
getChildren().add(liveMap);
overlayGroup.setId("overlay");
// setip map transforms
liveMap.getTransforms().setAll(mapPreTranslate, mapScale, mapPostTranslate);
// load map fxml
try {
statesGroup = FXMLLoader.load(UnitedStatesMapPane.class.getResource("us-states-map.fxml"));
} catch (IOException e) {
e.printStackTrace();
}
// set live map children
liveMap.getChildren().addAll(statesGroup, overlayGroup);
}
项目:marathonv5
文件:UnitedStatesMapPane.java
public UnitedStatesMapPane() {
getStyleClass().add("map-pane");
setMinSize(USE_PREF_SIZE, USE_PREF_SIZE);
setPrefHeight(450);
setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
liveMap.setId("liveMap");
liveMap.setManaged(false);
liveMap.setCache(true);
liveMap.setCacheHint(CacheHint.SCALE);
getChildren().add(liveMap);
overlayGroup.setId("overlay");
// setip map transforms
liveMap.getTransforms().setAll(mapPreTranslate, mapScale, mapPostTranslate);
// load map fxml
try {
statesGroup = FXMLLoader.load(UnitedStatesMapPane.class.getResource("us-states-map.fxml"));
} catch (IOException e) {
e.printStackTrace();
}
// set live map children
liveMap.getChildren().addAll(statesGroup, overlayGroup);
}
项目:boomer-tuner
文件:RootView.java
@Override
public void newSong(final Song song) {
play.setGraphic(pauseImage);
artwork.setImage(song.getAlbum().getArtwork());
artwork.setSmooth(true);
artwork.setCache(true);
artwork.setCacheHint(CacheHint.QUALITY);
artwork.setPreserveRatio(true);
artwork.setFitWidth(100);
songLength.setText(song.getDuration());
final StringBuilder title = new StringBuilder(song.getTitle());
if (song.getArtist() != null) {
title.append(" - ").append(song.getArtist().getName());
}
songTitle.setText(title.toString());
}
项目:boomer-tuner
文件:ImagesView.java
private void addImageView(final Image i) {
try {
final String imageName = i.getUri().toURL().toString();
ImageView imageView = new ImageView(new javafx.scene.image.Image(imageName));
imageView.setSmooth(true);
imageView.setCache(true);
imageView.setCacheHint(CacheHint.SPEED);
imageView.setPreserveRatio(true);
imageView.setFitWidth(200);
Platform.runLater(() -> {
tilePane.getChildren().add(imageView);
});
} catch (MalformedURLException e) {
System.out.println("URL Conversion didn't work");
e.printStackTrace();
}
}
项目:tilesfx
文件:FlipTileSkin.java
private void flipForward() {
timeline.stop();
flap.setCache(true);
flap.setCacheHint(CacheHint.ROTATE);
//flap.setCacheHint(CacheHint.SPEED);
currentSelectionIndex++;
if (currentSelectionIndex >= characters.size()) {
currentSelectionIndex = 0;
}
nextSelectionIndex = currentSelectionIndex + 1;
if (nextSelectionIndex >= characters.size()) {
nextSelectionIndex = 0;
}
KeyValue keyValueFlap = new KeyValue(rotateFlap.angleProperty(), 180, Interpolator.SPLINE(0.5, 0.4, 0.4, 1.0));
//KeyValue keyValueFlap = new KeyValue(rotateFlap.angleProperty(), 180, Interpolator.EASE_IN);
KeyFrame keyFrame = new KeyFrame(Duration.millis(tile.getFlipTimeInMS()), keyValueFlap);
timeline.getKeyFrames().setAll(keyFrame);
timeline.play();
}
项目:Paradinc-FX
文件:World.java
private void resize() {
width = getWidth() - getInsets().getLeft() - getInsets().getRight();
height = getHeight() - getInsets().getTop() - getInsets().getBottom();
if (ASPECT_RATIO * width > height) {
width = 1 / (ASPECT_RATIO / height);
} else if (1 / (ASPECT_RATIO / height) > width) {
height = ASPECT_RATIO * width;
}
if (width > 0 && height > 0) {
if (isZoomEnabled()) resetZoom();
pane.setCache(true);
pane.setCacheHint(CacheHint.SCALE);
pane.setScaleX(width / PREFERRED_WIDTH);
pane.setScaleY(height / PREFERRED_HEIGHT);
group.resize(width, height);
group.relocate((getWidth() - width) * 0.5, (getHeight() - height) * 0.5);
pane.setCache(false);
}
}
项目:Incubator
文件:FlipPanel.java
public void flipToFront() {
if (Double.compare(rotate.getAngle(), 0) == 0) return;
KeyValue kvStart = new KeyValue(rotate.angleProperty(), 180, Interpolator.EASE_IN);
KeyValue kvStop = new KeyValue(rotate.angleProperty(), 0, Interpolator.EASE_OUT);
KeyFrame kfStart = new KeyFrame(Duration.ZERO, kvStart);
KeyFrame kfStop = new KeyFrame(Duration.millis(flipTime), kvStop);
flipToFront.getKeyFrames().setAll(kfStart, kfStop);
front.setCache(true);
front.setCacheHint(CacheHint.ROTATE);
back.setCache(true);
back.setCacheHint(CacheHint.ROTATE);
flipToFront.setOnFinished(event -> {
front.setCache(false);
back.setCache(false);
fireEvent(new FlipEvent(FlipPanel.this, FlipPanel.this, FlipEvent.FLIP_TO_FRONT_FINISHED));
});
flipToFront.play();
}
项目:Incubator
文件:FlipPanel.java
public void flipToBack() {
if (Double.compare(rotate.getAngle(), 180) == 0) return;
KeyValue kvStart = new KeyValue(rotate.angleProperty(), 0, Interpolator.EASE_IN);
KeyValue kvStop = new KeyValue(rotate.angleProperty(), 180, Interpolator.EASE_OUT);
KeyFrame kfStart = new KeyFrame(Duration.ZERO, kvStart);
KeyFrame kfStop = new KeyFrame(Duration.millis(flipTime), kvStop);
flipToBack.getKeyFrames().setAll(kfStart, kfStop);
front.setCache(true);
front.setCacheHint(CacheHint.ROTATE);
back.setCache(true);
back.setCacheHint(CacheHint.ROTATE);
flipToBack.setOnFinished(event -> {
front.setCache(false);
back.setCache(false);
fireEvent(new FlipEvent(FlipPanel.this, FlipPanel.this, FlipEvent.FLIP_TO_BACK_FINISHED));
});
flipToBack.play();
}
项目:worldfx
文件:World.java
private void resize() {
width = getWidth() - getInsets().getLeft() - getInsets().getRight();
height = getHeight() - getInsets().getTop() - getInsets().getBottom();
if (ASPECT_RATIO * width > height) {
width = 1 / (ASPECT_RATIO / height);
} else if (1 / (ASPECT_RATIO / height) > width) {
height = ASPECT_RATIO * width;
}
if (width > 0 && height > 0) {
if (isZoomEnabled()) resetZoom();
pane.setCache(true);
pane.setCacheHint(CacheHint.SCALE);
pane.setScaleX(width / PREFERRED_WIDTH);
pane.setScaleY(height / PREFERRED_HEIGHT);
group.resize(width, height);
group.relocate((getWidth() - width) * 0.5, (getHeight() - height) * 0.5);
pane.setCache(false);
}
}
项目:particlesfx
文件:NodeBubbles.java
public Particle() {
super();
// Size
double size = 50 * (RND.nextDouble() * 0.6) + 0.1;
setPrefSize(size, size);
//getStyleClass().add("bubble");
getChildren().addAll(createBubble(size));
// Position
setLayoutX(RND.nextDouble() * WIDTH);
setLayoutY(HEIGHT + size);
// Velocity
vX = (RND.nextDouble() * 0.5) - 0.25;
vY = (-(RND.nextDouble() * 2) - 0.5) * (size / 50);
// Opacity
setOpacity((RND.nextDouble() * 0.6) + 0.4);
// Enable Caching
setCache(true);
setCacheHint(CacheHint.SPEED);
}
项目:Medusa
文件:ModernSkin.java
@Override protected void redraw() {
sectionsVisible = gauge.getSectionsVisible();
locale = gauge.getLocale();
barColor = gauge.getBarColor();
thresholdColor = gauge.getThresholdColor();
needle.setFill(gauge.getNeedleColor());
titleText.setFill(gauge.getTitleColor());
subTitleText.setFill(gauge.getSubTitleColor());
unitText.setFill(gauge.getUnitColor());
valueText.setFill(gauge.getValueColor());
buttonTooltip.setText(gauge.getButtonTooltipText());
mainCanvas.setCache(false);
mainCanvas.setWidth(size);
mainCanvas.setHeight(size);
drawMainCanvas();
mainCanvas.setCache(true);
mainCanvas.setCacheHint(CacheHint.QUALITY);
resizeText();
}
项目:Medusa
文件:DesignClockSkin.java
@Override protected void redraw() {
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth() / PREFERRED_WIDTH * size))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
shadowGroup.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
// Tick Marks
tickCanvas.setCache(false);
drawTicks();
tickCanvas.setCache(true);
tickCanvas.setCacheHint(CacheHint.QUALITY);
needle.setStroke(clock.getHourColor());
ZonedDateTime time = clock.getTime();
updateTime(time);
}
项目:Medusa
文件:TinySkin.java
@Override protected void redraw() {
pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth() / PREFERRED_WIDTH * size))));
pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
locale = gauge.getLocale();
formatString = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
colorGradientEnabled = gauge.isGradientBarEnabled();
noOfGradientStops = gauge.getGradientBarStops().size();
barBackground.setStroke(gauge.getBarBackgroundColor());
// Areas, Sections and Tick Marks
sectionCanvas.setCache(false);
sectionCtx.clearRect(0, 0, size, size);
if (gauge.isGradientBarEnabled() && gauge.getGradientLookup() != null) {
drawGradientBar();
if (gauge.getMajorTickMarksVisible()) drawTickMarks();
} else if (gauge.getSectionsVisible()) {
drawSections();
if (gauge.getMajorTickMarksVisible()) drawTickMarks();
}
sectionCanvas.setCache(true);
sectionCanvas.setCacheHint(CacheHint.QUALITY);
needle.setFill(gauge.getNeedleColor());
}
项目:Simulizer
文件:CPUVisualisation.java
/**
* Sets up the cpu visualisation along with the containing pane
*/
public CPUVisualisation() {
width = 530;
height = 415;
pane = getContentPane();
pane.setPrefWidth(width);
pane.setMinWidth(width);
pane.setMaxWidth(width);
pane.setPrefHeight(height);
pane.setMinHeight(height);
pane.setMaxHeight(height);
setMinWidth(width);
setMinHeight(getMinimalHeight());
drawVisualisation();
pane.setCache(true);
pane.setCacheHint(CacheHint.SPEED);
setCache(true);
setCacheHint(CacheHint.SPEED);
}
项目:Simulizer
文件:ComponentStackPane.java
/**
* Sets attributes on the shape and stack pane such as x and y coordinates.
*/
public void setAttributes(){
this.setPrefHeight(height);
this.setPrefWidth(width);
this.setLayoutX(x);
this.setLayoutY(y);
this.text.setWrappingWidth(width * 0.9);
this.shape.getStyleClass().addAll("cpu-component", this.getClass().getSimpleName());
this.text.getStyleClass().addAll("cpu-component-label", this.getClass().getSimpleName());
this.getStyleClass().addAll("cpu-container");
getChildren().addAll(this.shape, text);
setAlignment(this.shape, Pos.TOP_LEFT);
setCache(true);
setCacheShape(true);
setCacheHint(CacheHint.SPEED);
this.shape.setCache(true);
this.shape.setCacheHint(CacheHint.SPEED);
}
项目:FXImgurUploader
文件:SplitFlapSkin.java
public void flipForward() {
timeline.stop();
flap.setCacheShape(true);
flap.setCache(true);
flap.setCacheHint(CacheHint.ROTATE);
//flap.setCacheHint(CacheHint.SPEED);
currentSelectionIndex++;
if (currentSelectionIndex >= selectedSet.size()) {
currentSelectionIndex = 0;
}
nextSelectionIndex = currentSelectionIndex + 1;
if (nextSelectionIndex >= selectedSet.size()) {
nextSelectionIndex = 0;
}
//keyValueFlap = new KeyValue(rotateFlap.angleProperty(), 180, Interpolator.SPLINE(0.5, 0.4, 0.4, 1.0));
keyValueFlap = new KeyValue(rotateFlap.angleProperty(), 180, Interpolator.EASE_IN);
keyFrame = new KeyFrame(Duration.millis(getSkinnable().getFlipTime()), keyValueFlap);
timeline.getKeyFrames().setAll(keyFrame);
timeline.play();
}
项目:JFoenix
文件:JFXFillTransition.java
protected void starting() {
// init animation values
if (start == null) {
oldCache = region.get().isCache();
oldCacheHint = region.get().getCacheHint();
radii = region.get().getBackground() == null ? null : region.get()
.getBackground()
.getFills()
.get(0)
.getRadii();
insets = region.get().getBackground() == null ? null : region.get()
.getBackground()
.getFills()
.get(0)
.getInsets();
start = fromValue.get();
end = toValue.get();
region.get().setCache(true);
region.get().setCacheHint(CacheHint.SPEED);
}
}
项目:JFoenix
文件:CacheMomento.java
/**
* this method will cache the node only if it wasn't cached before
*/
public void cache() {
if (!history.containsKey(node)) {
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);
}
history.put(node, this);
} else {
CacheMomento cached = new CacheMomento(node);
this.cache = cached.cache;
this.cacheHint = cached.cacheHint;
this.cacheShape = cached.cacheShape;
this.snapToPixel = cached.snapToPixel;
}
}
项目:JFoenix
文件:JFXRippler.java
/**
* creates a rippler for the specified control, mask and position.
*
* @param control
* @param mask can be either rectangle/cricle
* @param pos can be either FRONT/BACK (position the ripple effect infront of or behind the control)
*/
public JFXRippler(Node control, RipplerMask mask, RipplerPos pos) {
initialize();
setMaskType(mask);
setPosition(pos);
createRippleUI();
setControl(control);
// listen to control position changed
position.addListener(observable -> updateControlPosition());
setPickOnBounds(false);
setCache(true);
setCacheHint(CacheHint.SPEED);
setCacheShape(true);
}
项目:JFoenix
文件:JFXRippler.java
OverLayRipple() {
super(control.getLayoutBounds().getWidth(), control.getLayoutBounds().getHeight());
this.getStyleClass().add("jfx-rippler-overlay");
// update initial position
if(JFXRippler.this.getChildrenUnmodifiable().contains(control)) {
double diffMinX = Math.abs(control.getBoundsInLocal().getMinX() - control.getLayoutBounds().getMinX());
double diffMinY = Math.abs(control.getBoundsInLocal().getMinY() - control.getLayoutBounds().getMinY());
Bounds bounds = control.getBoundsInParent();
this.setX(bounds.getMinX() + diffMinX - snappedLeftInset());
this.setY(bounds.getMinY() + diffMinY - snappedTopInset());
}
// set initial attributes
setOpacity(0);
setCache(true);
setCacheHint(CacheHint.SPEED);
setCacheShape(true);
setManaged(false);
}
项目:roda-in
文件:RodaInApplication.java
@Override
public void init() {
ImageView splash;
try {
splash = new ImageView(new Image(ClassLoader.getSystemResource(Constants.RSC_SPLASH_SCREEN_IMAGE).openStream()));
} catch (IOException e) {
LOGGER.error("Error reading logo file", e);
splash = new ImageView();
}
splashPane = new Pane();
splashPane.setStyle(Constants.CSS_FX_BACKGROUND_COLOR_TRANSPARENT);
splashPane.getChildren().add(splash);
splashPane.setCache(true);
splashPane.setCacheHint(CacheHint.SPEED);
splashPane.setEffect(new DropShadow());
}
项目:metastone
文件:HealingNumber.java
public HealingNumber(String text, GameToken parent) {
this.parent = parent;
setText(text);
setFill(Color.GREEN);
setStyle("-fx-font-size: 28pt; -fx-font-family: \"System\";-fx-font-weight: bolder;-fx-stroke: black;-fx-stroke-width: 2;");
setCache(true);
setCacheHint(CacheHint.SPEED);
parent.getAnchor().getChildren().add(this);
NotificationProxy.sendNotification(GameNotification.ANIMATION_STARTED);
TranslateTransition animation = new TranslateTransition(Duration.seconds(0.5), this);
animation.setToY(-30);
animation.setOnFinished(this::onComplete);
animation.play();
}
项目:TweetwallFX
文件:Devoxx17FlipInTweets.java
private HBox createSingleTweetDisplay(final Tweet displayTweet, final WordleSkin wordleSkin, final double maxWidth) {
String textWithoutMediaUrls = displayTweet.getDisplayEnhancedText();
Text text = new Text(textWithoutMediaUrls.replaceAll("[\n\r]", "|"));
text.setCache(true);
text.setCacheHint(CacheHint.SPEED);
text.getStyleClass().add("tweetText");
Image profileImage = wordleSkin.getProfileImageCache().get(displayTweet.getUser().getBiggerProfileImageUrl());
ImageView profileImageView = new ImageView(profileImage);
profileImageView.setSmooth(true);
profileImageView.setCacheHint(CacheHint.QUALITY);
TextFlow flow = new TextFlow(text);
flow.getStyleClass().add("tweetFlow");
flow.maxWidthProperty().set(maxWidth);
flow.maxHeightProperty().set(70);
flow.minHeightProperty().set(70);
flow.setCache(true);
flow.setCacheHint(CacheHint.SPEED);
Text name = new Text(displayTweet.getUser().getName());
name.getStyleClass().add("tweetUsername");
name.setCache(true);
name.setCacheHint(CacheHint.SPEED);
HBox tweet = new HBox(profileImageView, new VBox(name, flow));
tweet.setCacheHint(CacheHint.QUALITY);
tweet.setSpacing(10);
return tweet;
}
项目:JavaOne2015JavaFXPitfalls
文件:AdvancedScatterChartSample.java
private void init(Stage primaryStage) {
VBox root = new VBox();
fpsLabel = new Label("FPS:");
fpsLabel.setStyle("-fx-font-size: 5em;-fx-text-fill: red;");
fpsLabel.setOnMouseClicked((event) -> {
tracker.resetAverageFPS();
});
FlowPane flow = new FlowPane();
flow.setCache(true);
flow.setCacheHint(CacheHint.SPEED);
root.getChildren().addAll(fpsLabel,flow);
Scene scene = new Scene(root, 500, 2000);
createPerformanceTracker(scene);
primaryStage.setScene(scene);
List< ScatterChart<Number, Number>> result = new ArrayList<>();
for(int i =0; i<10;i++) {
ScatterChart<Number, Number> tmp = createChart();
result.add(tmp);
}
flow.getChildren().setAll(result);
}
项目:Machiavelli
文件:StadView.java
/**
*
* @param stad Stad van Speler
* @param gebouwKaartController GebouwKaarController
* @throws RemoteException
*/
public StadView(StadRemote stad, GebouwKaartController gebouwKaartController) throws RemoteException {
this.stad = stad;
this.speler = stad.getSpeler();
this.gebouwKaartController = gebouwKaartController;
this.stad.addObserver(this);
this.speler.addObserver(this);
this.pane.setCache(true);
this.pane.setCacheShape(true);
this.pane.setCacheHint(CacheHint.SPEED);
this.buildGebouwKaartViewArray();
this.createSpelerPortrait();
this.createSpelerPortraitNumber();
this.createNameField();
this.createStad();
this.pane.getChildren().addAll(portretPane, namePane, stadPane);
StackPane.setAlignment(portretPane, Pos.TOP_CENTER);
StackPane.setAlignment(namePane, Pos.CENTER);
StackPane.setAlignment(stadPane, Pos.BOTTOM_CENTER);
}
项目:stupidwarriors
文件:MapGenerator.java
/**
* add grass to the ground of map
* @param gameStack StackPane of the game
*/
public static void createMapGrass(StackPane gameStack){
Image grass = new Image(Url.GRASS);
double x = grass.getWidth();
double y = grass.getHeight();
for(int i=0 ; i < (int)GameController.GAME_WIDTH/x ;i++){
for(int j = 0;j<(int)GameController.GAME_HEIGHT/y;j++){
ImageView grassTemp = new ImageView(grass);
gameStack.getChildren().add(grassTemp);
grassTemp.setTranslateX(-GameController.GAME_WIDTH/2+(x)*i);
grassTemp.setTranslateY(-GameController.GAME_HEIGHT/2+(y)*j);
//Optimizer
grassTemp.setCache(true);
grassTemp.setCacheHint(CacheHint.SPEED);
}
}
}
项目:Enzo
文件:SplitFlapSkin.java
public void flipForward() {
timeline.stop();
flap.setCacheShape(true);
flap.setCache(true);
flap.setCacheHint(CacheHint.ROTATE);
//flap.setCacheHint(CacheHint.SPEED);
currentSelectionIndex++;
if (currentSelectionIndex >= selectedSet.size()) {
currentSelectionIndex = 0;
}
nextSelectionIndex = currentSelectionIndex + 1;
if (nextSelectionIndex >= selectedSet.size()) {
nextSelectionIndex = 0;
}
//keyValueFlap = new KeyValue(rotateFlap.angleProperty(), 180, Interpolator.SPLINE(0.5, 0.4, 0.4, 1.0));
keyValueFlap = new KeyValue(rotateFlap.angleProperty(), 180, Interpolator.EASE_IN);
keyFrame = new KeyFrame(Duration.millis(getSkinnable().getFlipTime()), keyValueFlap);
timeline.getKeyFrames().setAll(keyFrame);
timeline.play();
}
项目:Fishification
文件:Sprite.java
private Sprite(String spriteImageName, AbstractWorld world) {
m_spriteImageName = spriteImageName;
m_spriteImage = world.getImageResourceManager().get(spriteImageName);
m_spriteView = new ImageView();
m_spriteView.setImage(m_spriteImage);
m_spriteView.setCache(true);
m_spriteView.setCacheHint(CacheHint.SPEED);
m_spriteView.setManaged(false);
m_imageColumns = 1;
m_spriteCount = 1;
m_spriteWidth = m_spriteImage.getWidth();
m_spriteHeight = m_spriteImage.getHeight();
m_spriteAnimation = null;
}
项目:Conan
文件:ProofView.java
/**
* Creates a new row with a textfield for the expression and a textfield
* for the rules and adds listeners to both of them.
*
* @return bp, the BorderPane containing two textfields.
*/
//should only be called AFTER a new row has been added to rList since it uses rList.size()
Label createLabel() {
Label lbl = new Label("" + rList.size());
lbl.getStyleClass().add("lineNo");
lbl.setPadding(new Insets(8, 2, 2, 2));
//lbl.setCache(true);
//lbl.setCacheShape(true);
lbl.setCacheHint(CacheHint.SPEED);
return lbl;
}
项目:dynamo
文件:GeneratorSkin.java
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();
}
项目:CalendarFX
文件:EntryViewBase.java
/**
* Makes the entry view "bounce" by applying a scale transition. This is a
* good way to make an entry stand out, e.g. when it receives the keyboard
* focus.
*/
public final void bounce() {
ScaleTransition transition = new ScaleTransition(Duration.millis(200), this);
setCache(true);
setCacheHint(CacheHint.SCALE);
transition.setAutoReverse(true);
transition.setFromX(1);
transition.setToX(.8);
transition.setFromY(1);
transition.setToY(.8);
transition.setCycleCount(2);
transition.setOnFinished(evt -> setCache(false));
transition.play();
}
项目:fxexperience2
文件:CachedTimelineTransition.java
/**
* Called when the animation is starting
*/
protected void starting() {
if (useCache) {
oldCache = node.isCache();
oldCacheHint = node.getCacheHint();
node.setCache(true);
node.setCacheHint(CacheHint.SPEED);
}
}
项目:vars-annotation
文件:CachedTimelineTransition.java
/**
* Called when the animation is starting
*/
protected void starting() {
if (useCache) {
oldCache = node.isCache();
oldCacheHint = node.getCacheHint();
node.setCache(true);
node.setCacheHint(CacheHint.SPEED);
}
}
项目:worldheatmap
文件:World.java
private void resize() {
width = getWidth() - getInsets().getLeft() - getInsets().getRight();
height = getHeight() - getInsets().getTop() - getInsets().getBottom();
if (ASPECT_RATIO * width > height) {
width = 1 / (ASPECT_RATIO / height);
} else if (1 / (ASPECT_RATIO / height) > width) {
height = ASPECT_RATIO * width;
}
if (width > 0 && height > 0) {
if (isZoomEnabled()) resetZoom();
pane.setCache(true);
pane.setCacheHint(CacheHint.SCALE);
pane.setScaleX(width / PREFERRED_WIDTH);
pane.setScaleY(height / PREFERRED_HEIGHT);
group.resize(width, height);
group.relocate((getWidth() - width) * 0.5, (getHeight() - height) * 0.5);
heatMap.setSize(width, height);
heatMap.relocate(((getWidth() - getInsets().getLeft() - getInsets().getRight()) - width) * 0.5, ((getHeight() - getInsets().getTop() - getInsets().getBottom()) - height) * 0.5);
pane.setCache(false);
}
}
项目:charts
文件:World.java
private void resize() {
width = getWidth() - getInsets().getLeft() - getInsets().getRight();
height = getHeight() - getInsets().getTop() - getInsets().getBottom();
size = width < height ? width : height;
if (ASPECT_RATIO * width > height) {
width = 1 / (ASPECT_RATIO / height);
} else if (1 / (ASPECT_RATIO / height) > width) {
height = ASPECT_RATIO * width;
}
if (width > 0 && height > 0) {
if (isZoomEnabled()) resetZoom();
pane.setCache(true);
pane.setCacheHint(CacheHint.SCALE);
pane.setScaleX(width / PREFERRED_WIDTH);
pane.setScaleY(height / PREFERRED_HEIGHT);
group.resize(width, height);
group.relocate((getWidth() - width) * 0.5, (getHeight() - height) * 0.5);
//heatMap.setSize(width, height);
//heatMap.relocate(((getWidth() - getInsets().getLeft() - getInsets().getRight()) - width) * 0.5, ((getHeight() - getInsets().getTop() - getInsets().getBottom()) - height) * 0.5);
heatMap.setScaleX(pane.getScaleX());
heatMap.setScaleY(pane.getScaleY());
heatMap.setTranslateX(group.getBoundsInParent().getMinX() - group.getLayoutBounds().getMinX());
heatMap.setTranslateY(group.getBoundsInParent().getMinY() - group.getLayoutBounds().getMinY());
pane.setCache(false);
}
}
项目:tilesfx
文件:FlipTileSkin.java
private void drawFlaps() {
double cornerRadius = tile.getRoundedCorners() ? size * 0.025 : 0;
// Upper Background
upperBackground.setCache(false);
upperBackgroundCtx.clearRect(0, 0, width, flapHeight);
Helper.drawRoundedRect(upperBackgroundCtx, new CtxBounds(0, 0, width, flapHeight), new CtxCornerRadii(cornerRadius, cornerRadius, 0, 0));
upperBackgroundCtx.setFill(tile.getBackgroundColor());
upperBackgroundCtx.fill();
upperBackground.setCache(true);
upperBackground.setCacheHint(CacheHint.SPEED);
// Lower Background
lowerBackground.setCache(false);
lowerBackgroundCtx.clearRect(0, 0, width, flapHeight);
Helper.drawRoundedRect(lowerBackgroundCtx, new CtxBounds(0, 0, width, flapHeight), new CtxCornerRadii(0, 0, cornerRadius, cornerRadius));
lowerBackgroundCtx.setFill(tile.getBackgroundColor());
lowerBackgroundCtx.fill();
lowerBackground.setCache(true);
lowerBackground.setCacheHint(CacheHint.SPEED);
// Flap
flap.setCache(false);
flapCtx.clearRect(0, 0, width, flapHeight);
Helper.drawRoundedRect(flapCtx, new CtxBounds(0, 0, width, flapHeight), new CtxCornerRadii(cornerRadius, cornerRadius, 0, 0));
flapCtx.setFill(tile.getBackgroundColor());
flapCtx.fill();
flap.setCache(true);
flap.setCacheHint(CacheHint.SPEED);
}
项目:tilesfx
文件:RadarChart.java
public void redraw() {
chartCanvas.setCache(false);
drawChart();
chartCanvas.setCache(true);
chartCanvas.setCacheHint(CacheHint.QUALITY);
overlayCanvas.setCache(false);
drawOverlay();
overlayCanvas.setCache(true);
overlayCanvas.setCacheHint(CacheHint.QUALITY);
redrawText();
}
项目:Gargoyle
文件:BlinkBorderTransition.java
public BlinkBorderTransition(final Region node, Border def, Color blinkColor) {
super(node, new Timeline(create(node, blinkColor)));
node.setCache(true);
node.setCacheHint(CacheHint.SPEED);
setCycleCount(3);
setCycleDuration(Duration.millis(1000));
setDelay(Duration.millis(500));
setOnFinished(ev -> {
node.setBorder(def);
});
}
项目:photometric-data-retriever
文件:PhotometricDataOverviewController.java
@FXML
private void initialize() {
final String os = System.getProperty("os.name");
if (os != null && os.startsWith("Mac"))
menuBar.useSystemMenuBarProperty().set(true);
saveAllMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.S, KeyCombination.SHORTCUT_DOWN));
closeMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN));
chart.setCacheHint(CacheHint.SPEED);
}