Changeset 8524 in josm
- Timestamp:
- 2015-06-22T23:49:54+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/SplashScreen.java
r8520 r8524 13 13 import java.awt.event.MouseAdapter; 14 14 import java.awt.event.MouseEvent; 15 import java.util.ArrayList;16 import java.util.Collections;17 15 import java.util.List; 18 16 import java.util.Objects; 17 import java.util.concurrent.CopyOnWriteArrayList; 19 18 20 19 import javax.swing.BorderFactory; … … 123 122 @Override 124 123 public void stateChanged(ChangeEvent ignore) { 125 /*GuiHelper.runInEDT(new Runnable() {124 GuiHelper.runInEDT(new Runnable() { 126 125 @Override 127 126 public void run() { 128 127 progressRenderer.setTasks(progressMonitor.toString()); 129 128 } 130 }); */129 }); 131 130 } 132 131 … … 194 193 private final String name; 195 194 private final ChangeListener listener; 196 private final List<Task> tasks = Collections.synchronizedList(new ArrayList<Task>());195 private final List<Task> tasks = new CopyOnWriteArrayList<>(); 197 196 private SplashProgressMonitor latestSubtask; 198 197 … … 204 203 @Override 205 204 public StringBuilder toHtml(StringBuilder sb) { 206 synchronized (tasks) { 207 sb.append(Utils.firstNonNull(name, "")); 208 if (!tasks.isEmpty()) { 209 sb.append("<ul>"); 210 for (Task i : tasks) { 211 sb.append("<li>"); 212 i.toHtml(sb); 213 sb.append("</li>"); 214 } 215 sb.append("</ul>"); 205 sb.append(Utils.firstNonNull(name, "")); 206 if (!tasks.isEmpty()) { 207 sb.append("<ul>"); 208 for (Task i : tasks) { 209 sb.append("<li>"); 210 i.toHtml(sb); 211 sb.append("</li>"); 216 212 } 217 return sb; 218 } 213 sb.append("</ul>"); 214 } 215 return sb; 219 216 } 220 217 … … 388 385 } 389 386 387 /** 388 * Sets the tasks to displayed. A HTML formatted list is expected. 389 */ 390 390 public void setTasks(String tasks) { 391 synchronized (lblTaskTitle) { 392 lblTaskTitle.setText(LABEL_HTML + tasks); 393 lblTaskTitle.setCaretPosition(lblTaskTitle.getDocument().getLength()); 394 } 391 lblTaskTitle.setText(LABEL_HTML + tasks); 392 lblTaskTitle.setCaretPosition(lblTaskTitle.getDocument().getLength()); 395 393 repaint(); 396 394 }
Note:
See TracChangeset
for help on using the changeset viewer.