Skip to content

Commit

Permalink
Merge 34c2b33 into 340433b
Browse files Browse the repository at this point in the history
  • Loading branch information
JeridiOmar authored Apr 16, 2023
2 parents 340433b + 34c2b33 commit d81859e
Show file tree
Hide file tree
Showing 146 changed files with 3,174 additions and 725 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
java: [11]
java: [15]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GitHub page for this project: https://yprie.github.io/uPMT/

uPMT is aimed at researchers using microphenomenology interviews (also know as explicitation interviews) to study lived experience. It has been designed to help analyze the micro-dynamics of experience as described in interview transcriptions, by modelling and formalizing the sequential unfolding of "experience moments" described with categories and properties, and linked to the descriptemes - excerpts of the transcript - that justify them.

Current work is carried out by Yves Motteux and Esteban Jamin. Past developers were Gabriel Jolly (20-21), Xavier Tremillon, Yahuan Chen and Nathan Seva (19-20), Gwenaelle Gouriten, Salma Hichami and Othman Houmair (18-19), and Mehdi Haddad, Eva Boon and Yinxing Huang (17-18), under the supervision of Yannick Prié. The first version of the software was implemented by Corentin Jezequel in late 2017, under the supervision of Yannick Prié and Thomas Rabeyron.
Current work is carried out by Gabriel Jolly, Thomas Clouet and Célian Rolland. Past developers were Yves Motteux and Esteban Jamin (20-21), Xavier Tremillon, Yahuan Chen and Nathan Seva (19-20), Gwenaelle Gouriten, Salma Hichami and Othman Houmair (18-19), and Mehdi Haddad, Eva Boon and Yinxing Huang (17-18), under the supervision of Yannick Prié. The first version of the software was implemented by Corentin Jezequel in late 2017, under the supervision of Yannick Prié and Thomas Rabeyron.

Download the latest version at: https://github.com/yprie/uPMT/releases

Expand Down
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ repositories {
dependencies {
implementation 'com.google.code.gson:gson:2.8.2'

compile group: 'org.json', name: 'json', version: '20190722'
compile group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.4'
implementation group: 'org.json', name: 'json', version: '20190722'
implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.4'

// Use JUnit test framework
testImplementation 'junit:junit:4.12'
Expand All @@ -43,11 +43,12 @@ sourceSets {
}
}
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}



test {
systemProperty "file.encoding", "utf-8"
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
10 changes: 8 additions & 2 deletions src/main/java/application/UPMTApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import application.appCommands.ApplicationCommandFactory;
import application.configuration.Configuration;
import application.history.HistoryManager;
import com.sun.javafx.css.StyleManager;
import components.rootLayout.Controllers.RootLayoutController;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
Expand Down Expand Up @@ -33,11 +35,15 @@ public UPMTApp(Stage primaryStage) throws IOException {
HistoryManager.init(appCommandFactory);

Scene mainScene = new Scene(RootLayoutController.createRootLayout(rootLayoutController));

//set default stylesheet
Application.setUserAgentStylesheet(null);
StyleManager.getInstance().addUserAgentStylesheet(this.getClass().getResource("/css/application.css").toExternalForm());

primaryStage.setScene(mainScene);
primaryStage.setOnCloseRequest(event -> { appCommandFactory.closeApplication(event).execute(); });
primaryStage.setOnCloseRequest(event -> appCommandFactory.closeApplication(event).execute());
primaryStage.show();


//Load the last used project or ask for a new one.
if(Configuration.getProjectsPath().length > 0){
appCommandFactory.openRecentProject(Configuration.getProjectsPath()[0]).execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public ApplicationCommandFactory(UPMTApp app) {
this.application = app;
}

public CloseApplicationCommand closeApplication() { return new CloseApplicationCommand(this, application); }
public CloseApplicationCommand closeApplication(WindowEvent event) { return new CloseApplicationCommand(this, application, event); }
public ChangeApplicationTitleCommand changeApplicationTitle(String newTitle) { return new ChangeApplicationTitleCommand(application, newTitle); }
public OpenProjectManagerCommand openProjectManagerCommand() { return new OpenProjectManagerCommand(application); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public Void execute() {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle(Configuration.langBundle.getString("error"));
alert.setHeaderText(Configuration.langBundle.getString("application_language_change_failed"));
alert.getDialogPane().getStylesheets().add(getClass().getResource("/css/application.css").toExternalForm());
alert.showAndWait();
}
return null;
Expand Down
27 changes: 19 additions & 8 deletions src/main/java/application/appCommands/CloseApplicationCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,25 @@

public class CloseApplicationCommand extends ApplicationCommand<Void> {

public CloseApplicationCommand(ApplicationCommandFactory appCommandFactory, UPMTApp application, WindowEvent event) {

public CloseApplicationCommand(ApplicationCommandFactory appCommandFactory, UPMTApp application) {
super(application);
this.event = event;
this.appCommandFactory = appCommandFactory;
this.event = null;
}

public CloseApplicationCommand(ApplicationCommandFactory appCommandFactory, UPMTApp application, WindowEvent event) {
super(application);
this.appCommandFactory = appCommandFactory;
this.event = event;
}

WindowEvent event;
ApplicationCommandFactory appCommandFactory;
WindowEvent event;

@Override
public Void execute() {

System.out.println("Test checking project unsaved");
//TODO check for unsaved work
boolean workUnsaved = false;
String currentTitle = upmtApp.getPrimaryStage().getTitle();
UUID currentCommandId = HistoryManager.getCurrentCommandId();
Expand All @@ -49,6 +53,7 @@ public Void execute() {
alert.setHeaderText("");
alert.setTitle(Configuration.langBundle.getString("alert_unsaved_project_title"));
alert.setContentText(Configuration.langBundle.getString("alert_unsaved_project"));
alert.getDialogPane().getStylesheets().add(getClass().getResource("/css/application.css").toExternalForm());

ButtonType buttonTypeOne = new ButtonType(Configuration.langBundle.getString("alert_unsaved_project_buttonTypeOne"));
ButtonType buttonTypeTwo = new ButtonType(Configuration.langBundle.getString("alert_unsaved_project_buttonTypeTwo"));
Expand All @@ -64,11 +69,17 @@ public Void execute() {
} else if (result.get() == buttonTypeTwo) {
// ... user chose "Quit without saving"
System.exit(0);
} else {
// ... user chose CANCEL or closed the dialog
event.consume();
} else if (result.get() == buttonTypeCancel) {
// ... user chose "Cancel"
if (event != null) {
event.consume();
}
return null;
}
} else {
System.exit(0);
}

return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public Void execute() {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle(Configuration.langBundle.getString("error"));
alert.setHeaderText(Configuration.langBundle.getString("application_settings_failed"));
alert.getDialogPane().getStylesheets().add(getClass().getResource("/css/application.css").toExternalForm());
alert.showAndWait();
}
return null;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/application/configuration/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ private static String loadOneProperty(Properties properties, String propertyName
Alert alert = new Alert(
Alert.AlertType.ERROR,
"Invalid properties file. Please delete the file" + HOME_DIRECTORY + properties_file);
alert.getDialogPane().getStylesheets().add(alert.getClass().getResource("/css/application.css").toExternalForm());
alert.showAndWait();
return "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static void projectCreationFailed() {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle(Configuration.langBundle.getString("error"));
alert.setHeaderText(Configuration.langBundle.getString("project_creating_error_occured"));
alert.getDialogPane().getStylesheets().add(alert.getClass().getResource("/css/application.css").toExternalForm());
alert.showAndWait();
}

Expand All @@ -17,13 +18,15 @@ public static void projectLoadingFailed () {
alert.setTitle(Configuration.langBundle.getString("error"));
alert.setHeaderText(Configuration.langBundle.getString("project_loading_error_occured"));
alert.setContentText(Configuration.langBundle.getString("project_loading_error_reason"));
alert.getDialogPane().getStylesheets().add(alert.getClass().getResource("/css/application.css").toExternalForm());
alert.showAndWait();
}

public static void projectSavingFailed () {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle(Configuration.langBundle.getString("error"));
alert.setHeaderText(Configuration.langBundle.getString("project_saving_error_occured"));
alert.getDialogPane().getStylesheets().add(alert.getClass().getResource("/css/application.css").toExternalForm());
alert.showAndWait();
}
}
Loading

0 comments on commit d81859e

Please sign in to comment.