source: josm/trunk/src/org/openstreetmap/josm/gui/progress/NullProgressMonitor.java@ 13840

Last change on this file since 13840 was 12620, checked in by Don-vip, 7 years ago

see #15182 - deprecate all Main logging methods and introduce suitable replacements in Logging for most of them

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.progress;
3
4import java.awt.Component;
5
6import org.openstreetmap.josm.Main;
7import org.openstreetmap.josm.tools.Logging;
8
9/**
10 * A singleton progress monitor that does nothing.
11 * @since 1811
12 */
13public final class NullProgressMonitor implements ProgressMonitor {
14
15 /** The unique instance */
16 public static final ProgressMonitor INSTANCE = new NullProgressMonitor();
17
18 private NullProgressMonitor() {
19 // Do nothing
20 }
21
22 @Override
23 public void addCancelListener(CancelListener listener) {
24 // Do nothing
25 }
26
27 @Override
28 public void beginTask(String title) {
29 Logging.debug(title);
30 }
31
32 @Override
33 public void beginTask(String title, int ticks) {
34 Logging.debug(title);
35 }
36
37 @Override
38 public void cancel() {
39 // Do nothing
40 }
41
42 @Override
43 public ProgressMonitor createSubTaskMonitor(int ticks, boolean internal) {
44 return INSTANCE;
45 }
46
47 @Override
48 public void finishTask() {
49 // Do nothing
50 }
51
52 @Override
53 public int getTicks() {
54 return 0;
55 }
56
57 @Override
58 public void indeterminateSubTask(String title) {
59 Logging.debug(title);
60 }
61
62 @Override
63 public void invalidate() {
64 // Do nothing
65 }
66
67 @Override
68 public boolean isCanceled() {
69 return false;
70 }
71
72 @Override
73 public void removeCancelListener(CancelListener listener) {
74 // Do nothing
75 }
76
77 @Override
78 public void setCustomText(String text) {
79 // Do nothing
80 }
81
82 @Override
83 public void setExtraText(String text) {
84 // Do nothing
85 }
86
87 @Override
88 public void appendLogMessage(String message) {
89 // Do nothing
90 }
91
92 @Override
93 public void setTicks(int ticks) {
94 // Do nothing
95 }
96
97 @Override
98 public void setTicksCount(int ticks) {
99 // Do nothing
100 }
101
102 @Override
103 public void subTask(String title) {
104 Logging.debug(title);
105 }
106
107 @Override
108 public void worked(int ticks) {
109 // Do nothing
110 }
111
112 @Override
113 public int getTicksCount() {
114 return 0;
115 }
116
117 @Override
118 public void setProgressTaskId(ProgressTaskId taskId) {
119 // Do nothing
120 }
121
122 @Override
123 public ProgressTaskId getProgressTaskId() {
124 return null;
125 }
126
127 @Override
128 public Component getWindowParent() {
129 return Main.parent;
130 }
131}
Note: See TracBrowser for help on using the repository browser.