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

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