|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jvnet.lafwidget.animation.FadeIgnoreManager
public class FadeIgnoreManager
This class is used to decide whether the automatic animations in the
FadeStateListener#trackModelChange(org.jvnet.lafwidget.utils.FadeTracker.FadeKind, boolean, boolean)
should be applied on a specific component. The specific LAF implementation
may decide to ignore animations on cell renderers and editors.
At runtime, the manager is populated from
META-INF/lafwidget.animations.properties
resources found in
classpath. This allows providing additional application-specific components
to be registered as animation-"free". Each such resource should contain a
list of fully qualified class names, one class name per line. The class name
may be a "leaf" class (such as JToggleButton
), or can be a parent
class / interface (such as ListCellRenderer
). In the later case, the
animations will be ignored on all components that extend such class /
implement such interface.
In addition, the addToIgnoreAnimations(Class)
and
addToIgnoreAnimations(String)
API can be used to register additional
application-specific components.
Field Summary | |
---|---|
protected java.util.Set<java.lang.Class<?>> |
cache
Contains Class instances. |
protected java.util.Set<java.lang.Class<?>> |
ignoreAnimationsOn
Contains Class instances. |
Constructor Summary | |
---|---|
FadeIgnoreManager()
Creates a new empty manager. |
Method Summary | |
---|---|
void |
addToIgnoreAnimations(java.lang.Class<?> clazz)
Adds the specified class to the set of components that should ignore animations. |
void |
addToIgnoreAnimations(java.lang.String className)
Adds the specified class name to the set of components that should ignore animations. |
void |
populate()
Populates the ignoreAnimationsOn set. |
protected void |
populateFrom(java.net.URL url)
Populates the ignoreAnimationsOn set from the specific URL
resource. |
boolean |
toIgnoreAnimations(java.awt.Component comp)
Returns indication whether the specified component should ignore animations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Set<java.lang.Class<?>> ignoreAnimationsOn
Class
instances. If a class instance is in this set, all
components of this class (directly, via extension or via inheritance)
will not have animations on model changes.
protected java.util.Set<java.lang.Class<?>> cache
Class
instances. This serves as a cache to speed up the
subsequent processing.
toIgnoreAnimations(Component)
Constructor Detail |
---|
public FadeIgnoreManager()
Method Detail |
---|
public void populate()
ignoreAnimationsOn
set. The classpath is scanned
for all resources that match the name
META-INF/lafwidget.animations.properties
.
populateFrom(URL)
protected void populateFrom(java.net.URL url)
ignoreAnimationsOn
set from the specific URL
resource. The resource should contain a list of fully qualified class
names, one class name per line. The class name may be a "leaf" class
(such as JToggleButton
), or can be a parent class / interface
(such as ListCellRenderer
). In the later case, the animations
will be ignored on all components that extend such class / implement such
interface.
url
- Resource URL.public void addToIgnoreAnimations(java.lang.Class<?> clazz)
clazz
- Component class.public void addToIgnoreAnimations(java.lang.String className)
className
- Component class name.public boolean toIgnoreAnimations(java.awt.Component comp)
ignoreAnimationsOn
set. If the class of the current ascendant
matches one of the entries, true
is returned. Otherwise,
false
is returned (no ascendant found matching any of the
entries in the ignoreAnimationsOn
set).
The implementation uses the cache
tp speed up the processing.
When a component class is determined to ignore animations, its class is
put in this cache. The implementation first consults this cache - if the
component class is found, true
is returned. Otherwise, the
above algorithm is performed.
comp
- Component.
true
if the specified component should ignore
animations, false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |