@@ -61,14 +61,15 @@ public class Main extends Application {
61
61
@ Inject private HttpPipelineSwitcher pipelineSwitcher ;
62
62
private Parent root ;
63
63
private boolean headless ;
64
+ private List <String > parameters ;
64
65
65
66
public static void main (String [] args ) {
66
67
launch (args );
67
68
}
68
69
69
70
@ Override
70
71
public void init () throws IOException {
71
- List < String > parameters = new ArrayList <>(getParameters ().getRaw ());
72
+ parameters = new ArrayList <>(getParameters ().getRaw ());
72
73
73
74
if (parameters .contains ("--headless" )) {
74
75
// If --headless was specified on the command line, run in headless mode (only use the core
@@ -99,16 +100,6 @@ public void init() throws IOException {
99
100
server .start ();
100
101
notifyPreloader (new Preloader .ProgressNotification (0.6 ));
101
102
102
- // If there was a file specified on the command line, open it immediately
103
- if (!parameters .isEmpty ()) {
104
- try {
105
- project .open (new File (parameters .get (0 )));
106
- } catch (IOException e ) {
107
- logger .log (Level .SEVERE , "Error loading file: " + parameters .get (0 ));
108
- throw e ;
109
- }
110
- }
111
-
112
103
pipelineRunner .startAsync ();
113
104
notifyPreloader (new Preloader .ProgressNotification (0.75 ));
114
105
}
@@ -124,6 +115,16 @@ public void start(Stage stage) throws IOException {
124
115
cvOperations .addOperations ();
125
116
notifyPreloader (new Preloader .ProgressNotification (0.9 ));
126
117
118
+ // If there was a file specified on the command line, open it immediately
119
+ if (!parameters .isEmpty ()) {
120
+ try {
121
+ project .open (new File (parameters .get (0 )));
122
+ } catch (IOException e ) {
123
+ logger .log (Level .SEVERE , "Error loading file: " + parameters .get (0 ));
124
+ throw e ;
125
+ }
126
+ }
127
+
127
128
project .addIsSaveDirtyConsumer (newValue -> {
128
129
if (newValue ) {
129
130
Platform .runLater (() -> stage .setTitle (MAIN_TITLE + " | Edited" ));
0 commit comments