Class TLspGraphicsEffects
- All Implemented Interfaces:
ILcdCollection<ALspGraphicsEffect>,Iterable<ALspGraphicsEffect>,Collection<ALspGraphicsEffect>
ILspView. Examples
of such effects include lighting and fog. This class is a Collection
of ALspGraphicsEffect objects. Effects can be added to a view simply by
inserting them into this collection.
Although effects are by default considered to be global for the whole view, it is
possible to selectively prevent them from being applied to certain objects using
ILspEffectsHintStyle.
This class is not thread-safe. Adding, removing or modifying graphics effects should
only be done on the event dispatch thread.- Since:
- 2013.0
-
Constructor Summary
ConstructorsConstructorDescriptionTLspGraphicsEffects(ILspView aView) Creates a new graphics effects registry. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends ALspGraphicsEffect> aCollection) voidaddCollectionListener(ILcdCollectionListener<ALspGraphicsEffect> aCollectionListener) Register the listeneraCollectionListenerto be informed about changes in this collection.voidclear()booleanbooleancontainsAll(Collection<?> c) <T extends ALspGraphicsEffect>
Collection<T> getEffectsByType(Class<T> aClass) Returns the subset of effects which extend from the given class.booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> aCollection) voidremoveCollectionListener(ILcdCollectionListener<ALspGraphicsEffect> aCollectionListener) Unregister the listeneraCollectionListenerso it will no longer be informed about changes in this collection.booleanretainAll(Collection<?> aCollection) intsize()Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArrayMethods inherited from interface com.luciad.util.collections.ILcdCollection
add, addAll, clear, fireCollectedChanges, remove, removeAll, retainAll
-
Constructor Details
-
TLspGraphicsEffects
Creates a new graphics effects registry. This constructor should not be called directly: each Lightspeed view creates its ownTLspGraphicsEffectsautomatically and makes it available via TLspViewServices.- Parameters:
aView- the view for which graphics effects are to be managed
-
-
Method Details
-
getEffectsByType
Returns the subset of effects which extend from the given class.- Type Parameters:
T- only descendants ofALspGraphicsEffectare accepted- Parameters:
aClass- the type of effect that is being requested- Returns:
- list of effects that inherit from
T(may be empty)
-
addAll
Description copied from interface:ILcdCollectionThe elements should be added to the
This method immediately fires change events to its registered change listeners. If this collection is protected by a read/write lock, callCollectionone by one, and anTLcdCollectionEventfired each time an element has been added.ILcdCollection.addAll(Collection, int)instead with theILcdFireEventMode.FIRE_LATERfire event mode, and subsequently callILcdCollection.fireCollectedChanges()after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadocfor an example code snippet.- Specified by:
addAllin interfaceCollection<ALspGraphicsEffect>- Specified by:
addAllin interfaceILcdCollection<ALspGraphicsEffect>- See Also:
-
removeAll
Description copied from interface:ILcdCollectionThe elements should be removed from the
This method immediately fires change events to its registered change listeners. If this collection is protected by a read/write lock, callCollectionone by one, and anTLcdCollectionEventfired each time an element has been removed.ILcdCollection.removeAll(Collection, int)instead with theILcdFireEventMode.FIRE_LATERfire event mode, and subsequently callILcdCollection.fireCollectedChanges()after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadocfor an example code snippet.- Specified by:
removeAllin interfaceCollection<ALspGraphicsEffect>- Specified by:
removeAllin interfaceILcdCollection<ALspGraphicsEffect>- See Also:
-
retainAll
Description copied from interface:ILcdCollectionThe elements should be removed from the
This method immediately fires change events to its registered change listeners. If this collection is protected by a read/write lock, callCollectionone by one, and anTLcdCollectionEventfired each time an element has been removed.ILcdCollection.retainAll(Collection, int)instead with theILcdFireEventMode.FIRE_LATERfire event mode, and subsequently callILcdCollection.fireCollectedChanges()after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadocfor an example code snippet.- Specified by:
retainAllin interfaceCollection<ALspGraphicsEffect>- Specified by:
retainAllin interfaceILcdCollection<ALspGraphicsEffect>- See Also:
-
clear
public void clear()Description copied from interface:ILcdCollectionThe elements should be removed from the
This method immediately fires change events to its registered change listeners. If this collection is protected by a read/write lock, callCollectionone by one, and anTLcdCollectionEventfired each time an element has been removed.ILcdCollection.clear(int)instead with theILcdFireEventMode.FIRE_LATERfire event mode, and subsequently callILcdCollection.fireCollectedChanges()after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadocfor an example code snippet.- Specified by:
clearin interfaceCollection<ALspGraphicsEffect>- Specified by:
clearin interfaceILcdCollection<ALspGraphicsEffect>- See Also:
-
addCollectionListener
Description copied from interface:ILcdCollectionRegister the listener
aCollectionListenerto be informed about changes in this collection.- Specified by:
addCollectionListenerin interfaceILcdCollection<ALspGraphicsEffect>- Parameters:
aCollectionListener- the listener- See Also:
-
removeCollectionListener
public void removeCollectionListener(ILcdCollectionListener<ALspGraphicsEffect> aCollectionListener) Description copied from interface:ILcdCollectionUnregister the listener
aCollectionListenerso it will no longer be informed about changes in this collection.This method should do nothing when
aCollectionListenerwas not registered previously.- Specified by:
removeCollectionListenerin interfaceILcdCollection<ALspGraphicsEffect>- Parameters:
aCollectionListener- the listener- See Also:
-
size
public int size()- Specified by:
sizein interfaceCollection<ALspGraphicsEffect>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<ALspGraphicsEffect>
-
contains
- Specified by:
containsin interfaceCollection<ALspGraphicsEffect>
-
iterator
- Specified by:
iteratorin interfaceCollection<ALspGraphicsEffect>- Specified by:
iteratorin interfaceIterable<ALspGraphicsEffect>
-
toArray
- Specified by:
toArrayin interfaceCollection<ALspGraphicsEffect>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<ALspGraphicsEffect>
-
add
Description copied from interface:ILcdCollectionThis method immediately fires change events to its registered change listeners. If this collection is protected by a read/write lock, callILcdCollection.add(Object, int)instead with theILcdFireEventMode.FIRE_LATERfire event mode, and subsequently callILcdCollection.fireCollectedChanges()after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadocfor an example code snippet.- Specified by:
addin interfaceCollection<ALspGraphicsEffect>- Specified by:
addin interfaceILcdCollection<ALspGraphicsEffect>- See Also:
-
remove
Description copied from interface:ILcdCollectionThis method immediately fires change events to its registered change listeners. If this collection is protected by a read/write lock, callILcdCollection.remove(Object, int)instead with theILcdFireEventMode.FIRE_LATERfire event mode, and subsequently callILcdCollection.fireCollectedChanges()after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadocfor an example code snippet.- Specified by:
removein interfaceCollection<ALspGraphicsEffect>- Specified by:
removein interfaceILcdCollection<ALspGraphicsEffect>- See Also:
-
containsAll
- Specified by:
containsAllin interfaceCollection<ALspGraphicsEffect>
-