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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStatusListener(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.voidfireStatusEvent(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>).booleanDeprecated.This method has been deprecated.voidremoveStatusListener(ILcdStatusListener<T> aStatusListener) Removes a status listener that listened to the events fired using this instancesfireStatusEvent(com.luciad.util.TLcdStatusEvent<T>).static voidsetClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated.voidsetTraceOn(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 istruethen 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 eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen 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.Returnstrueif 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
-