29
29
import programminglife .gui .Alerts ;
30
30
import programminglife .gui .NumbersOnlyListener ;
31
31
import programminglife .gui .ResizableCanvas ;
32
- import programminglife .model .Feature ;
33
32
import programminglife .model .GenomeGraph ;
34
33
import programminglife .model .drawing .DrawableEdge ;
35
34
import programminglife .model .drawing .DrawableNode ;
36
35
import programminglife .model .drawing .DrawableSegment ;
37
- import programminglife .parser .AnnotationParser ;
38
36
import programminglife .parser .GraphParser ;
39
37
import programminglife .parser .ProgressCounter ;
40
38
import programminglife .utility .Console ;
45
43
import java .io .File ;
46
44
import java .io .IOException ;
47
45
import java .nio .charset .Charset ;
48
- import java .util .Map ;
49
46
import java .util .Observable ;
50
47
import java .util .Observer ;
51
48
import java .util .Random ;
@@ -61,13 +58,11 @@ public class GuiController implements Observer {
61
58
62
59
//FXML imports.
63
60
@ FXML private MenuItem btnOpenGFA ;
64
- @ FXML private MenuItem btnOpenGFF ;
65
61
@ FXML private MenuItem btnQuit ;
66
62
@ FXML private MenuItem btnBookmarks ;
67
63
@ FXML private MenuItem btnAbout ;
68
64
@ FXML private MenuItem btnInstructions ;
69
65
@ FXML private Menu menuRecentGFA ;
70
- @ FXML private Menu menuRecentGFF ;
71
66
72
67
@ FXML private RadioMenuItem btnSNP ;
73
68
@ FXML private RadioMenuItem btnConsole ;
@@ -97,12 +92,9 @@ public class GuiController implements Observer {
97
92
private double scale ;
98
93
private GraphController graphController ;
99
94
private RecentFileController recentFileControllerGFA ;
100
- private RecentFileController recentFileControllerGFF ;
101
95
private MiniMapController miniMapController ;
102
96
private File file ;
103
- private final File recentFileGFA = new File ("RecentGFA.txt" );
104
- private final File recentFileGFF = new File ("RecentGFF.txt" );
105
- private Map <String , Feature > features ;
97
+ private File recentFileGFA = new File ("RecentGFA.txt" );
106
98
private Thread parseThread ;
107
99
108
100
private final ExtensionFilter extFilterGFF = new ExtensionFilter ("GFF files (*.gff)" , "*.GFF" );
@@ -124,8 +116,6 @@ private void initialize() {
124
116
125
117
this .recentFileControllerGFA = new RecentFileController (this .recentFileGFA , this .menuRecentGFA );
126
118
this .recentFileControllerGFA .setGuiController (this );
127
- this .recentFileControllerGFF = new RecentFileController (this .recentFileGFF , this .menuRecentGFF );
128
- this .recentFileControllerGFF .setGuiController (this );
129
119
initMenuBar ();
130
120
initBookmarkMenu ();
131
121
initLeftControlpanelScreenModifiers ();
@@ -168,29 +158,6 @@ public GraphParser openFile(File file) {
168
158
return null ;
169
159
}
170
160
171
- /**
172
- * Open and parse a GFF file.
173
- *
174
- * @param file The {@link File} to open.
175
- * @return AnnotationParser to be notified when finished.
176
- */
177
- private AnnotationParser openAnnotationFile (File file ) {
178
- AnnotationParser annotationParser = null ;
179
- if (file != null ) {
180
- Console .println ("Opening annotation " + file );
181
- annotationParser = new AnnotationParser (file );
182
- annotationParser .addObserver (this );
183
- annotationParser .getProgressCounter ().addObserver (this );
184
-
185
- if (this .parseThread != null ) {
186
- this .parseThread .interrupt ();
187
- }
188
- this .parseThread = new Thread (annotationParser );
189
- this .parseThread .start ();
190
- }
191
- return annotationParser ;
192
- }
193
-
194
161
@ Override
195
162
public void update (Observable o , Object arg ) {
196
163
if (o instanceof GraphParser ) {
@@ -208,11 +175,6 @@ public void update(Observable o, Object arg) {
208
175
String msg = (String ) arg ;
209
176
Platform .runLater (() -> ProgrammingLife .getStage ().setTitle (msg ));
210
177
}
211
- } else if (o instanceof AnnotationParser ) {
212
- if (arg instanceof Map ) {
213
- Console .println ("[%s] Annotations parsed." , Thread .currentThread ().getName ());
214
- this .setFeatures (((AnnotationParser ) o ).getFeatures ());
215
- }
216
178
} else if (o instanceof ProgressCounter ) {
217
179
progressBar .setVisible (true );
218
180
ProgressCounter progress = (ProgressCounter ) o ;
@@ -268,12 +230,6 @@ private void fileChooser(ExtensionFilter filter, boolean isGFA) {
268
230
File recentFileGFA = recentFileControllerGFA .getRecentFile ();
269
231
recentFileControllerGFA .updateRecent (recentFileGFA , file );
270
232
});
271
- } else {
272
- this .openAnnotationFile (file );
273
- Platform .runLater (() -> {
274
- File recentFileGFF = recentFileControllerGFA .getRecentFile ();
275
- recentFileControllerGFF .updateRecent (recentFileGFF , file );
276
- });
277
233
}
278
234
}
279
235
}
@@ -286,8 +242,6 @@ private void fileChooser(ExtensionFilter filter, boolean isGFA) {
286
242
private void initMenuBar () {
287
243
btnOpenGFA .setOnAction ((ActionEvent event ) -> fileChooser (extFilterGFA , true ));
288
244
btnOpenGFA .setAccelerator (new KeyCodeCombination (KeyCode .O , KeyCodeCombination .CONTROL_DOWN ));
289
- btnOpenGFF .setOnAction ((ActionEvent event ) -> fileChooser (extFilterGFF , false ));
290
- btnOpenGFF .setAccelerator (new KeyCodeCombination (KeyCode .P , KeyCodeCombination .CONTROL_DOWN ));
291
245
292
246
btnQuit .setOnAction (event -> Alerts .quitAlert ());
293
247
btnQuit .setAccelerator (new KeyCodeCombination (KeyCode .Q , KeyCodeCombination .CONTROL_DOWN ));
@@ -584,7 +538,6 @@ private void initRightSearchTab() {
584
538
searchTab .setDisable (true );
585
539
searchTab .setOnSelectionChanged (event -> {
586
540
highlightController .initGenome ();
587
- highlightController .initAnnotations ();
588
541
highlightController .initMinMax ();
589
542
});
590
543
} catch (IOException e ) {
@@ -790,14 +743,6 @@ public void setFile(File file) {
790
743
this .file = file ;
791
744
}
792
745
793
- private void setFeatures (Map <String , Feature > features ) {
794
- this .features = features ;
795
- }
796
-
797
- Map <String , Feature > getFeatures () {
798
- return this .features ;
799
- }
800
-
801
746
GraphController getGraphController () {
802
747
return this .graphController ;
803
748
}
0 commit comments