Skip to content

Commit

Permalink
Release version 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
twasyl committed Feb 21, 2017
1 parent 884e0f3 commit 2282471
Show file tree
Hide file tree
Showing 24 changed files with 1,017 additions and 626 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ matrix:
- os: linux
jdk: oraclejdk8
- os: osx
osx_image: xcode8
osx_image: xcode8.2


before_install:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.textile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ p. Changes to the SlideshowFX software are listed by version within this documen

h2. Versions

h3(#1_4). "Version 1.4":#1_4

h4. New and noteworthy

* Create files and directories directly from the tree view of the template builder ("#26":https://github.com/twasyl/SlideshowFX/issues/26)
* Display the application version in the splash screen ("#29":https://github.com/twasyl/SlideshowFX/issues/29)
* Go to the newly added slide when adding a slide ("#30":https://github.com/twasyl/SlideshowFX/issues/30)

h4. Bug fixes

* The help can be displayed ("#24":https://github.com/twasyl/SlideshowFX/issues/24)
* The label for the slides' template directory within the template builder has been corrected ("#25":https://github.com/twasyl/SlideshowFX/issues/25)
* Allow to load the template's configuration when a slide has no template elements ("#27":https://github.com/twasyl/SlideshowFX/issues/27)
* Allow to insert a slide that has no template elements in a presentation ("#28":https://github.com/twasyl/SlideshowFX/issues/28)

h3(#1_3). "Version 1.3":#1_3

h4. New and noteworthy
Expand Down
2 changes: 1 addition & 1 deletion SlideshowFX-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.sun.javafx.PlatformUtil

version = '1.3'
version = '1.4'

dependencies {
compile project(':SlideshowFX-engines')
Expand Down
60 changes: 49 additions & 11 deletions SlideshowFX-app/src/main/java/com/twasyl/slideshowfx/app/SlideshowFXPreloader.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
package com.twasyl.slideshowfx.app;

import com.twasyl.slideshowfx.utils.Jar;
import com.twasyl.slideshowfx.utils.ResourceHelper;
import javafx.animation.FadeTransition;
import javafx.application.Preloader;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.util.Duration;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* This class is the custom preloader for SlideshowFX. It displays a splash screen that fade in and fade out
* before the application starts.
Expand All @@ -20,21 +29,14 @@
* @since SlideshowFX 1.0
*/
public class SlideshowFXPreloader extends Preloader {

private static Logger LOGGER = Logger.getLogger(SlideshowFXPreloader.class.getName());
private Stage currentStage;

@Override
public void start(Stage primaryStage) throws Exception {
this.currentStage = primaryStage;

final Image splashImage = new Image(ResourceHelper.getInputStream("/com/twasyl/slideshowfx/images/splash.png"));
final ImageView view = new ImageView(splashImage);

final BorderPane pane = new BorderPane();
pane.centerProperty().set(view);
pane.setBackground(null);
pane.setOpacity(0);

final StackPane pane = getRootView();
final Scene scene = new Scene(pane);
scene.setFill(null);

Expand All @@ -55,9 +57,45 @@ public void start(Stage primaryStage) throws Exception {
fadeIn.play();
}

protected StackPane getRootView() {
final StackPane pane = new StackPane();
pane.setAlignment(Pos.CENTER);
pane.setBackground(null);
pane.setOpacity(0);

final Label version = getVersion();
version.setTranslateY(110);

pane.getChildren().addAll(getSplashImage(), version);

return pane;
}

protected ImageView getSplashImage() {
final Image splashImage = new Image(ResourceHelper.getInputStream("/com/twasyl/slideshowfx/images/splash.png"));
return new ImageView(splashImage);
}

protected Label getVersion() {
final Font font = new Font(Font.getDefault().getName(), 15);

final Label text = new Label();
text.setFont(font);

try {
try (final Jar jar = Jar.fromClass(getClass())) {
text.setText(jar.getImplementationVersion());
}
} catch (IOException | URISyntaxException e) {
LOGGER.log(Level.SEVERE, "Can not determine application version", e);
}

return text;
}

@Override
public void handleStateChangeNotification(StateChangeNotification info) {
if(info.getType() == StateChangeNotification.Type.BEFORE_START) {
if (info.getType() == StateChangeNotification.Type.BEFORE_START) {
final FadeTransition fadeOut = new FadeTransition(Duration.millis(500), this.currentStage.getScene().getRoot());
fadeOut.setFromValue(1.0);
fadeOut.setToValue(0);
Expand Down
14 changes: 11 additions & 3 deletions ...pp/src/main/java/com/twasyl/slideshowfx/concurrent/ReloadPresentationViewAndGoToTask.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@

import com.twasyl.slideshowfx.controllers.PresentationViewController;

import java.util.concurrent.CompletableFuture;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* This tasks reloads the presentation view and then go to a given slide. If the {@link #presentationView} is null
* , the task is considered as failed.
*
* @author Thierry Wasylczenko
* @version 1.0
* @version 1.1
* @since SlideshowFX 1.0
*/
public class ReloadPresentationViewAndGoToTask extends ReloadPresentationViewTask {
private static final Logger LOGGER = Logger.getLogger(ReloadPresentationViewAndGoToTask.class.getName());

public ReloadPresentationViewAndGoToTask(final PresentationViewController presentationView, final String slideId) {
super(presentationView, () -> {
presentationView.goToSlide(slideId);
presentationView.reloadPresentationBrowser();
final CompletableFuture<Boolean> reloadDone = presentationView.reloadPresentationBrowser();
reloadDone.thenRun(() -> {
LOGGER.log(Level.FINE, "Going to slide " + slideId);
presentationView.goToSlide(slideId);
});
});
}
}
37 changes: 13 additions & 24 deletions SlideshowFX-app/src/main/java/com/twasyl/slideshowfx/controllers/AboutViewController.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.twasyl.slideshowfx.osgi.OSGiManager;
import com.twasyl.slideshowfx.plugin.InstalledPlugin;
import com.twasyl.slideshowfx.snippet.executor.ISnippetExecutor;
import com.twasyl.slideshowfx.utils.Jar;
import javafx.event.Event;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
Expand All @@ -15,31 +16,32 @@
import javafx.scene.input.MouseEvent;
import javafx.stage.WindowEvent;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* Controller class of the {@code AboutView.fxml} view.
*
* @author Thierry Wasylczenko
* @version 1.1
* @since SlideshowFX 1.0
* @version 1.0
*/
public class AboutViewController implements Initializable {
private Logger LOGGER = Logger.getLogger(AboutViewController.class.getName());

@FXML private Parent root;
@FXML private Label slideshowFXVersion;
@FXML private Label javaVersion;
@FXML private TableView<InstalledPlugin> plugins;
@FXML
private Parent root;
@FXML
private Label slideshowFXVersion;
@FXML
private Label javaVersion;
@FXML
private TableView<InstalledPlugin> plugins;

@FXML
public void exitByClick(final MouseEvent event) {
Expand Down Expand Up @@ -69,31 +71,18 @@ public void initialize(URL location, ResourceBundle resources) {
/**
* Get the version of the application. The version is stored within the {@code MANIFEST.MF} file of the {@link JarFile}
* of the application.
*
* @return The version of the application stored in the {@code MANIFEST.MF} file or {@code null} if it can not be found.
*/
private String getApplicationVersion() {
String appVersion = null;

try(final JarFile jarFile = new JarFile(getJARLocation())) {
final Manifest manifest = jarFile.getManifest();
final Attributes attrs = manifest.getMainAttributes();
if(attrs != null) {
appVersion = attrs.getValue("Implementation-Version");
}
try (final Jar jar = Jar.fromClass(getClass())) {
appVersion = jar.getImplementationVersion();
} catch (IOException | URISyntaxException e) {
LOGGER.log(Level.SEVERE, "Can not get application's version", e);
}

return appVersion;
}

/**
* Get the {@link File} that corresponds to the JAR file of the application.
* @return The file corresponding to JRA file of the application.
* @throws URISyntaxException If the location can not be determined.
*/
private File getJARLocation() throws URISyntaxException {
final File file = new File(getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
return file;
}
}
9 changes: 5 additions & 4 deletions SlideshowFX-app/src/main/java/com/twasyl/slideshowfx/controllers/HelpViewController.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
* Controller class of the {@code HelpView.fxml} view.
*
* @author Thierry Wasylczenko
* @version 1.1
* @since SlideshowFX 1.0
* @version 1.0
*/
public class HelpViewController implements Initializable {

@FXML private WebView userDocumentationBrowser;
@FXML private WebView developerDocumentationBrowser;
@FXML
private WebView userDocumentationBrowser;
@FXML
private WebView developerDocumentationBrowser;

@Override
public void initialize(URL location, ResourceBundle resources) {
Expand Down Expand Up @@ -71,7 +73,6 @@ protected Attributes getAsciidoctorAttributes() {
.tableOfContents(Placement.LEFT)
.styleSheetName("slideshowfx.css")
.stylesDir(ResourceHelper.getExternalForm("/com/twasyl/slideshowfx/documentation/css"))
.imagesDir(ResourceHelper.getExternalForm("/com/twasyl/slideshowfx/documentation/images"))
.noFooter(true)
.get();

Expand Down
Loading

0 comments on commit 2282471

Please sign in to comment.