Skip to content

Commit

Permalink
splash image
Browse files Browse the repository at this point in the history
  • Loading branch information
fourthline committed Aug 8, 2014
1 parent eb72ea2 commit e80dfcf
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<property name="app.version" value="1.0-alpha12" />
<property name="app.main-class" value="fourthline.mabiicco.MabiIcco" />
<property name="app.preloader-class" value="fourthline.mabiicco.preloader.MabiIccoPreloader" />
<property name="splash.image" value="img/title.png" />

<!-- clean task -->
<target name="clean">
Expand Down Expand Up @@ -85,6 +86,7 @@
<attribute name="Implementation-Title" value="${app.name}" />
<attribute name="Implementation-Version" value="${app.version}" />
<attribute name="Implementation-Build" value="${build.number}" />
<attribute name="SplashScreen-Image" value="${splash.image}" />
</manifest>
<fileset dir="${dest}" />
</fx:jar>
Expand Down
11 changes: 11 additions & 0 deletions src/fourthline/mabiicco/preloader/MabiIccoPreloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

package fourthline.mabiicco.preloader;

import java.awt.Rectangle;
import java.awt.SplashScreen;

import fourthline.mabiicco.AppResource;
import javafx.application.Preloader;
import javafx.fxml.FXMLLoader;
Expand All @@ -30,7 +33,15 @@ public void start(Stage stage) throws Exception {
this.stage = stage;
stage.initStyle(StageStyle.UNDECORATED);
stage.setScene(createPreloaderScene());
SplashScreen splashScreen = SplashScreen.getSplashScreen();
stage.show();
if (splashScreen != null) {
Rectangle rect = splashScreen.getBounds();
if ( (stage.getWidth() == rect.width) && (stage.getHeight() == rect.height) ) {
stage.setX(rect.x);
stage.setY(rect.y);
}
}
}

@Override
Expand Down
5 changes: 1 addition & 4 deletions src/fourthline/mabiicco/preloader/Startup.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
</font>
<cursor>
</cursor></TextArea><ProgressBar fx:id="bar" layoutX="14.0" layoutY="190.0" prefHeight="18.0" prefWidth="272.0" progress="0.0" />
<Label layoutX="88.0" layoutY="42.0" text=" * MabiIcco * ">
<font>
<Font name="Meiryo" size="18.0" />
</font></Label><Label fx:id="versionLabel" layoutX="168.0" layoutY="78.0" prefHeight="15.0" prefWidth="120.0" textAlignment="RIGHT">
<Label fx:id="versionLabel" layoutX="168.0" layoutY="78.0" prefHeight="15.0" prefWidth="120.0" textAlignment="RIGHT">
<font>
<Font name="Meiryo" size="10.0" />
</font></Label>
Expand Down
4 changes: 2 additions & 2 deletions src/fourthline/mabiicco/preloader/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AnchorPane {
-fx-border-width: 1;
-fx-border-color: black;
-fx-border-width: 0;
-fx-background-image: url("/img/title.png");
}
Binary file added src/img/title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e80dfcf

Please sign in to comment.