@@ -76,6 +76,7 @@ public class AppWish extends Application {
7676 private String javaExecutablePath ;
7777 private Process executingJavaAppProcess ;
7878 private boolean isCodeGenerationOnGoing = false ;
79+ private boolean isSuperAppGeneration = false ;
7980
8081 public static void main (String [] args ) {
8182 launch (args );
@@ -114,9 +115,8 @@ private void loadSplashScreen(Stage primaryStage) throws IOException {
114115
115116 @ Override
116117 public void start (Stage primaryStage ) throws IOException {
117- System .setProperty (SimpleLogger .DEFAULT_LOG_LEVEL_KEY , "DEBUG" );
118- // App Screen
119- //loadDefaultScreen(primaryStage);
118+ System .setProperty (SimpleLogger .DEFAULT_LOG_LEVEL_KEY , "INFO" );
119+
120120
121121 // Splash Screen
122122 loadSplashScreen (primaryStage );
@@ -129,6 +129,7 @@ public void start(Stage primaryStage) throws IOException {
129129 */
130130 private void onAppWish (CodeEvent codeEvent ) {
131131 isCodeGenerationOnGoing = true ;
132+ output_label .setStyle ("-fx-background-color: #00277c; -fx-text-fill: white;" );
132133 // The File Object will be null if it's a new app request or have
133134 // a value if it is a continuous build from an existing app
134135 File file ;
@@ -151,6 +152,7 @@ private void onAppWish(CodeEvent codeEvent) {
151152 file = null ;
152153 }
153154
155+ isSuperAppGeneration = false ;
154156
155157 ThreadPoolMaster .getInstance ().getExecutor ().execute (() -> {
156158 startGuiThread (codeEvent );
@@ -176,10 +178,11 @@ private void onAppWish(CodeEvent codeEvent) {
176178 private void onRunJavaApp (ActionEvent ae ) {
177179 btn_run_application .setVisible (false );
178180 btn_StopGeneratedApp .setVisible (true );
181+ output_label .setVisible (false );
179182
180183 if (javaExecutablePath != null ) {
181184
182- if (!output_label . isVisible () ) {
185+ if (!isCodeGenerationOnGoing ) {
183186 log .info ("Executing java app on path -> {}" , javaExecutablePath );
184187 }
185188 try {
@@ -196,8 +199,7 @@ private final ProcessBuilder GetProcessBuilderForRunningGeneratedJavaApplication
196199
197200 final String classPath = javaExecutablePath .replace (MAIN_DOT_JAVA , NOTHING_STRING );
198201
199- if (output_label .isVisible ()) {
200- // Super App Creation
202+ if (isSuperAppGeneration ) {
201203
202204 // Security
203205 if (classPath .concat (MAIN_DOT_JAVA ).equals (javaExecutablePath )) {
@@ -342,17 +344,22 @@ private void handleCompilationResult(boolean isSuperGeneration) {
342344 Platform .runLater (() -> {
343345 if (DataStorage .getInstance ().getJavaExecutionPath () != null || isSuperGeneration ) {
344346 if (!isSuperGeneration ) {
345- output_label . setVisible ( false );
347+
346348 btn_run_application .setVisible (true );
349+ output_label .setText (SUCCESS_ON_SUPER_APP_CREATION_TEXT );
350+ output_label .setStyle ("-fx-background-color: green; -fx-text-fill: white;" );
347351 }
348352 btn_run_application .setVisible (true );
349353 setButtonGroupVisibilityForCodeGenerationButtons (true );
350354 isCodeGenerationOnGoing = false ;
351355 if (isSuperGeneration ) {
352356 output_label .setText (SUCCESS_ON_SUPER_APP_CREATION_TEXT );
357+ output_label .setStyle ("-fx-background-color: green; -fx-text-fill: white;" );
358+
353359 }
354360 } else {
355- output_label .setText ("Something went wrong :(" );
361+ output_label .setText ("Failed! Try again or write an issue report." );
362+ output_label .setStyle ("-fx-background-color: red; -fx-text-fill: white;" );
356363 }
357364 });
358365
@@ -408,6 +415,8 @@ private List<String> readTextByLinesFromFile(File file) {
408415 public void OnSuperAppCreationButton (ActionEvent ae ) {
409416
410417 isCodeGenerationOnGoing = true ;
418+ isSuperAppGeneration = true ;
419+ output_label .setStyle ("-fx-background-color: #00277c; -fx-text-fill: white;" );
411420 DataStorage .getInstance ().setCompilationJob (new CompilationJob (GUIConstants .DEFAULT_STAGE_TITLE ));
412421 ThreadPoolMaster .getInstance ().getExecutor ().execute (() -> {
413422 StartGuiThreadForSuperAppCreation ();
0 commit comments