use of javafx.scene.effect.BoxBlur in project TestFX by TestFX.
the class BoundsQueryUtilsTest method setupShape.
private static void setupShape() {
// nodeBounds()
shape = new Rectangle(0, 0, SHAPE_WIDTH, 0);
// nodeBoundsInLocal()
shape.setClip(new Rectangle(0, 0, CLIP_WIDTH, 0));
// nodeBoundsInParent()
shape.getTransforms().add(new Translate(TRANSLATE_X, 0));
// nodeBounds()
Shape altShape = new Rectangle(0, 0, SHAPE_WIDTH, 0);
altShape.setFill(Color.GREEN);
altShape.setStroke(Color.BLACK);
altShape.setStrokeType(StrokeType.OUTSIDE);
// nodeBounds(), nodeBoundsInParent()
altShape.setStrokeWidth(5);
// nodeBoundsInLocal()
altShape.setEffect(new BoxBlur(10, 10, 1));
}
use of javafx.scene.effect.BoxBlur in project JavaFXLibrary by eficode.
the class TestPointLocationController method initialize.
@Override
public void initialize(URL location, ResourceBundle resources) {
locationLabel.setText("- | -");
textTransition = new SequentialTransition();
textTransition.getChildren().addAll(zoomIn(), zoomOut());
blur = new BoxBlur(5.0, 5.0, 1);
}
use of javafx.scene.effect.BoxBlur in project JavaFXLibrary by eficode.
the class TestPointLocationController method mouseListener.
public void mouseListener(MouseEvent event) {
int x = (int) event.getSceneX();
int y = (int) event.getSceneY();
locationLabel.setText(x + " | " + y);
if (textTransition.getStatus() != Animation.Status.RUNNING)
textTransition.play();
locationLabel.setEffect(blur);
blurAmount = 5.0;
AnimationTimer timer = new AnimationTimer() {
@Override
public void handle(long now) {
blurAmount -= 0.01;
locationLabel.setEffect(new BoxBlur(blurAmount, blurAmount, 1));
if (blurAmount <= 0.0) {
stop();
}
}
};
timer.start();
}
use of javafx.scene.effect.BoxBlur in project FXGL by AlmasB.
the class ParticleDigitsSample method initParticles.
private void initParticles() {
// blur particle pane to smooth out edges
var particlePane = new Pane();
particlePane.setEffect(new BoxBlur(2, 2, 3));
addUINode(particlePane);
int max = 0;
for (char c : DIGITS_STRING.toCharArray()) {
// shape of each digit
var text = getUIFactoryService().newText(c + "", Color.WHITE, 256);
var digitPixels = toPixels(toImage(text)).stream().filter(p -> !p.getColor().equals(Color.TRANSPARENT)).collect(Collectors.toList());
max = Math.max(max, digitPixels.size());
digits.add(new ParticleDigit(digitPixels));
}
for (int i = 0; i < max; i++) {
// shape of each particle
var particle = new Circle(3, 3, 3, Color.WHITE);
particles.add(particle);
particlePane.getChildren().add(particle);
}
}
use of javafx.scene.effect.BoxBlur in project jgnash by ccavanaugh.
the class BusyPane method getImageView.
private ImageView getImageView() {
ImageView imageView = new ImageView();
imageView.setFocusTraversable(false);
imageView.setEffect(new BoxBlur(4, 4, 2));
imageView.setImage(getScene().getRoot().snapshot(null, null));
return imageView;
}
Aggregations