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 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
-
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
Collection
one by one, and anTLcdCollectionEvent
fired each time an element has been added.- Specified by:
addAll
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
addAll
in interfaceILcdCollection<ALspGraphicsEffect>
-
removeAll
Description copied from interface:ILcdCollection
The elements should be removed from the
Collection
one by one, and anTLcdCollectionEvent
fired each time an element has been removed.- Specified by:
removeAll
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
removeAll
in interfaceILcdCollection<ALspGraphicsEffect>
-
retainAll
Description copied from interface:ILcdCollection
The elements should be removed from the
Collection
one by one, and anTLcdCollectionEvent
fired each time an element has been removed.- Specified by:
retainAll
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
retainAll
in interfaceILcdCollection<ALspGraphicsEffect>
-
clear
public void clear()Description copied from interface:ILcdCollection
The elements should be removed from the
Collection
one by one, and anTLcdCollectionEvent
fired each time an element has been removed.- Specified by:
clear
in interfaceCollection<ALspGraphicsEffect>
- Specified by:
clear
in interfaceILcdCollection<ALspGraphicsEffect>
-
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
addCollectionListener
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
- Specified by:
add
in interfaceCollection<ALspGraphicsEffect>
-
remove
- Specified by:
remove
in interfaceCollection<ALspGraphicsEffect>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<ALspGraphicsEffect>
-