com.gwtext.client.core
Interface Fx

All Known Implementing Classes:
BaseElement, CompositeElement, CompositeElementLite, ExtElement, Layer

public interface Fx

Interface that provide basic animation and visual effects support.

It is important to note that although the Fx methods and many non-Fx Element methods support "method chaining" in that they return the Element object itself as the method return value, it is not always possible to mix the two in a single method chain. The Fx methods use an internal effects queue so that each effect can be properly timed and sequenced. Non-Fx methods, on the other hand, have no such internal queueing and will always execute immediately. For this reason, while it may be possible to mix certain Fx and non-Fx method calls in a single chain, it may not always provide the expected results and should be done with care.


Method Summary
 Fx fadeIn()
          Fade an element in (from transparent to opaque).
 Fx fadeIn(FxConfig config)
          Fade an element in (from transparent to opaque).
 Fx fadeOut()
          Fade an element out (from opaque to transparent) from the element's current opacity to 0.
 Fx fadeOut(FxConfig config)
          Fade an element out (from opaque to transparent).
 Fx frame()
          Shows a ripple of exploding, attenuating borders to draw attention to an Element.
 Fx frame(java.lang.String color, int count, FxConfig config)
          Shows a ripple of exploding, attenuating borders to draw attention to an Element.
 Fx ghost()
          Slides the element while fading it out of view.
 Fx ghost(java.lang.String anchorPosition, FxConfig config)
          Slides the element while fading it out of view.
 boolean hasActiveFx()
          Returns true if the element has any effects actively running or queued, else returns false.
 boolean hasFxBlock()
          Returns true if the element is currently blocking so that no other effect can be queued until this effect is finished, else returns false if blocking is not set.
 Fx highlight()
          Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color.
 Fx highlight(java.lang.String color, FxConfig config)
          Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color.
 Fx highlight(java.lang.String color, java.lang.String attr, java.lang.String endColor, FxConfig config)
          Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color.
 Fx pause(int seconds)
          Creates a pause before any subsequent queued effects begin.
 Fx puff()
          Fades the element out while slowly expanding it in all directions.
 Fx puff(boolean remove, FxConfig config)
          Fades the element out while slowly expanding it in all directions.
 Fx scale(int width, int height)
          Animates the transition of an element's dimensions from a starting height/width to an ending height/width.
 Fx scale(int width, int height, FxConfig config)
          Animates the transition of an element's dimensions from a starting height/width to an ending height/width.
 Fx sequenceFx()
          Ensures that all effects queued after sequenceFx is called on the element are run in sequence.
 Fx shift(int x, int y, int width, int height, FxConfig config)
          Animates the transition of any combination of an element's dimensions, xy position and/or opacity.
 Fx slideIn()
          Slides the element into view.
 Fx slideIn(java.lang.String anchorPosition, FxConfig config)
          Slides the element into view.
 Fx slideOut()
          Slides the element out of view.
 Fx slideOut(boolean remove, java.lang.String anchorPosition, FxConfig config)
          Slides the element out of view.
 Fx stopFx()
          Stops any running effects and clears the element's internal effects queue if it contains any additional effects that haven't started yet.
 Fx switchOff()
          Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television).
 Fx switchOff(boolean remove, FxConfig config)
          Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television).
 Fx syncFx()
          Ensures that all effects queued after syncFx is called on the element are run concurrently.
 

Method Detail

fadeIn

Fx fadeIn()
Fade an element in (from transparent to opaque).

 // default: fade in from opacity 0 to 100%
 el.fadeIn();
 

Returns:
this

fadeIn

Fx fadeIn(FxConfig config)
Fade an element in (from transparent to opaque). The ending opacity can be specified using the "endOpacity" config option.

 // fade in from opacity 0 to 75% over 2 seconds
 el.fadeIn(new FxConfig() {
 {
    setEndOpacity(0.75);
    setDuration(2);
 });
 

Parameters:
config - the Fx config
Returns:
this

fadeOut

Fx fadeOut()
Fade an element out (from opaque to transparent) from the element's current opacity to 0.

Returns:
this

fadeOut

Fx fadeOut(FxConfig config)
Fade an element out (from opaque to transparent). The ending opacity can be specified using the "endOpacity" config option.

 // fade out from the element's current opacity to 25% over 2 seconds
 el.fadeOut(new FxConfig() {
 {
    setEndOpacity(0.25);
    setDuration(2);
 });
 

Parameters:
config - the Fx config
Returns:
this

frame

Fx frame()
Shows a ripple of exploding, attenuating borders to draw attention to an Element.

Returns:
this

frame

Fx frame(java.lang.String color,
         int count,
         FxConfig config)
Shows a ripple of exploding, attenuating borders to draw attention to an Element.

 // 3 red ripples lasting 3 seconds total
 el.frame("ff0000", 3, new FxConfig() {
                     {
                         setDurtion(3);
                     }));
 

Parameters:
color - he color of the border. Should be a 6 char hex color without the leading # (defaults to light blue: 'C3DAF9').
count - The number of ripples to display (defaults to 1)
config - the Fx config
Returns:
this

ghost

Fx ghost()
Slides the element while fading it out of view.

Returns:
this

ghost

Fx ghost(java.lang.String anchorPosition,
         FxConfig config)
Slides the element while fading it out of view.

Parameters:
anchorPosition - the anchor position
config - the Fx config
Returns:
true

hasActiveFx

boolean hasActiveFx()
Returns true if the element has any effects actively running or queued, else returns false.

Returns:
True if element has active effects, else false

hasFxBlock

boolean hasFxBlock()
Returns true if the element is currently blocking so that no other effect can be queued until this effect is finished, else returns false if blocking is not set. This is commonly used to ensure that an effect initiated by a user action runs to completion prior to the same effect being restarted (e.g., firing only one effect even if the user clicks several times).

Returns:
True if blocking, else false

highlight

Fx highlight()
Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color.

Returns:
this

highlight

Fx highlight(java.lang.String color,
             FxConfig config)
Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color.

Parameters:
color - The highlight color. Should be a 6 char hex color without the leading # (defaults to yellow: 'ffff9c')
config - the Fx config
Returns:
this

highlight

Fx highlight(java.lang.String color,
             java.lang.String attr,
             java.lang.String endColor,
             FxConfig config)
Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color. If no original color is available, you should provide the "endColor" config option which will be cleared after the animation.

 // highlight foreground text to blue for 2 seconds
 el.highlight("0000ff", "color", "ffffff", new FxConfig() {{
                        setDuration(3)
                        }});

Parameters:
color - The highlight color. Should be a 6 char hex color without the leading # (defaults to yellow: 'ffff9c')
attr - the attribute. Can be any valid CSS property (attribute) that supports a color value. Default is 'background-color'
endColor - the end color
config - the Fx config
Returns:
this

pause

Fx pause(int seconds)
Creates a pause before any subsequent queued effects begin. If there are no effects queued after the pause it will have no effect.

Parameters:
seconds - The length of time to pause (in seconds)
Returns:
this

puff

Fx puff()
Fades the element out while slowly expanding it in all directions. When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document.

Returns:
this

puff

Fx puff(boolean remove,
        FxConfig config)
Fades the element out while slowly expanding it in all directions. When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document. The element can be removed from the DOM using the 'remove' config option if desired.

Parameters:
remove - true to remove element
config - the Fx config
Returns:
this

scale

Fx scale(int width,
         int height)
Animates the transition of an element's dimensions from a starting height/width to an ending height/width.

Parameters:
width - The new width
height - The new height
Returns:
this

scale

Fx scale(int width,
         int height,
         FxConfig config)
Animates the transition of an element's dimensions from a starting height/width to an ending height/width.

Parameters:
width - The new width
height - The new height
config - the Fx config
Returns:
this

sequenceFx

Fx sequenceFx()
Ensures that all effects queued after sequenceFx is called on the element are run in sequence. This is the opposite of syncFx.

Returns:
this

shift

Fx shift(int x,
         int y,
         int width,
         int height,
         FxConfig config)
Animates the transition of any combination of an element's dimensions, xy position and/or opacity. Any of these properties not specified in the config object will not be changed. This effect requires that at least one new dimension, position or opacity setting must be passed in on the config object in order for the function to have any effect.

Parameters:
x - X postionion
y - Y position
width - the new width
height - the new height
config - the Fx config
Returns:
this

slideIn

Fx slideIn()
Slides the element into view. An anchor point can be optionally passed to set the point of origin for the slide effect. This function automatically handles wrapping the element with a fixed-size container if needed. Slides in from top by default.

Returns:
this

slideIn

Fx slideIn(java.lang.String anchorPosition,
           FxConfig config)
Slides the element into view. An anchor point can be optionally passed to set the point of origin for the slide effect. This function automatically handles wrapping the element with a fixed-size container if needed.

Parameters:
anchorPosition - the anchor position
config - the Fx config
Returns:
this

slideOut

Fx slideOut()
Slides the element out of view. An anchor point can be optionally passed to set the end point for the slide effect. When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document. This function automatically handles wrapping the element with a fixed-size container if needed.

Returns:
this

slideOut

Fx slideOut(boolean remove,
            java.lang.String anchorPosition,
            FxConfig config)
Slides the element out of view. An anchor point can be optionally passed to set the end point for the slide effect. When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document. This function automatically handles wrapping the element with a fixed-size container if needed.

Parameters:
remove - true to remove element from the DOM
anchorPosition - the anchor position
config - the Fx config
Returns:
this

stopFx

Fx stopFx()
Stops any running effects and clears the element's internal effects queue if it contains any additional effects that haven't started yet.

Returns:
this

switchOff

Fx switchOff()
Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television). When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document.

Returns:
this

switchOff

Fx switchOff(boolean remove,
             FxConfig config)
Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television). When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document.

Parameters:
remove - true to remove element from the DOM
config - the Fx config
Returns:
this

syncFx

Fx syncFx()
Ensures that all effects queued after syncFx is called on the element are run concurrently. This is the opposite of sequenceFx.

Returns:
this