test
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -32,6 +32,7 @@ import javafx.collections.ObservableList;
|
|||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.control.ContentDisplay;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
import javafx.scene.control.TabPane;
|
import javafx.scene.control.TabPane;
|
||||||
@@ -127,6 +128,7 @@ public class MainController {
|
|||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() throws FlowException {
|
public void init() throws FlowException {
|
||||||
|
|
||||||
userLabel.textProperty().bind(ApplicatonStore.nameProperty());
|
userLabel.textProperty().bind(ApplicatonStore.nameProperty());
|
||||||
roleLabel.textProperty().bind(ApplicatonStore.getRoles().asString());
|
roleLabel.textProperty().bind(ApplicatonStore.getRoles().asString());
|
||||||
userButton.textProperty().bind(ApplicatonStore.nameProperty());
|
userButton.textProperty().bind(ApplicatonStore.nameProperty());
|
||||||
|
|||||||
@@ -10,18 +10,15 @@ import com.epri.fx.client.store.ApplicatonStore;
|
|||||||
import com.jfoenix.controls.JFXButton;
|
import com.jfoenix.controls.JFXButton;
|
||||||
import com.jfoenix.svg.SVGGlyph;
|
import com.jfoenix.svg.SVGGlyph;
|
||||||
import com.jfoenix.svg.SVGGlyphLoader;
|
import com.jfoenix.svg.SVGGlyphLoader;
|
||||||
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon;
|
import javafx.animation.Interpolator;
|
||||||
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView;
|
import javafx.animation.RotateTransition;
|
||||||
import de.jensd.fx.glyphs.materialicons.MaterialIcon;
|
import javafx.animation.SequentialTransition;
|
||||||
import de.jensd.fx.glyphs.materialicons.MaterialIconView;
|
|
||||||
import javafx.animation.*;
|
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.geometry.Point3D;
|
import javafx.geometry.Point3D;
|
||||||
import javafx.scene.DepthTest;
|
import javafx.scene.DepthTest;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
import javafx.scene.transform.Rotate;
|
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import javafx.util.Duration;
|
import javafx.util.Duration;
|
||||||
|
|
||||||
@@ -48,30 +45,26 @@ public class TestFx extends Application {
|
|||||||
button.setPrefHeight(100);
|
button.setPrefHeight(100);
|
||||||
button.setPrefWidth(200);
|
button.setPrefWidth(200);
|
||||||
button.setRipplerFill(Color.RED);
|
button.setRipplerFill(Color.RED);
|
||||||
button.setDepthTest(DepthTest.DISABLE);
|
SVGGlyph materialIconView = SVGGlyphLoader.getIcoMoonGlyph(ApplicatonStore.ICON_FONT_KEY + ".home-outline");
|
||||||
SVGGlyph materialIconView= SVGGlyphLoader.getIcoMoonGlyph(ApplicatonStore.ICON_FONT_KEY+".home-outline");
|
// materialIconView.setDepthTest(DepthTest.DISABLE);
|
||||||
|
materialIconView.setRotationAxis(new Point3D(0, 1, 0));
|
||||||
materialIconView.setSize(80);
|
materialIconView.setSize(80);
|
||||||
button.setGraphic(materialIconView);
|
button.setGraphic(materialIconView);
|
||||||
StackPane stackPane = new StackPane();
|
StackPane stackPane = new StackPane();
|
||||||
stackPane.getChildren().add(button);
|
stackPane.getChildren().add(button);
|
||||||
button.setRotationAxis(new Point3D(1, 0, 0));
|
|
||||||
|
|
||||||
RotateTransition transition1=new RotateTransition(Duration.millis(400),button);
|
RotateTransition transition1 = new RotateTransition(Duration.millis(500), materialIconView);
|
||||||
transition1.setByAngle(180);
|
transition1.setByAngle(180);
|
||||||
transition1.setInterpolator(Interpolator.EASE_OUT);
|
transition1.setInterpolator(Interpolator.EASE_BOTH);
|
||||||
transition1.setOnFinished(event -> {
|
transition1.setOnFinished(event -> {
|
||||||
});
|
});
|
||||||
RotateTransition transition2=new RotateTransition(Duration.millis(300),button);
|
|
||||||
transition2.setByAngle(90);
|
|
||||||
transition2.setInterpolator(Interpolator.EASE_BOTH);
|
|
||||||
transition2.setOnFinished(event -> {
|
|
||||||
});
|
|
||||||
|
|
||||||
SequentialTransition sequentialTransition=new SequentialTransition();
|
|
||||||
sequentialTransition.getChildren().addAll(transition1);
|
|
||||||
|
|
||||||
button.setOnMouseEntered(event -> {
|
button.setOnMouseEntered(event -> {
|
||||||
sequentialTransition.play();
|
transition1.play();
|
||||||
|
});
|
||||||
|
button.setOnMouseExited(event -> {
|
||||||
|
transition1.play();
|
||||||
});
|
});
|
||||||
|
|
||||||
Scene scene = new Scene(stackPane, 1000, 700);
|
Scene scene = new Scene(stackPane, 1000, 700);
|
||||||
@@ -79,4 +72,8 @@ public class TestFx extends Application {
|
|||||||
primaryStage.setTitle("JavaFX Welcome");
|
primaryStage.setTitle("JavaFX Welcome");
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
launch(args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user