+ progress.addProgressListener(new ProgressListener() {
+ public void progress(Progress pg, String name) {
+ synchronized (getLock()) {
+ double total = ((double) localProgress) / (max - min);
+ for (Entry<Progress, Double> entry : children.entrySet()) {
+ total += (entry.getValue() / (max - min))
+ * entry.getKey().getRelativeProgress();
+ }
+
+ if (name == null) {
+ name = Progress.this.name;
+ }
+
+ setTotalProgress(pg, name,
+ (int) Math.round(total * (max - min)));