Skip to content

Commit

Permalink
Se agrega la version por pom y se corrige tamaño del mensaje de alerta
Browse files Browse the repository at this point in the history
  • Loading branch information
dscontrak committed Sep 24, 2019
1 parent 5f5e554 commit 22f2714
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 12 deletions.
14 changes: 10 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>com.grupoad3.flexfx.MainApp</mainClass>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>dd-MM-yyyy HH:mm</maven.build.timestamp.format>
</properties>

<organization>
<!-- Used as the 'Vendor' for JNLP generation -->
<name>None</name>
</organization>

<build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -105,10 +107,14 @@
</configuration>
</plugin>
</plugins>

<!-- Para copiar los archivos de propiedades al directorio y no al JAR -->
<resources>
<!-- Para copiar los archivos de propiedades al directorio y no al JAR -->

<!-- Para poner lo del build.properties las propiedades respectivas
https://memorynotfound.com/maven-build-information-properties-file/ -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>

Expand Down
26 changes: 20 additions & 6 deletions src/main/java/com/grupoad3/flexfx/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.io.IOException;
import java.net.URLDecoder;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
Expand All @@ -41,9 +42,11 @@ public class MainApp extends Application {
private final ObservableList<RssItems> rssItemsData = FXCollections.observableArrayList();
private final ObservableList<MediaFilters> mediaFiltersData = FXCollections.observableArrayList();
private String currentDirJAR;
private Properties buildProperties;

public final String NAME_APP = "FlexFX";
public final String VERSION = "v1.1"; //0 - Version Cero no es para el publico
public String VERSION = "v0"; //0 - Version Cero no es para el publico


public String getNAME_APP() {
return NAME_APP;
Expand Down Expand Up @@ -96,15 +99,16 @@ public void start(Stage stage) throws Exception {
if (databaseFile.exists() == false) {
databaseFile.createNewFile();
}


primaryStage = stage;
primaryStage.setTitle(getNameCompleteApp());
primaryStage.getIcons().add(iconoApp);


initProperties();
initDBMigration();
initData();
initBuildData();

primaryStage = stage;
primaryStage.getIcons().add(iconoApp);
primaryStage.setTitle(getNameCompleteApp());

showMainViewWindow();
}
Expand Down Expand Up @@ -324,4 +328,14 @@ public boolean showConfigDialog() {
}
}

private void initBuildData() throws IOException {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
buildProperties = new Properties();
buildProperties.load( loader.getResourceAsStream( "build.properties" ) );

if(buildProperties != null && buildProperties.size() > 0){
VERSION = buildProperties.getProperty("build.version");
}
}

}
4 changes: 2 additions & 2 deletions src/main/java/com/grupoad3/flexfx/ui/AlertIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public AlertIcon(AlertType alertType) {
}

setHeaderText(null);
getDialogPane().setMinWidth(Region.USE_PREF_SIZE);
getDialogPane().setPrefWidth(800);


}
Expand Down Expand Up @@ -90,7 +90,7 @@ public void setExeption(Throwable exeption) {

String stackTrace = getStackTrace(ex);
TextArea textArea = new TextArea();
textArea.setMaxWidth(200);

textArea.setText(stackTrace);

dialogPaneContent.getChildren().addAll(label, textArea);
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.

build.version=${pom.version}
build.description=${pom.description}
build.date=${timestamp}
build.name=${pom.name}

0 comments on commit 22f2714

Please sign in to comment.