public final class TLspGraphicsEffects extends java.lang.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(java.util.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(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
<T extends ALspGraphicsEffect> |
getEffectsByType(java.lang.Class<T> aClass)
Returns the subset of effects which extend from the given class.
|
boolean |
isEmpty() |
java.util.Iterator<ALspGraphicsEffect> |
iterator() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.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(java.util.Collection<?> aCollection) |
int |
size() |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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> java.util.Collection<T> getEffectsByType(java.lang.Class<T> aClass)
T
- only descendants of ALspGraphicsEffect
are acceptedaClass
- the type of effect that is being requestedT
(may be empty)public boolean addAll(java.util.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 java.util.Collection<ALspGraphicsEffect>
public boolean removeAll(java.util.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 java.util.Collection<ALspGraphicsEffect>
public boolean retainAll(java.util.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 java.util.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 java.util.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 java.util.Collection<ALspGraphicsEffect>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<ALspGraphicsEffect>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<ALspGraphicsEffect>
public java.util.Iterator<ALspGraphicsEffect> iterator()
iterator
in interface java.lang.Iterable<ALspGraphicsEffect>
iterator
in interface java.util.Collection<ALspGraphicsEffect>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<ALspGraphicsEffect>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<ALspGraphicsEffect>
public boolean add(ALspGraphicsEffect e)
add
in interface java.util.Collection<ALspGraphicsEffect>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<ALspGraphicsEffect>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<ALspGraphicsEffect>