org.tbee.swing.cardlayout
Class AnimatedCardLayout

java.lang.Object
  extended by java.awt.CardLayout
      extended by org.tbee.swing.cardlayout.CardLayout
          extended by org.tbee.swing.cardlayout.AnimatedCardLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2, java.io.Serializable, AnimationListener

public class AnimatedCardLayout
extends CardLayout
implements AnimationListener

Version:
$Revision: 1.9 $
See Also:
Serialized Form

Nested Class Summary
protected static class AnimatedCardLayout.Tuple
           
 
Field Summary
static java.lang.String ANIMATION_COMPONENT_NAME
           
protected  int animationDuration
           
protected  java.util.List comps
          The list of component & names.
static java.lang.String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
AnimatedCardLayout()
          Simple constructor.
AnimatedCardLayout(Animation anim)
          Constructor that takes an animation.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Adds the given component to this layout with the given name.
 void animationFinished()
          Notification that animation has finished.
protected  void fireCardChangeListenerEvent(CardChangeEvent e)
          Prevent multiple events
 void first(java.awt.Container parent)
          Shows an animation while flipping to the first card.
 Animation getAnimation()
          Gets the current Animation.
 boolean isAnimating()
           
 void last(java.awt.Container parent)
          Shows an animation while flipping to the last card.
 void next(java.awt.Container parent)
          Shows an animation while flipping to the next card.
 void previous(java.awt.Container parent)
          Shows an animation while flipping to the previous card.
 void removeLayoutComponent(java.awt.Component comp)
          Removes the given component from this layout.
 void setAnimation(Animation animation)
          Sets the current Animation.
 void setAnimationDuration(int animationDuration)
          set duration of the animation.
 void show(java.awt.Container parent, java.lang.String name)
          Flips to the specified card, using an animation.
 
Methods inherited from class org.tbee.swing.cardlayout.CardLayout
addCardChangedListener, addCardChangeListener, addLayoutComponent, fireCardChangedListenerEvent, getComponent, getContainer, getName, getVisibleComponent, getVisibleComponentName, layoutContainer, removeCardChangedListener, removeCardChangeListener
 
Methods inherited from class java.awt.CardLayout
addLayoutComponent, getHgap, getLayoutAlignmentX, getLayoutAlignmentY, getVgap, invalidateLayout, maximumLayoutSize, minimumLayoutSize, preferredLayoutSize, setHgap, setVgap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final java.lang.String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values

animationDuration

protected int animationDuration

comps

protected java.util.List comps
The list of component & names. Necessary because 'vector' is package-private.


ANIMATION_COMPONENT_NAME

public static final java.lang.String ANIMATION_COMPONENT_NAME
See Also:
Constant Field Values
Constructor Detail

AnimatedCardLayout

public AnimatedCardLayout()
Simple constructor. To add an animation, use setAnimation(Animation).


AnimatedCardLayout

public AnimatedCardLayout(Animation anim)
Constructor that takes an animation.

Method Detail

isAnimating

public boolean isAnimating()

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Adds the given component to this layout with the given name.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Overrides:
addLayoutComponent in class CardLayout

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Removes the given component from this layout.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Overrides:
removeLayoutComponent in class CardLayout

first

public void first(java.awt.Container parent)
Shows an animation while flipping to the first card.

Overrides:
first in class java.awt.CardLayout

next

public void next(java.awt.Container parent)
Shows an animation while flipping to the next card.

Overrides:
next in class java.awt.CardLayout

previous

public void previous(java.awt.Container parent)
Shows an animation while flipping to the previous card.

Overrides:
previous in class java.awt.CardLayout

last

public void last(java.awt.Container parent)
Shows an animation while flipping to the last card.

Overrides:
last in class java.awt.CardLayout

show

public void show(java.awt.Container parent,
                 java.lang.String name)
Flips to the specified card, using an animation.

Overrides:
show in class CardLayout

fireCardChangeListenerEvent

protected void fireCardChangeListenerEvent(CardChangeEvent e)
Prevent multiple events

Overrides:
fireCardChangeListenerEvent in class CardLayout
Parameters:
e -

animationFinished

public void animationFinished()
Notification that animation has finished.

Specified by:
animationFinished in interface AnimationListener

getAnimation

public Animation getAnimation()
Gets the current Animation.


setAnimation

public void setAnimation(Animation animation)
Sets the current Animation.


setAnimationDuration

public void setAnimationDuration(int animationDuration)
set duration of the animation.

Parameters:
duration - duration of the animation in the ms


Copyright © 2010 KnowledgePlaza. All Rights Reserved.