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
ConstructorDescriptionTLspGraphicsEffects
(ILspView aView) Creates a new graphics effects registry. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends ALspGraphicsEffect> aCollection) void
addCollectionListener
(ILcdCollectionListener<ALspGraphicsEffect> aCollectionListener) Register the listeneraCollectionListener
to be informed about changes in this collection.void
clear()
boolean
boolean
containsAll
(Collection<?> c) <T extends ALspGraphicsEffect>
Collection<T> getEffectsByType
(Class<T> aClass) Returns the subset of effects which extend from the given class.boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> aCollection) void
removeCollectionListener
(ILcdCollectionListener<ALspGraphicsEffect> aCollectionListener) Unregister the listeneraCollectionListener
so it will no longer be informed about changes in this collection.boolean
retainAll
(Collection<?> aCollection) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
Methods 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 ownTLspGraphicsEffects
automatically 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 ofALspGraphicsEffect
are 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:ILcdCollection
The 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, callCollection
one by one, and anTLcdCollectionEvent
fired each time an element has been added.ILcdCollection.addAll(Collection, int)
instead with theILcdFireEventMode.FIRE_LATER
fire event mode, and subsequently callILcdCollection.fireCollectedChanges()
after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
addAll
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
addAll
in interfaceILcdCollection<ALspGraphicsEffect>
- See Also:
-
removeAll
Description copied from interface:ILcdCollection
The 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, callCollection
one by one, and anTLcdCollectionEvent
fired each time an element has been removed.ILcdCollection.removeAll(Collection, int)
instead with theILcdFireEventMode.FIRE_LATER
fire event mode, and subsequently callILcdCollection.fireCollectedChanges()
after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
removeAll
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
removeAll
in interfaceILcdCollection<ALspGraphicsEffect>
- See Also:
-
retainAll
Description copied from interface:ILcdCollection
The 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, callCollection
one by one, and anTLcdCollectionEvent
fired each time an element has been removed.ILcdCollection.retainAll(Collection, int)
instead with theILcdFireEventMode.FIRE_LATER
fire event mode, and subsequently callILcdCollection.fireCollectedChanges()
after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
retainAll
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
retainAll
in interfaceILcdCollection<ALspGraphicsEffect>
- See Also:
-
clear
public void clear()Description copied from interface:ILcdCollection
The 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, callCollection
one by one, and anTLcdCollectionEvent
fired each time an element has been removed.ILcdCollection.clear(int)
instead with theILcdFireEventMode.FIRE_LATER
fire event mode, and subsequently callILcdCollection.fireCollectedChanges()
after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
clear
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
clear
in interfaceILcdCollection<ALspGraphicsEffect>
- See Also:
-
addCollectionListener
Description copied from interface:ILcdCollection
Register the listener
aCollectionListener
to be informed about changes in this collection.- Specified by:
addCollectionListener
in interfaceILcdCollection<ALspGraphicsEffect>
- Parameters:
aCollectionListener
- the listener- See Also:
-
removeCollectionListener
public void removeCollectionListener(ILcdCollectionListener<ALspGraphicsEffect> aCollectionListener) Description copied from interface:ILcdCollection
Unregister the listener
aCollectionListener
so it will no longer be informed about changes in this collection.This method should do nothing when
aCollectionListener
was not registered previously.- Specified by:
removeCollectionListener
in interfaceILcdCollection<ALspGraphicsEffect>
- Parameters:
aCollectionListener
- the listener- See Also:
-
size
public int size()- Specified by:
size
in interfaceCollection<ALspGraphicsEffect>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<ALspGraphicsEffect>
-
contains
- Specified by:
contains
in interfaceCollection<ALspGraphicsEffect>
-
iterator
- Specified by:
iterator
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
iterator
in interfaceIterable<ALspGraphicsEffect>
-
toArray
- Specified by:
toArray
in interfaceCollection<ALspGraphicsEffect>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<ALspGraphicsEffect>
-
add
Description copied from interface:ILcdCollection
This 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_LATER
fire event mode, and subsequently callILcdCollection.fireCollectedChanges()
after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
add
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
add
in interfaceILcdCollection<ALspGraphicsEffect>
- See Also:
-
remove
Description copied from interface:ILcdCollection
This 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_LATER
fire event mode, and subsequently callILcdCollection.fireCollectedChanges()
after the lock has been released. This can avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
remove
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
remove
in interfaceILcdCollection<ALspGraphicsEffect>
- See Also:
-
containsAll
- Specified by:
containsAll
in interfaceCollection<ALspGraphicsEffect>
-