Package jadex.commons.gui.future
Class SwingIntermediateDefaultResultListener<E>
- java.lang.Object
-
- jadex.commons.future.DefaultResultListener<E>
-
- jadex.commons.gui.future.SwingDefaultResultListener<java.util.Collection<E>>
-
- jadex.commons.gui.future.SwingIntermediateDefaultResultListener<E>
-
- All Implemented Interfaces:
IFunctionalExceptionListener
,IFunctionalIntermediateFinishedListener<E>
,IFunctionalIntermediateResultCountListener
,IFunctionalIntermediateResultListener<E>
,IFunctionalResultListener<java.util.Collection<E>>
,IFutureCommandResultListener<java.util.Collection<E>>
,IIntermediateResultListener<E>
,IResultListener<java.util.Collection<E>>
public abstract class SwingIntermediateDefaultResultListener<E> extends SwingDefaultResultListener<java.util.Collection<E>> implements IIntermediateResultListener<E>
Default implementation of intermediate result listener with methods called on swing thread.
-
-
Field Summary
-
Fields inherited from class jadex.commons.gui.future.SwingDefaultResultListener
customExceptionListener, customResultListener, parent
-
-
Constructor Summary
Constructors Constructor Description SwingIntermediateDefaultResultListener()
Create a new listener.SwingIntermediateDefaultResultListener(java.awt.Component parent)
Create a new listener.SwingIntermediateDefaultResultListener(java.util.logging.Logger logger)
Create a new listener.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
customFinished()
Declare that the future is finished.abstract void
customIntermediateResultAvailable(E result)
Called when an intermediate result is available.void
customMaxResultCountAvailable(int max)
void
customResultAvailable(java.util.Collection<E> result)
Overwritten to call intermediate and finished methods.void
finished()
Call customFinished() on swing thread.void
intermediateResultAvailable(E result)
Call customIntermediateResultAvailable() on swing thread.void
maxResultCountAvailable(int max)
Declare that the future result count is available.-
Methods inherited from class jadex.commons.gui.future.SwingDefaultResultListener
commandAvailable, customCommandAvailable, customExceptionOccurred, exceptionOccurred, resultAvailable, unblock
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jadex.commons.future.IFunctionalExceptionListener
exceptionOccurred
-
Methods inherited from interface jadex.commons.future.IFunctionalResultListener
resultAvailable
-
-
-
-
Constructor Detail
-
SwingIntermediateDefaultResultListener
public SwingIntermediateDefaultResultListener()
Create a new listener.
-
SwingIntermediateDefaultResultListener
public SwingIntermediateDefaultResultListener(java.awt.Component parent)
Create a new listener.- Parameters:
parent
- The parent component (when errors should be shown as dialog).
-
SwingIntermediateDefaultResultListener
public SwingIntermediateDefaultResultListener(java.util.logging.Logger logger)
Create a new listener.- Parameters:
logger
- The logger.
-
-
Method Detail
-
customIntermediateResultAvailable
public abstract void customIntermediateResultAvailable(E result)
Called when an intermediate result is available.- Parameters:
result
- The result.
-
customFinished
public void customFinished()
Declare that the future is finished. This method is only called for intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method was called for all intermediate results before.
-
customMaxResultCountAvailable
public void customMaxResultCountAvailable(int max)
-
intermediateResultAvailable
public final void intermediateResultAvailable(E result)
Call customIntermediateResultAvailable() on swing thread.- Specified by:
intermediateResultAvailable
in interfaceIFunctionalIntermediateResultListener<E>
- Specified by:
intermediateResultAvailable
in interfaceIIntermediateResultListener<E>
- Parameters:
result
- The result.
-
finished
public final void finished()
Call customFinished() on swing thread.- Specified by:
finished
in interfaceIFunctionalIntermediateFinishedListener<E>
- Specified by:
finished
in interfaceIIntermediateResultListener<E>
-
maxResultCountAvailable
public void maxResultCountAvailable(int max)
Description copied from interface:IIntermediateResultListener
Declare that the future result count is available. This method is only called for intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method will be called as often as the result count indicates except an exception occurs.- Specified by:
maxResultCountAvailable
in interfaceIFunctionalIntermediateResultCountListener
- Specified by:
maxResultCountAvailable
in interfaceIIntermediateResultListener<E>
-
customResultAvailable
public void customResultAvailable(java.util.Collection<E> result)
Overwritten to call intermediate and finished methods.- Overrides:
customResultAvailable
in classSwingDefaultResultListener<java.util.Collection<E>>
- Parameters:
result
- The result.
-
-