Class BackgroundTaskStatusProviderSupportingExternalCallImpl
java.lang.Object
de.ipk_gatersleben.ag_nw.graffiti.services.task.BackgroundTaskStatusProviderSupportingExternalCallImpl
- All Implemented Interfaces:
BackgroundTaskStatusProvider,BackgroundTaskStatusProviderSupportingExternalCall
- Direct Known Subclasses:
BackgroundTaskConsoleLogger
public class BackgroundTaskStatusProviderSupportingExternalCallImpl extends Object implements BackgroundTaskStatusProviderSupportingExternalCall
-
Constructor Summary
Constructors Constructor Description BackgroundTaskStatusProviderSupportingExternalCallImpl(String status1, String status2) -
Method Summary
Modifier and Type Method Description StringgetCurrentStatusMessage1()Returns a status message on what is going on.StringgetCurrentStatusMessage2()Returns a status message on what is going on.intgetCurrentStatusValue()Returns the completion status.doublegetCurrentStatusValueFine()Same asgetCurrentStatusValue(), but this method should return a finer granted progress value.voidpleaseContinueRun()This method is called as soon as the user indicates that he is comfortable to let the algorithm continue its work.voidpleaseStop()If this method is called on the status provider, the linked work task should stop its execution as soon as possible.booleanpluginWaitsForUser()voidsetCurrentStatusText1(String status)voidsetCurrentStatusText2(String status)voidsetCurrentStatusValue(int value)Override this method and pass a implementor of this interface to any other service method.voidsetCurrentStatusValueFine(double value)voidsetCurrentStatusValueFineAdd(double smallProgressStep)voidsetPluginWaitsForUser(boolean wait)booleanwantsToStop()
-
Constructor Details
-
BackgroundTaskStatusProviderSupportingExternalCallImpl
-
-
Method Details
-
setCurrentStatusValueFine
public void setCurrentStatusValueFine(double value)- Specified by:
setCurrentStatusValueFinein interfaceBackgroundTaskStatusProviderSupportingExternalCall
-
wantsToStop
public boolean wantsToStop()- Specified by:
wantsToStopin interfaceBackgroundTaskStatusProviderSupportingExternalCall
-
setCurrentStatusText1
- Specified by:
setCurrentStatusText1in interfaceBackgroundTaskStatusProviderSupportingExternalCall
-
setCurrentStatusText2
- Specified by:
setCurrentStatusText2in interfaceBackgroundTaskStatusProviderSupportingExternalCall
-
getCurrentStatusValue
public int getCurrentStatusValue()Description copied from interface:BackgroundTaskStatusProviderReturns the completion status. WARNING: This method must be Thread-Safe!- Specified by:
getCurrentStatusValuein interfaceBackgroundTaskStatusProvider- Returns:
- A number from 0..100 which represents the completion status. If -1 is returned, the progress bar is set to "indeterminate", which means, that the progress bar will float from left to right and reverse. (Useful if status can not be determined) Other values let the progressbar disappear.
-
setCurrentStatusValue
public void setCurrentStatusValue(int value)Description copied from interface:BackgroundTaskStatusProviderOverride this method and pass a implementor of this interface to any other service method. This method can use this call to update the status value.- Specified by:
setCurrentStatusValuein interfaceBackgroundTaskStatusProvider
-
getCurrentStatusValueFine
public double getCurrentStatusValueFine()Description copied from interface:BackgroundTaskStatusProviderSame asgetCurrentStatusValue(), but this method should return a finer granted progress value. If this is not needed, the code forgetCurrentStatusValue()could be reused by the client.- Specified by:
getCurrentStatusValueFinein interfaceBackgroundTaskStatusProvider- Returns:
- The current progress value (fine).
-
getCurrentStatusMessage1
Description copied from interface:BackgroundTaskStatusProviderReturns a status message on what is going on. WARNING: This method must be Thread-Safe!- Specified by:
getCurrentStatusMessage1in interfaceBackgroundTaskStatusProvider- Returns:
- A status message, or null if not needed.
-
getCurrentStatusMessage2
Description copied from interface:BackgroundTaskStatusProviderReturns a status message on what is going on. Is used the same likegetCurrentStatusMessage1. This second message adds flexibility. If not needed, the first message should be used and this should return null if not needed. WARNING: This method must be Thread-Safe!- Specified by:
getCurrentStatusMessage2in interfaceBackgroundTaskStatusProvider- Returns:
- A status message, or null if not needed.
-
pleaseStop
public void pleaseStop()Description copied from interface:BackgroundTaskStatusProviderIf this method is called on the status provider, the linked work task should stop its execution as soon as possible.- Specified by:
pleaseStopin interfaceBackgroundTaskStatusProvider
-
pluginWaitsForUser
public boolean pluginWaitsForUser()- Specified by:
pluginWaitsForUserin interfaceBackgroundTaskStatusProvider- Returns:
- Let this method return true in order to show a "Continue" button in
the GUI. When this buttons is clicked, the method
pleaseContinueRunis called. Use these two methods to let the user interact with the GUI while the algorithm is waiting for the user to be ready for the continued work of the algorithm.
-
pleaseContinueRun
public void pleaseContinueRun()Description copied from interface:BackgroundTaskStatusProviderThis method is called as soon as the user indicates that he is comfortable to let the algorithm continue its work.- Specified by:
pleaseContinueRunin interfaceBackgroundTaskStatusProvider
-
setPluginWaitsForUser
public void setPluginWaitsForUser(boolean wait) -
setCurrentStatusValueFineAdd
public void setCurrentStatusValueFineAdd(double smallProgressStep)- Specified by:
setCurrentStatusValueFineAddin interfaceBackgroundTaskStatusProviderSupportingExternalCall
-