Import views plugins
[deliverable/tracecompass.git] / tmf / org.lttng.scope.tmf2.views.ui / src / org / lttng / scope / tmf2 / views / ui / jfx / Logo.java
1 package org.lttng.scope.tmf2.views.ui.jfx;
2
3 import org.eclipse.jdt.annotation.Nullable;
4
5 import javafx.animation.Animation;
6 import javafx.animation.Interpolator;
7 import javafx.animation.RotateTransition;
8 import javafx.application.Application;
9 import javafx.scene.Group;
10 import javafx.scene.Scene;
11 import javafx.scene.layout.Pane;
12 import javafx.scene.paint.Color;
13 import javafx.scene.shape.Circle;
14 import javafx.scene.shape.Rectangle;
15 import javafx.stage.Stage;
16 import javafx.util.Duration;
17
18 public class Logo extends Application {
19
20 private static final String BACKGROUND_STYLE = "-fx-background-color: rgba(255, 255, 255, 255);"; //$NON-NLS-1$
21
22 private static final Color LTTNG_PURPLE = Color.web("#996ABC"); //$NON-NLS-1$
23 private static final Color LTTNG_LIGHT_BLUE = Color.web("#C3DEF4"); //$NON-NLS-1$
24
25 @Override
26 public void start(@Nullable Stage stage) throws Exception {
27 if (stage == null) {
28 return;
29 }
30
31 Rectangle clipRect1 = new Rectangle(-130, -130, 115, 115);
32 Rectangle clipRect2 = new Rectangle(15, -130, 115, 115);
33 Rectangle clipRect3 = new Rectangle(-130, 15, 115, 115);
34 Rectangle clipRect4 = new Rectangle(15, 15, 115, 115);
35 Group clip = new Group(clipRect1, clipRect2, clipRect3, clipRect4);
36
37 Circle spinnanCircle = new Circle(100);
38 spinnanCircle.setFill(null);
39 spinnanCircle.setStrokeWidth(30);
40 spinnanCircle.setStroke(LTTNG_PURPLE);
41 spinnanCircle.setClip(clip);
42
43 Circle magCircle = new Circle(60);
44 magCircle.setFill(null);
45 magCircle.setStrokeWidth(25);
46 magCircle.setStroke(LTTNG_LIGHT_BLUE);
47
48 Rectangle magHandle = new Rectangle(-12.5, 60, 25, 110);
49 magHandle.setFill(LTTNG_LIGHT_BLUE);
50
51 Group mag = new Group(magCircle, magHandle);
52
53 Group root = new Group(spinnanCircle, mag);
54 root.setRotate(30);
55 root.relocate(0, 0);
56
57 Pane pane = new Pane(root);
58 pane.setStyle(BACKGROUND_STYLE);
59
60 RotateTransition spinnan = new RotateTransition(Duration.seconds(4), spinnanCircle);
61 spinnan.setByAngle(360);
62 spinnan.setCycleCount(Animation.INDEFINITE);
63 spinnan.setInterpolator(Interpolator.LINEAR);
64
65 Scene scene = new Scene(pane);
66 stage.setScene(scene);
67 stage.show();
68
69 spinnan.play();
70 }
71
72 public static void main(String[] args) {
73 launch(args);
74 }
75
76 }
This page took 0.031928 seconds and 5 git commands to generate.