Search in sources :

Example 6 with ColorAdjust

use of javafx.scene.effect.ColorAdjust in project bisq-desktop by bisq-network.

the class Transitions method removeEffect.

private void removeEffect(Node node, int duration) {
    if (node != null) {
        node.setMouseTransparent(false);
        removeEffectTimeLine = new Timeline();
        GaussianBlur blur = (GaussianBlur) node.getEffect();
        if (blur != null) {
            KeyValue kv1 = new KeyValue(blur.radiusProperty(), 0.0);
            KeyFrame kf1 = new KeyFrame(Duration.millis(getDuration(duration)), kv1);
            removeEffectTimeLine.getKeyFrames().add(kf1);
            ColorAdjust darken = (ColorAdjust) blur.getInput();
            KeyValue kv2 = new KeyValue(darken.brightnessProperty(), 0.0);
            KeyFrame kf2 = new KeyFrame(Duration.millis(getDuration(duration)), kv2);
            removeEffectTimeLine.getKeyFrames().add(kf2);
            removeEffectTimeLine.setOnFinished(actionEvent -> {
                node.setEffect(null);
                removeEffectTimeLine = null;
            });
            removeEffectTimeLine.play();
        } else {
            node.setEffect(null);
            removeEffectTimeLine = null;
        }
    }
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) GaussianBlur(javafx.scene.effect.GaussianBlur) KeyFrame(javafx.animation.KeyFrame) ColorAdjust(javafx.scene.effect.ColorAdjust)

Example 7 with ColorAdjust

use of javafx.scene.effect.ColorAdjust in project JFoenix by jfoenixadmin.

the class JFXColorPickerUI method refreshHSLCircle.

private void refreshHSLCircle() {
    ColorAdjust colorAdjust = new ColorAdjust();
    colorAdjust.setHue(map(currentHue + (currentHue < 127.5 ? 1 : -1) * 127.5, 0, 255, -1, 1));
    slCircleView.setEffect(colorAdjust);
    setColorAtLocation((int) selector.getTranslateX() + selectorSize / 2, (int) selector.getTranslateY() + selectorSize / 2);
}
Also used : ColorAdjust(javafx.scene.effect.ColorAdjust)

Example 8 with ColorAdjust

use of javafx.scene.effect.ColorAdjust in project POL-POM-5 by PhoenicisOrg.

the class IconsListElementSkin method updateEnabled.

/**
 * Updates grayscale of the miniature when the enabled state has been updated
 *
 * @param miniature The miniature
 */
private void updateEnabled(final Region miniature) {
    if (!getControl().isEnabled()) {
        final ColorAdjust grayScale = new ColorAdjust();
        grayScale.setSaturation(-1);
        miniature.setEffect(grayScale);
    } else {
        miniature.setEffect(null);
    }
}
Also used : ColorAdjust(javafx.scene.effect.ColorAdjust)

Aggregations

ColorAdjust (javafx.scene.effect.ColorAdjust)8 GaussianBlur (javafx.scene.effect.GaussianBlur)4 KeyFrame (javafx.animation.KeyFrame)2 KeyValue (javafx.animation.KeyValue)2 Timeline (javafx.animation.Timeline)2 ActionEvent (javafx.event.ActionEvent)2 EventHandler (javafx.event.EventHandler)2 Node (javafx.scene.Node)2 Pane (javafx.scene.layout.Pane)2 Duration (javafx.util.Duration)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 javafx.animation (javafx.animation)1 FadeTransition (javafx.animation.FadeTransition)1 Interpolator (javafx.animation.Interpolator)1 Effect (javafx.scene.effect.Effect)1 ImageView (javafx.scene.image.ImageView)1