Package com.luciad.util
Class TLcdStatusEventSupport<T>
java.lang.Object
com.luciad.util.TLcdStatusEventSupport<T>
This class provides support to register listeners to TLcdStatusEvent objects.
It has a list of ILcdStatusListener objects. Listeners can be added and
removed and events can be sent out to the registered listeners.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStatusListener
(ILcdStatusListener<T> aStatusListener) Adds a status listener that will listen to the events fired usingfireStatusEvent(com.luciad.util.TLcdStatusEvent<T>)
.Returns a status listener that forwards all received events to the registered listeners.void
fireStatusEvent
(TLcdStatusEvent<T> aStatusEvent) Fires a status event, thus notifying all listeners that were added usingaddStatusListener(com.luciad.util.ILcdStatusListener<T>)
.Returns an array containing all listeners that were added usingaddStatusListener(com.luciad.util.ILcdStatusListener<T>)
.boolean
Deprecated.This method has been deprecated.void
removeStatusListener
(ILcdStatusListener<T> aStatusListener) Removes a status listener that listened to the events fired using this instancesfireStatusEvent(com.luciad.util.TLcdStatusEvent<T>)
.static void
setClassTraceOn
(boolean aClassTraceOn) Deprecated.This method has been deprecated.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.
-
Constructor Details
-
TLcdStatusEventSupport
public TLcdStatusEventSupport()
-
-
Method Details
-
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istrue
then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn
- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
addStatusListener
Adds a status listener that will listen to the events fired usingfireStatusEvent(com.luciad.util.TLcdStatusEvent<T>)
.- Parameters:
aStatusListener
- a listener for all events fired by this instance. The listener must not be null.- Throws:
NullPointerException
- when the listener passed is null.- See Also:
-
removeStatusListener
Removes a status listener that listened to the events fired using this instancesfireStatusEvent(com.luciad.util.TLcdStatusEvent<T>)
.- Parameters:
aStatusListener
- a listener for all events fired by this instance.- See Also:
-
fireStatusEvent
Fires a status event, thus notifying all listeners that were added usingaddStatusListener(com.luciad.util.ILcdStatusListener<T>)
.- Parameters:
aStatusEvent
- the status event to pass to all listeners.
-
getStatusListeners
Returns an array containing all listeners that were added usingaddStatusListener(com.luciad.util.ILcdStatusListener<T>)
. If no listeners were added, an empty array will be returned.- Returns:
- an array containing all listeners that were added using
addStatusListener(com.luciad.util.ILcdStatusListener<T>)
.
-
asListener
Returns a status listener that forwards all received events to the registered listeners.- Returns:
- a forwarding status listener
- Since:
- 2016.1
-