forked from francescotescari/XiaoMiToolV2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89524f4
commit 9210ce7
Showing
11 changed files
with
161 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.xiaomitool.v2.gui; | ||
|
||
import com.xiaomitool.v2.logging.Log; | ||
import javafx.application.Application; | ||
import javafx.application.Preloader; | ||
import javafx.scene.Scene; | ||
import javafx.scene.image.Image; | ||
import javafx.scene.image.ImageView; | ||
import javafx.scene.layout.StackPane; | ||
import javafx.scene.paint.Color; | ||
import javafx.scene.text.Text; | ||
import javafx.stage.Stage; | ||
import javafx.stage.StageStyle; | ||
|
||
public class SplashScreen extends Preloader { | ||
private static SplashScreen instance; | ||
public static SplashScreen getInstance(){ | ||
return instance; | ||
} | ||
private String title; | ||
private Image image; | ||
private Stage primaryStage, secondaryStage; | ||
|
||
public SplashScreen(String title, Image image){ | ||
Log.debug(image); | ||
this.title = title; | ||
this.image = image; | ||
} | ||
|
||
@Override | ||
public void start(Stage primaryStage) { | ||
Log.debug(this.image.getHeight()); | ||
StackPane root = new StackPane(new ImageView(this.image)); | ||
Scene scene = new Scene(root); | ||
//scene.setFill(Color.TRANSPARENT); | ||
primaryStage.setTitle(this.title); | ||
primaryStage.initStyle(StageStyle.UTILITY); | ||
primaryStage.setOpacity(0); | ||
|
||
Stage secondaryStage = new Stage(StageStyle.UNDECORATED); | ||
secondaryStage.initOwner(primaryStage); | ||
secondaryStage.setScene(scene); | ||
primaryStage.show(); | ||
secondaryStage.show(); | ||
this.primaryStage = primaryStage; | ||
this.secondaryStage = secondaryStage; | ||
instance = this; | ||
|
||
} | ||
|
||
public void stopSplash() { | ||
this.secondaryStage.close(); | ||
this.primaryStage.close(); | ||
instance = null; | ||
} | ||
|
||
|
||
@Override | ||
public void handleStateChangeNotification(StateChangeNotification evt) { | ||
Log.debug(evt); | ||
if (evt.getType() == StateChangeNotification.Type.BEFORE_START) { | ||
this.primaryStage.hide(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.xiaomitool.v2.utility; | ||
|
||
public class Pointer { | ||
public Object pointed; | ||
public class Pointer<T> { | ||
public T pointed; | ||
} |