Search in sources :

Example 11 with ActionEvent

use of javafx.event.ActionEvent in project bitsquare by bitsquare.

the class VolumeChart method seriesRemoved.

@Override
protected void seriesRemoved(XYChart.Series<Number, Number> series) {
    for (XYChart.Data<Number, Number> d : series.getData()) {
        final Node volumeBar = d.getNode();
        if (shouldAnimate()) {
            FadeTransition ft = new FadeTransition(Duration.millis(500), volumeBar);
            ft.setToValue(0);
            ft.setOnFinished((ActionEvent actionEvent) -> getPlotChildren().remove(volumeBar));
            ft.play();
        } else {
            getPlotChildren().remove(volumeBar);
        }
    }
}
Also used : FadeTransition(javafx.animation.FadeTransition) ActionEvent(javafx.event.ActionEvent) Node(javafx.scene.Node) XYChart(javafx.scene.chart.XYChart)

Example 12 with ActionEvent

use of javafx.event.ActionEvent in project bitsquare by bitsquare.

the class CandleStickChart method seriesRemoved.

@Override
protected void seriesRemoved(XYChart.Series<Number, Number> series) {
    // remove all candle nodes
    for (XYChart.Data<Number, Number> d : series.getData()) {
        final Node candle = d.getNode();
        if (shouldAnimate()) {
            FadeTransition ft = new FadeTransition(Duration.millis(500), candle);
            ft.setToValue(0);
            ft.setOnFinished((ActionEvent actionEvent) -> {
                getPlotChildren().remove(candle);
            });
            ft.play();
        } else {
            getPlotChildren().remove(candle);
        }
    }
    if (series.getNode() instanceof Path) {
        Path seriesPath = (Path) series.getNode();
        if (shouldAnimate()) {
            FadeTransition ft = new FadeTransition(Duration.millis(500), seriesPath);
            ft.setToValue(0);
            ft.setOnFinished((ActionEvent actionEvent) -> {
                getPlotChildren().remove(seriesPath);
                seriesPath.getElements().clear();
            });
            ft.play();
        } else {
            getPlotChildren().remove(seriesPath);
            seriesPath.getElements().clear();
        }
    }
}
Also used : Path(javafx.scene.shape.Path) FadeTransition(javafx.animation.FadeTransition) ActionEvent(javafx.event.ActionEvent) Node(javafx.scene.Node) XYChart(javafx.scene.chart.XYChart)

Example 13 with ActionEvent

use of javafx.event.ActionEvent in project Gargoyle by callakrsos.

the class LettersPane method createRandomTimeLine.

private Timeline createRandomTimeLine(Node node) {
    // over 3 seconds move letter to random position and fade it out
    final Timeline timeline = new Timeline();
    timeline.getKeyFrames().add(new KeyFrame(Duration.seconds(3), new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            // we are done remove us from scene
            getChildren().remove(node);
        }
    }, new KeyValue(node.translateXProperty(), getRandom(0.0f, getWidth() - node.getBoundsInLocal().getWidth()), INTERPOLATOR), new KeyValue(node.translateYProperty(), getRandom(0.0f, getHeight() - node.getBoundsInLocal().getHeight()), INTERPOLATOR), new KeyValue(node.opacityProperty(), 0f)));
    return timeline;
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) ActionEvent(javafx.event.ActionEvent) KeyFrame(javafx.animation.KeyFrame) EventHandler(javafx.event.EventHandler)

Example 14 with ActionEvent

use of javafx.event.ActionEvent in project Gargoyle by callakrsos.

the class LettersPane method createUpperTimeLine.

//	private Timeline createCurveTimeLine(Node node) {
//		// over 3 seconds move letter to random position and fade it out
//		final Timeline timeline = new Timeline();
//		timeline.getKeyFrames().add(new KeyFrame(Duration.seconds(3), new EventHandler<ActionEvent>() {
//			@Override
//			public void handle(ActionEvent event) {
//				// we are done remove us from scene
//				getChildren().remove(node);
//			}
//		}, new KeyValue(node.translateXProperty(), node.translateXProperty().get(), INTERPOLATOR),
//			new KeyValue(node.translateYProperty(), 100f, INTERPOLATOR), new KeyValue(node.opacityProperty(), 0f)));
//
//		new KeyFrame(Duration.millis(0.5), new KeyFrame(time, values))
//
//
//
//		return timeline;
//
//
//	}
private Timeline createUpperTimeLine(Node node) {
    // over 3 seconds move letter to random position and fade it out
    final Timeline timeline = new Timeline();
    timeline.getKeyFrames().add(new KeyFrame(Duration.seconds(3), new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            // we are done remove us from scene
            getChildren().remove(node);
        }
    }, new KeyValue(node.translateXProperty(), node.translateXProperty().get(), INTERPOLATOR), new KeyValue(node.translateYProperty(), 100f, INTERPOLATOR), new KeyValue(node.opacityProperty(), 0f)));
    return timeline;
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) ActionEvent(javafx.event.ActionEvent) KeyFrame(javafx.animation.KeyFrame) EventHandler(javafx.event.EventHandler)

Example 15 with ActionEvent

use of javafx.event.ActionEvent in project Gargoyle by callakrsos.

the class PagedCodeAreaHelper method codeAreaKeyClick.

/**
	 * 키클릭 이벤트 처리
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2015. 12. 14.
	 * @param e
	 */
public void codeAreaKeyClick(KeyEvent e) {
    if (KeyCode.F == e.getCode() && e.isControlDown() && !e.isShiftDown() && !e.isAltDown()) {
        if (!e.isConsumed()) {
            findAndReplaceHelper.findReplaceEvent(new ActionEvent());
            e.consume();
        }
    } else if (KeyCode.L == e.getCode() && e.isControlDown() && !e.isShiftDown() && !e.isAltDown()) {
        if (!e.isConsumed()) {
            moveToLineEvent(new ActionEvent());
            e.consume();
        }
    } else if (KeyCode.U == e.getCode() && e.isControlDown() && e.isShiftDown() && !e.isAltDown()) {
        if (!e.isConsumed()) {
            toUppercaseEvent(new ActionEvent());
            e.consume();
        }
    } else if (KeyCode.L == e.getCode() && e.isControlDown() && e.isShiftDown() && !e.isAltDown()) {
        if (!e.isConsumed()) {
            toLowercaseEvent(new ActionEvent());
            e.consume();
        }
    } else {
        codeArea.getUndoManager().mark();
    }
}
Also used : ActionEvent(javafx.event.ActionEvent)

Aggregations

ActionEvent (javafx.event.ActionEvent)37 List (java.util.List)11 Label (javafx.scene.control.Label)11 ObservableList (javafx.collections.ObservableList)10 FxUtil (com.kyj.fx.voeditor.visual.util.FxUtil)9 ArrayList (java.util.ArrayList)9 Optional (java.util.Optional)9 Button (javafx.scene.control.Button)9 MenuItem (javafx.scene.control.MenuItem)9 Stage (javafx.stage.Stage)9 ResourceLoader (com.kyj.fx.voeditor.visual.momory.ResourceLoader)8 DialogUtil (com.kyj.fx.voeditor.visual.util.DialogUtil)8 ValueUtil (com.kyj.fx.voeditor.visual.util.ValueUtil)8 File (java.io.File)8 MouseEvent (javafx.scene.input.MouseEvent)8 Pair (javafx.util.Pair)8 Logger (org.slf4j.Logger)8 ConfigResourceLoader (com.kyj.fx.voeditor.visual.momory.ConfigResourceLoader)7 Iterator (java.util.Iterator)7 FXCollections (javafx.collections.FXCollections)7