de.lessvoid.nifty.effects
Class EffectManager

java.lang.Object
  extended by de.lessvoid.nifty.effects.EffectManager

public class EffectManager
extends Object

manage all effects of an element.

Author:
void

Nested Class Summary
static interface EffectManager.Notify
           
 
Constructor Summary
EffectManager(EffectManager.Notify notify)
          create a new effectManager with the given listener.
 
Method Summary
 void begin(NiftyRenderEngine renderDevice, Element element)
          prepare rendering.
 void end(NiftyRenderEngine renderDevice)
          finish rendering.
<T extends EffectImpl>
List<Effect>
getEffects(EffectEventId effectEventId, Class<T> requestedClass)
           
 Falloff getFalloff()
           
 String getStateString(String offset)
          get state string.
 void handleHover(Element element, int x, int y)
          handle mouse hover effects.
 void handleHoverDeactivate(Element element, int x, int y)
           
 void handleHoverStartAndEnd(Element element, int x, int y)
           
 boolean isActive(EffectEventId effectEventId)
          checks if a certain effect is active.
 boolean isEmpty()
           
 void registerEffect(EffectEventId id, Effect e)
          register an effect.
 void removeAllEffects()
           
 void renderOverlay(NiftyRenderEngine renderEngine, Element element)
           
 void renderPost(NiftyRenderEngine renderEngine, Element element)
           
 void renderPre(NiftyRenderEngine renderEngine, Element element)
           
 void reset()
           
 void resetAll()
           
 void resetForHide()
           
 void resetSingleEffect(EffectEventId effectEventId)
           
 void resetSingleEffect(EffectEventId effectEventId, String customKey)
           
 void restoreForShow()
           
 void setAlternateKey(String newAlternateKey)
          set the alternate key.
 void setFalloff(Falloff newFalloff)
           
 void startEffect(EffectEventId id, Element w, TimeProvider time, EndNotify listener)
          start all effects with the given id for the given element.
 void startEffect(EffectEventId id, Element w, TimeProvider time, EndNotify listener, String customKey)
           
 void stopEffect(EffectEventId effectId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EffectManager

public EffectManager(EffectManager.Notify notify)
create a new effectManager with the given listener.

Method Detail

registerEffect

public void registerEffect(EffectEventId id,
                           Effect e)
register an effect.

Parameters:
id - the id
e - the effect

startEffect

public void startEffect(EffectEventId id,
                        Element w,
                        TimeProvider time,
                        EndNotify listener)
start all effects with the given id for the given element.

Parameters:
id - the effect id to start
w - the element
time - TimeProvider
listener - the EndNotify to use.

startEffect

public void startEffect(EffectEventId id,
                        Element w,
                        TimeProvider time,
                        EndNotify listener,
                        String customKey)

stopEffect

public void stopEffect(EffectEventId effectId)

begin

public void begin(NiftyRenderEngine renderDevice,
                  Element element)
prepare rendering.

Parameters:
renderDevice - RenderDevice

end

public void end(NiftyRenderEngine renderDevice)
finish rendering.

Parameters:
renderDevice - RenderDevice

renderPre

public void renderPre(NiftyRenderEngine renderEngine,
                      Element element)

renderPost

public void renderPost(NiftyRenderEngine renderEngine,
                       Element element)

renderOverlay

public void renderOverlay(NiftyRenderEngine renderEngine,
                          Element element)

handleHover

public void handleHover(Element element,
                        int x,
                        int y)
handle mouse hover effects.

Parameters:
element - the current element
x - mouse x position
y - mouse y position

handleHoverStartAndEnd

public void handleHoverStartAndEnd(Element element,
                                   int x,
                                   int y)

handleHoverDeactivate

public void handleHoverDeactivate(Element element,
                                  int x,
                                  int y)

isActive

public final boolean isActive(EffectEventId effectEventId)
checks if a certain effect is active.

Parameters:
effectEventId - the effectEventId to check
Returns:
true, if active, false otherwise

reset

public void reset()

resetAll

public void resetAll()

resetForHide

public void resetForHide()

restoreForShow

public void restoreForShow()

resetSingleEffect

public void resetSingleEffect(EffectEventId effectEventId)

resetSingleEffect

public void resetSingleEffect(EffectEventId effectEventId,
                              String customKey)

setAlternateKey

public void setAlternateKey(String newAlternateKey)
set the alternate key.

Parameters:
newAlternateKey - alternate key

getStateString

public String getStateString(String offset)
get state string.

Parameters:
offset - offset
Returns:
String with state information

setFalloff

public void setFalloff(Falloff newFalloff)

getFalloff

public Falloff getFalloff()

removeAllEffects

public void removeAllEffects()

isEmpty

public boolean isEmpty()

getEffects

public <T extends EffectImpl> List<Effect> getEffects(EffectEventId effectEventId,
                                                      Class<T> requestedClass)


Copyright © 2012. All Rights Reserved.