Search in sources :

Example 1 with GaussianBlur

use of javafx.scene.effect.GaussianBlur in project PayFile by mikehearn.

the class GuiUtils method blurOut.

public static void blurOut(Node node) {
    GaussianBlur blur = new GaussianBlur(0.0);
    node.setEffect(blur);
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 10.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.play();
}
Also used : GaussianBlur(javafx.scene.effect.GaussianBlur)

Example 2 with GaussianBlur

use of javafx.scene.effect.GaussianBlur in project PayFile by mikehearn.

the class GuiUtils method blurIn.

public static void blurIn(Node node) {
    GaussianBlur blur = (GaussianBlur) node.getEffect();
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 0.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.setOnFinished(actionEvent -> node.setEffect(null));
    timeline.play();
}
Also used : GaussianBlur(javafx.scene.effect.GaussianBlur)

Example 3 with GaussianBlur

use of javafx.scene.effect.GaussianBlur in project OTP2_R6_svaap by JNuutinen.

the class Unit method drawShip.

/**
 * Asettaa Unitin aluksen visuaalisia piirteitä sen mukaan, onko alus pelaaja vai vihollinen.
 * @param shape Aluksen Shape-olio.
 */
void drawShip(Shape shape) {
    this.shape = shape;
    int tag = getTag();
    this.shape.setEffect(new GaussianBlur(2.0));
    this.shape.setFill(Color.BLACK);
    this.shape.setStrokeWidth(5.0);
    getChildren().add(this.shape);
    this.shape.setStroke(color);
}
Also used : GaussianBlur(javafx.scene.effect.GaussianBlur)

Example 4 with GaussianBlur

use of javafx.scene.effect.GaussianBlur in project OTP2_R6_svaap by JNuutinen.

the class Missile method buildProjectile.

/**
 * Rakentaa projectilen Polygonin
 * @param speed Projectilen nopeus, vaikuttaa hännän pituuteen
 * @param color Projectilen väri
 * @return Rakennettu Polygon
 */
private Polygon buildProjectile(double speed, Color color) {
    // Ammuksen muoto
    Polygon shape = new Polygon();
    shape.getPoints().addAll(-9.0, 0.0, 0.0, -3.0, // ammuksen häntä skaalautuu nopeuden mukaan, mutta on ainakin 1.0
    speed * 0.6 + 1.0, // ammuksen häntä skaalautuu nopeuden mukaan, mutta on ainakin 1.0
    0.0, 0.0, 3.0);
    Bloom bloom = new Bloom(0.0);
    GaussianBlur blur = new GaussianBlur(3.0);
    blur.setInput(bloom);
    shape.setFill(Color.TRANSPARENT);
    shape.setStroke(Color.WHITE);
    shape.setStrokeWidth(5.0);
    shape.getTransforms().add(new Rotate(180, 0, 0));
    return shape;
}
Also used : Rotate(javafx.scene.transform.Rotate) GaussianBlur(javafx.scene.effect.GaussianBlur) Bloom(javafx.scene.effect.Bloom) Polygon(javafx.scene.shape.Polygon)

Example 5 with GaussianBlur

use of javafx.scene.effect.GaussianBlur in project bitsquare by bitsquare.

the class Transitions method blur.

public void blur(Node node, int duration, double brightness, boolean removeNode, double blurRadius) {
    if (removeEffectTimeLine != null)
        removeEffectTimeLine.stop();
    node.setMouseTransparent(true);
    GaussianBlur blur = new GaussianBlur(0.0);
    Timeline timeline = new Timeline();
    KeyValue kv1 = new KeyValue(blur.radiusProperty(), blurRadius);
    KeyFrame kf1 = new KeyFrame(Duration.millis(getDuration(duration)), kv1);
    ColorAdjust darken = new ColorAdjust();
    darken.setBrightness(0.0);
    blur.setInput(darken);
    KeyValue kv2 = new KeyValue(darken.brightnessProperty(), brightness);
    KeyFrame kf2 = new KeyFrame(Duration.millis(getDuration(duration)), kv2);
    timeline.getKeyFrames().addAll(kf1, kf2);
    node.setEffect(blur);
    if (removeNode)
        timeline.setOnFinished(actionEvent -> UserThread.execute(() -> ((Pane) (node.getParent())).getChildren().remove(node)));
    timeline.play();
}
Also used : EventHandler(javafx.event.EventHandler) Inject(javax.inject.Inject) Preferences(io.bitsquare.user.Preferences) ActionEvent(javafx.event.ActionEvent) Duration(javafx.util.Duration) UserThread(io.bitsquare.common.UserThread) Node(javafx.scene.Node) javafx.animation(javafx.animation) ColorAdjust(javafx.scene.effect.ColorAdjust) GaussianBlur(javafx.scene.effect.GaussianBlur) Pane(javafx.scene.layout.Pane) GaussianBlur(javafx.scene.effect.GaussianBlur) ColorAdjust(javafx.scene.effect.ColorAdjust) Pane(javafx.scene.layout.Pane)

Aggregations

GaussianBlur (javafx.scene.effect.GaussianBlur)14 Bloom (javafx.scene.effect.Bloom)5 ColorAdjust (javafx.scene.effect.ColorAdjust)4 ActionEvent (javafx.event.ActionEvent)3 Polygon (javafx.scene.shape.Polygon)3 Rotate (javafx.scene.transform.Rotate)3 Duration (javafx.util.Duration)3 FadeTransition (javafx.animation.FadeTransition)2 KeyFrame (javafx.animation.KeyFrame)2 KeyValue (javafx.animation.KeyValue)2 Timeline (javafx.animation.Timeline)2 EventHandler (javafx.event.EventHandler)2 Node (javafx.scene.Node)2 Pane (javafx.scene.layout.Pane)2 Inject (javax.inject.Inject)2 UserThread (bisq.common.UserThread)1 Preferences (bisq.core.user.Preferences)1 UserThread (io.bitsquare.common.UserThread)1 Preferences (io.bitsquare.user.Preferences)1 Point (java.awt.Point)1