Java Code Examples for javafx.animation.TranslateTransition#setByX()
The following examples show how to use
javafx.animation.TranslateTransition#setByX() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LoginFader.java From iliasDownloaderTool with GNU General Public License v2.0 | 6 votes |
private void fade(double c, GridPane login) { TranslateTransition t1 = new TranslateTransition(Duration.millis(500), dashboard.getActionBar()); t1.setByX(c); TranslateTransition t2 = new TranslateTransition(Duration.millis(500), login); t2.setByX(c); t2.setFromX(login.getLayoutX() - c); t2.setToX(login.getLayoutX()); p.getChildren().addAll(t1, t2); p.setInterpolator(new Interpolator() { @Override protected double curve(double t) { return Math.pow(t, 2); } }); p.play(); if (login.getOpacity() == 0) { login.setOpacity(1); } else { login.setOpacity(0); } }
Example 2
Source File: RenderEngine.java From strangefx with BSD 3-Clause "New" or "Revised" License | 5 votes |
public void animate() { final Qubit3D node = qubits.get(counter++ % qubits.size()); TranslateTransition tt = new TranslateTransition(Duration.seconds(5), node); node.resetStep(); tt.setFromX(0); tt.setByX(nSteps * stepSize); tt.playFromStart(); }
Example 3
Source File: AnimatedTableRow.java From mars-sim with GNU General Public License v3.0 | 5 votes |
private TranslateTransition createAndConfigureAnimation( final TableView<Person> sourceTable, final TableView<Person> destinationTable, final Pane commonTableAncestor, final TableRow<Person> row, final ImageView imageView, final Point2D animationStartPoint, Point2D animationEndPoint) { final TranslateTransition transition = new TranslateTransition(ANIMATION_DURATION, imageView); // At end of animation, actually move data, and remove animated image transition.setOnFinished(createAnimationFinishedHandler(sourceTable, destinationTable, commonTableAncestor, row.getItem(), imageView)); // configure transition transition.setByX(animationEndPoint.getX() - animationStartPoint.getX()); // absolute translation, computed from coords relative to Scene transition.setByY(animationEndPoint.getY() - animationStartPoint.getY()); // absolute translation, computed from coords relative to Scene return transition; }