org.odlabs.wiquery.core.effects
Class Effect

java.lang.Object
  extended by org.odlabs.wiquery.core.effects.Effect
All Implemented Interfaces:
Serializable, ChainableStatement
Direct Known Subclasses:
BounceEffect, Delay, ExplodeEffect, FadeIn, FadeOut, FadeTo, Hide, HighlightEffect, PuffEffect, PulsateEffect, ScaleEffect, ShakeEffect, Show, SlideDown, SlideToggle, SlideUp, Toggle

public abstract class Effect
extends Object
implements ChainableStatement, Serializable

$Id$

Defines an abstract effect. Any jQuery effect has the same format: .effectName(speed, [callback])

An effect is a ChainableStatement, so all subclasses will have to implement ChainableStatement.chainLabel() to indicate the effect name.

Since:
0.5
Author:
Lionel Armanet
See Also:
EffectSpeed, ChainableStatement, Serialized Form

Constructor Summary
Effect(CharSequence... parameters)
          Creates a new effect.
Effect(EffectSpeed effectSpeed, CharSequence... parameters)
          Creates a new effect.
Effect(EffectSpeed effectSpeed, JsScope callback, CharSequence... parameters)
          Creates a new effect.
 
Method Summary
 JsScope effectCallback()
          The JavaScript code to execute after the effect is over.
 void setCallback(JsScope callback)
          Sets the callback of this effect.
 CharSequence[] statementArgs()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.odlabs.wiquery.core.javascript.ChainableStatement
chainLabel
 

Constructor Detail

Effect

public Effect(CharSequence... parameters)
Creates a new effect.

Parameters:
parameters - the list of parameters to apply to the effect.

Effect

public Effect(EffectSpeed effectSpeed,
              CharSequence... parameters)
Creates a new effect.

Parameters:
effectSpeed - the speed to display the effect.
parameters - the list of parameters to apply to the effect.

Effect

public Effect(EffectSpeed effectSpeed,
              JsScope callback,
              CharSequence... parameters)
Creates a new effect.

Parameters:
effectSpeed - the speed to display the effect.
callback - Callback on the effect
parameters - the list of parameters to apply to the effect.
Method Detail

statementArgs

public CharSequence[] statementArgs()
Specified by:
statementArgs in interface ChainableStatement
Returns:
the list of arguments passed to the statement.

effectCallback

public JsScope effectCallback()
The JavaScript code to execute after the effect is over.

Returns:
the JsScope to execute.

setCallback

public void setCallback(JsScope callback)
Sets the callback of this effect.

Parameters:
callback - A JsScope defining the callback


Copyright © 2012. All Rights Reserved.