source: josm/trunk/src/org/openstreetmap/josm/gui/progress/ChildProgress.java@ 4932

Last change on this file since 4932 was 4762, checked in by jttt, 12 years ago

Add method getWindowParent to ProgressMonitor (see #7208)

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/plain
File size: 1.7 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.progress;
3
4import java.awt.Component;
5
6public class ChildProgress extends AbstractProgressMonitor {
7
8 private final AbstractProgressMonitor parent;
9 private final boolean internal;
10
11 public ChildProgress(AbstractProgressMonitor parent, CancelHandler cancelHandler, boolean internal) {
12 super(cancelHandler);
13 this.parent = parent;
14 this.internal = internal;
15 }
16
17 public final AbstractProgressMonitor getParent() {
18 return parent;
19 }
20
21 public final boolean isInternal() {
22 return internal;
23 }
24
25 @Override
26 void updateProgress(double value) {
27 parent.childSetProgress(this, value);
28 }
29
30 @Override
31 protected void doBeginTask() {
32 }
33
34 @Override
35 protected void doSetCustomText(String title) {
36 if (!internal) {
37 parent.childSetCustomText(this, title);
38 }
39 }
40
41 @Override
42 protected void doSetTitle(String title) {
43 if (!internal) {
44 parent.childSetTitle(this, title);
45 }
46 }
47
48 @Override
49 protected void doSetIntermediate(boolean value) {
50 if (!internal) {
51 parent.childSetIntermediate(this, value);
52 }
53 }
54
55 @Override
56 protected void doFinishTask() {
57 parent.childFinished(this);
58 }
59
60 @Override
61 public void setProgressTaskId(ProgressTaskId taskId) {
62 parent.setProgressTaskId(taskId);
63 }
64
65 @Override
66 public ProgressTaskId getProgressTaskId() {
67 return parent.getProgressTaskId();
68 }
69
70 @Override
71 public Component getWindowParent() {
72 return parent.getWindowParent();
73 }
74}
Note: See TracBrowser for help on using the repository browser.