org.openstreetmap.josm.gui.progress
Class NullProgressMonitor

java.lang.Object
  extended by org.openstreetmap.josm.gui.progress.NullProgressMonitor
All Implemented Interfaces:
ProgressMonitor

public class NullProgressMonitor
extends java.lang.Object
implements ProgressMonitor


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.progress.ProgressMonitor
ProgressMonitor.CancelListener
 
Field Summary
static ProgressMonitor INSTANCE
           
 
Fields inherited from interface org.openstreetmap.josm.gui.progress.ProgressMonitor
ALL_TICKS, DEFAULT_TICKS
 
Constructor Summary
private NullProgressMonitor()
           
 
Method Summary
 void addCancelListener(ProgressMonitor.CancelListener listener)
           
 void appendLogMessage(java.lang.String message)
          Appends a message to the log managed by the progress monitor.
 void beginTask(java.lang.String title)
           
 void beginTask(java.lang.String title, int ticks)
          Starts this progress monitor.
 void cancel()
           
 ProgressMonitor createSubTaskMonitor(int ticks, boolean internal)
          Creates subtasks monitor.
 void finishTask()
          Finish this progress monitor, close the dialog or inform the parent progress monitor that it can continue with other tasks.
 java.lang.String getErrorMessage()
           
 ProgressTaskId getProgressTaskId()
          Should be used only by PleaseWaitRunnable
 int getTicks()
           
 int getTicksCount()
           
 java.awt.Component getWindowParent()
           
 void indeterminateSubTask(java.lang.String title)
          Subtask that will show progress running back and forth
 void invalidate()
          Can be used if method receive ProgressMonitor but it's not interested progress monitoring.
 boolean isCanceled()
           
 void removeCancelListener(ProgressMonitor.CancelListener listener)
           
 void setCustomText(java.lang.String text)
          Shows additional text
 void setErrorMessage(java.lang.String message)
           
 void setExtraText(java.lang.String text)
          Show extra text after normal task title.
 void setProgressTaskId(ProgressTaskId taskId)
          Should be used only by PleaseWaitRunnable.
 void setSilent(boolean value)
           
 void setTicks(int ticks)
           
 void setTicksCount(int ticks)
           
 void subTask(java.lang.String title)
          Normal subtask
 void worked(int ticks)
          Increase number of already done work units by ticks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final ProgressMonitor INSTANCE
Constructor Detail

NullProgressMonitor

private NullProgressMonitor()
Method Detail

addCancelListener

public void addCancelListener(ProgressMonitor.CancelListener listener)
Specified by:
addCancelListener in interface ProgressMonitor

beginTask

public void beginTask(java.lang.String title)
Specified by:
beginTask in interface ProgressMonitor

beginTask

public void beginTask(java.lang.String title,
                      int ticks)
Description copied from interface: ProgressMonitor
Starts this progress monitor. Must be called exactly once

Specified by:
beginTask in interface ProgressMonitor

cancel

public void cancel()
Specified by:
cancel in interface ProgressMonitor

createSubTaskMonitor

public ProgressMonitor createSubTaskMonitor(int ticks,
                                            boolean internal)
Description copied from interface: ProgressMonitor
Creates subtasks monitor.

Specified by:
createSubTaskMonitor in interface ProgressMonitor
Parameters:
ticks - Number of work units that should be done when subtask finishes
internal - If true then subtask can't modify task title/custom text
Returns:

finishTask

public void finishTask()
Description copied from interface: ProgressMonitor
Finish this progress monitor, close the dialog or inform the parent progress monitor that it can continue with other tasks. Must be called at least once (if called multiply times then further calls are ignored)

Specified by:
finishTask in interface ProgressMonitor

getErrorMessage

public java.lang.String getErrorMessage()

getTicks

public int getTicks()
Specified by:
getTicks in interface ProgressMonitor

indeterminateSubTask

public void indeterminateSubTask(java.lang.String title)
Description copied from interface: ProgressMonitor
Subtask that will show progress running back and forth

Specified by:
indeterminateSubTask in interface ProgressMonitor
Parameters:
title - Can be null, in that case task title is not changed

invalidate

public void invalidate()
Description copied from interface: ProgressMonitor
Can be used if method receive ProgressMonitor but it's not interested progress monitoring. Basically replaces ProgressMonitor.beginTask(String) and ProgressMonitor.finishTask() This method can be also used in finally section if method expects that some exception might prevent it from passing progressMonitor away. If ProgressMonitor.beginTask(String) was already called then this method does nothing.

Specified by:
invalidate in interface ProgressMonitor

isCanceled

public boolean isCanceled()
Specified by:
isCanceled in interface ProgressMonitor

removeCancelListener

public void removeCancelListener(ProgressMonitor.CancelListener listener)
Specified by:
removeCancelListener in interface ProgressMonitor

setCustomText

public void setCustomText(java.lang.String text)
Description copied from interface: ProgressMonitor
Shows additional text

Specified by:
setCustomText in interface ProgressMonitor

setErrorMessage

public void setErrorMessage(java.lang.String message)

setExtraText

public void setExtraText(java.lang.String text)
Description copied from interface: ProgressMonitor
Show extra text after normal task title. Hack for ProgressInputStream to show number of kB already downloaded

Specified by:
setExtraText in interface ProgressMonitor

appendLogMessage

public void appendLogMessage(java.lang.String message)
Description copied from interface: ProgressMonitor
Appends a message to the log managed by the progress monitor.

Specified by:
appendLogMessage in interface ProgressMonitor
Parameters:
message - the log message. Ignored if null or white space only.

setSilent

public void setSilent(boolean value)

setTicks

public void setTicks(int ticks)
Specified by:
setTicks in interface ProgressMonitor
Parameters:
ticks - Number of work units already done

setTicksCount

public void setTicksCount(int ticks)
Specified by:
setTicksCount in interface ProgressMonitor
Parameters:
ticks - Number of total work units

subTask

public void subTask(java.lang.String title)
Description copied from interface: ProgressMonitor
Normal subtask

Specified by:
subTask in interface ProgressMonitor
Parameters:
title - Can be null, in that case task title is not changed

worked

public void worked(int ticks)
Description copied from interface: ProgressMonitor
Increase number of already done work units by ticks

Specified by:
worked in interface ProgressMonitor

getTicksCount

public int getTicksCount()
Specified by:
getTicksCount in interface ProgressMonitor

setProgressTaskId

public void setProgressTaskId(ProgressTaskId taskId)
Description copied from interface: ProgressMonitor
Should be used only by PleaseWaitRunnable. If taskId <> null then "In background" button will be shown

Specified by:
setProgressTaskId in interface ProgressMonitor

getProgressTaskId

public ProgressTaskId getProgressTaskId()
Description copied from interface: ProgressMonitor
Should be used only by PleaseWaitRunnable

Specified by:
getProgressTaskId in interface ProgressMonitor

getWindowParent

public java.awt.Component getWindowParent()
Specified by:
getWindowParent in interface ProgressMonitor
Returns:
component suitable as parent for dialogs that wants to be shown in front of progress dialog


JOSM