// only named ones
private List<Progress> getChildrenAsOrderedList(Progress pg) {
List<Progress> children = new ArrayList<Progress>();
// only named ones
private List<Progress> getChildrenAsOrderedList(Progress pg) {
List<Progress> children = new ArrayList<Progress>();
if (child.getName() != null && !child.getName().isEmpty()) {
children.add(child);
}
children.addAll(getChildrenAsOrderedList(child));
}
if (child.getName() != null && !child.getName().isEmpty()) {
children.add(child);
}
children.addAll(getChildrenAsOrderedList(child));
}
- invalidate();
- removeAll();
-
- if (pg != null) {
- setLayout(new GridLayout(bars.size(), 1));
- add(bars.get(pg), 0);
- for (Progress child : getChildrenAsOrderedList(pg)) {
- JProgressBar jbar = bars.get(child);
- if (jbar != null) {
- add(jbar);
+ synchronized (lock) {
+ invalidate();
+ removeAll();
+
+ if (pg != null) {
+ setLayout(new GridLayout(bars.size(), 1));
+ add(bars.get(pg), 0);
+ for (Progress child : getChildrenAsOrderedList(pg)) {
+ JProgressBar jbar = bars.get(child);
+ if (jbar != null) {
+ add(jbar);
+ }
for (ActionListener listener : updateListeners) {
listener.actionPerformed(new ActionEvent(this, 0, "update"));
for (ActionListener listener : updateListeners) {
listener.actionPerformed(new ActionEvent(this, 0, "update"));