File tree 4 files changed +30
-6
lines changed
app/src/main/java/ca/phon/app
session/src/main/java/ca/phon/session/io/xml/v12
4 files changed +30
-6
lines changed Original file line number Diff line number Diff line change 32
32
import ca .phon .ui .action .*;
33
33
import ca .phon .util .*;
34
34
import ca .phon .util .icons .*;
35
+ import ca .phon .worker .PhonWorker ;
35
36
36
37
public class RecentProjectsList extends JPanel {
37
38
@@ -82,13 +83,18 @@ public void mouseClicked(MouseEvent me) {
82
83
public void updateProjectList () {
83
84
buttonPanel .removeAll ();
84
85
buttonPanel .revalidate ();
86
+
87
+ PhonWorker worker = PhonWorker .createWorker ();
88
+ worker .setFinishWhenQueueEmpty (true );
85
89
86
90
final RecentProjects history = new RecentProjects ();
87
91
88
92
boolean stripeRow = false ;
89
93
for (File projectFolder :history ) {
90
94
final LocalProjectButton projectButton = getProjectButton (projectFolder );
91
-
95
+
96
+ projectButton .updateProjectSize (worker );
97
+
92
98
if (stripeRow ) {
93
99
projectButton .setBackground (PhonGuiConstants .PHON_UI_STRIP_COLOR );
94
100
stripeRow = false ;
@@ -99,6 +105,7 @@ public void updateProjectList() {
99
105
100
106
buttonPanel .add (projectButton );
101
107
}
108
+ worker .start ();
102
109
}
103
110
104
111
private LocalProjectButton getProjectButton (File projectFolder ) {
Original file line number Diff line number Diff line change @@ -143,10 +143,17 @@ private void updateProjectList() {
143
143
listPanel .removeAll ();
144
144
listPanel .revalidate ();
145
145
listPanel .repaint ();
146
+
147
+ PhonWorker worker = PhonWorker .createWorker ();
148
+ worker .setFinishWhenQueueEmpty (true );
146
149
147
150
boolean stripRow = false ;
148
151
for (MultiActionButton btn :projectButtons ) {
149
152
listPanel .add (btn );
153
+
154
+ if (btn instanceof LocalProjectButton ) {
155
+ ((LocalProjectButton ) btn ).updateProjectSize (worker );
156
+ }
150
157
151
158
if (stripRow ) {
152
159
btn .setBackground (PhonGuiConstants .PHON_UI_STRIP_COLOR );
@@ -156,7 +163,8 @@ private void updateProjectList() {
156
163
stripRow = true ;
157
164
}
158
165
}
159
-
166
+
167
+ worker .start ();
160
168
revalidate ();
161
169
listPanel .revalidate ();
162
170
listPanel .repaint ();
Original file line number Diff line number Diff line change @@ -57,8 +57,10 @@ public LocalProjectButton(File projFile) {
57
57
setBackgroundPainter (bgPainter );
58
58
59
59
setCursor (Cursor .getPredefinedCursor (Cursor .HAND_CURSOR ));
60
+ }
60
61
61
- PhonWorker .getInstance ().invokeLater (new ProjectSizeCalcTask ());
62
+ public void updateProjectSize (PhonWorker worker ) {
63
+ worker .invokeLater (new ProjectSizeCalcTask ());
62
64
}
63
65
64
66
/**
@@ -158,8 +160,11 @@ private long getSize(File f) {
158
160
// return size of file
159
161
retVal = f .length ();
160
162
} else if (f .isDirectory ()) {
161
- for (File lf :f .listFiles ()) {
162
- retVal += getSize (lf );
163
+ File [] files = f .listFiles ();
164
+ if (files != null ) {
165
+ for (File lf : files ) {
166
+ retVal += getSize (lf );
167
+ }
163
168
}
164
169
}
165
170
return retVal ;
Original file line number Diff line number Diff line change @@ -643,9 +643,13 @@ public void visitCompoundPhone(CompoundPhone cp) {
643
643
(eleIdx < syllabification .size () ? syllabification .get (eleIdx ++) : null );
644
644
if (ct != null ) {
645
645
final ConstituentTypeType ctt = ct .getScType ();
646
+ final SyllabificationInfo info = cp .getExtension (SyllabificationInfo .class );
646
647
final SyllableConstituentType scType = SyllableConstituentType .fromString (ctt .toString ());
647
648
if (scType != null ) {
648
- cp .setScType (scType );
649
+ info .setConstituentType (scType );
650
+ if (scType == SyllableConstituentType .NUCLEUS ) {
651
+ info .setDiphthongMember (!ct .isHiatus ());
652
+ }
649
653
}
650
654
}
651
655
}
You can’t perform that action at this time.
0 commit comments