public final class TLspGraphicsEffects extends Object implements ILcdCollection<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.Constructor and Description |
---|
TLspGraphicsEffects(ILspView aView)
Creates a new graphics effects registry.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(ALspGraphicsEffect e) |
boolean |
addAll(Collection<? extends ALspGraphicsEffect> aCollection) |
void |
addCollectionListener(ILcdCollectionListener<ALspGraphicsEffect> aCollectionListener)
Register the listener
aCollectionListener to be informed about changes in this
collection. |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
<T extends ALspGraphicsEffect> |
getEffectsByType(Class<T> aClass)
Returns the subset of effects which extend from the given class.
|
boolean |
isEmpty() |
Iterator<ALspGraphicsEffect> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> aCollection) |
void |
removeCollectionListener(ILcdCollectionListener<ALspGraphicsEffect> aCollectionListener)
Unregister the listener
aCollectionListener 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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
public TLspGraphicsEffects(ILspView aView)
TLspGraphicsEffects
automatically
and makes it available via TLspViewServices.aView
- the view for which graphics effects are to be managedpublic <T extends ALspGraphicsEffect> Collection<T> getEffectsByType(Class<T> aClass)
T
- only descendants of ALspGraphicsEffect
are acceptedaClass
- the type of effect that is being requestedT
(may be empty)public boolean addAll(Collection<? extends ALspGraphicsEffect> aCollection)
ILcdCollection
The elements should be added to the Collection
one by one, and an TLcdCollectionEvent
fired each time an element has been
added.
addAll
in interface ILcdCollection<ALspGraphicsEffect>
addAll
in interface Collection<ALspGraphicsEffect>
public boolean removeAll(Collection<?> aCollection)
ILcdCollection
The elements should be removed from the Collection
one by one, and an TLcdCollectionEvent
fired each time an element has been
removed.
removeAll
in interface ILcdCollection<ALspGraphicsEffect>
removeAll
in interface Collection<ALspGraphicsEffect>
public boolean retainAll(Collection<?> aCollection)
ILcdCollection
The elements should be removed from the Collection
one by one, and an TLcdCollectionEvent
fired each time an element has been
removed.
retainAll
in interface ILcdCollection<ALspGraphicsEffect>
retainAll
in interface Collection<ALspGraphicsEffect>
public void clear()
ILcdCollection
The elements should be removed from the Collection
one by one, and an TLcdCollectionEvent
fired each time an element has been
removed.
clear
in interface ILcdCollection<ALspGraphicsEffect>
clear
in interface Collection<ALspGraphicsEffect>
public void addCollectionListener(ILcdCollectionListener<ALspGraphicsEffect> aCollectionListener)
ILcdCollection
Register the listener aCollectionListener
to be informed about changes in this
collection.
addCollectionListener
in interface ILcdCollection<ALspGraphicsEffect>
aCollectionListener
- the listenerILcdCollection.removeCollectionListener(ILcdCollectionListener)
public void removeCollectionListener(ILcdCollectionListener<ALspGraphicsEffect> aCollectionListener)
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.
removeCollectionListener
in interface ILcdCollection<ALspGraphicsEffect>
aCollectionListener
- the listenerILcdCollection.addCollectionListener(ILcdCollectionListener)
public int size()
size
in interface Collection<ALspGraphicsEffect>
public boolean isEmpty()
isEmpty
in interface Collection<ALspGraphicsEffect>
public boolean contains(Object o)
contains
in interface Collection<ALspGraphicsEffect>
public Iterator<ALspGraphicsEffect> iterator()
iterator
in interface Iterable<ALspGraphicsEffect>
iterator
in interface Collection<ALspGraphicsEffect>
public Object[] toArray()
toArray
in interface Collection<ALspGraphicsEffect>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<ALspGraphicsEffect>
public boolean add(ALspGraphicsEffect e)
add
in interface Collection<ALspGraphicsEffect>
public boolean remove(Object o)
remove
in interface Collection<ALspGraphicsEffect>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<ALspGraphicsEffect>