edu.cmu.hcii.calo.test.manual.PanelSwapDemo Class Reference

Inherits edu.cmu.hcii.calo.view.animation.AnimationListener.

Inheritance diagram for edu.cmu.hcii.calo.test.manual.PanelSwapDemo:

Inheritance graph
[legend]
Collaboration diagram for edu.cmu.hcii.calo.test.manual.PanelSwapDemo:

Collaboration graph
[legend]
List of all members.

Detailed Description

A manual test demo for the Animation component.

This one is a bit more ambitious, and causes a list of panels to swap places, with the bottom one coming to the top and the others moving down to fill the space. The applications of this to the task view in the sidebar should be fairly obvious.

Author:
Brian Ellis


Public Member Functions

 PanelSwapDemo ()
 Constructs a PanelSwapDemo frame and shows it onscreen.
void actionPerformed (ActionEvent e)
 Called when the swap button is clicked.
void animationDidUpdate (Animation a)
 Called when one of our animations updates.

Static Public Member Functions

static void main (String[] args)
 Main function.

Private Member Functions

void layoutPanels (JPanel[] thePanels)
 Lays out the panels in the given array such that they are in order in the window from top to bottom.

Private Attributes

JPanel[] allPanels
 The array of all panels in the window, in order from top to bototm.
boolean didCleanup
 Whether or not we've yet synchronized the layout of the panel to match the components' physical positions.
int numberAnimating
 The number of panels that are still animating.

Static Private Attributes

static final long serialVersionUID = 8006008058673487439L
 To prevent serialization collisions.
static final Dimension WINDOW_SIZE = new Dimension(640, 480)
 The initial size of the window.
static final double ANIMATION_DURATION = 0.5
 How long the animation should take, in seconds.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.test.manual.PanelSwapDemo.PanelSwapDemo (  ) 

Constructs a PanelSwapDemo frame and shows it onscreen.


Member Function Documentation

static void edu.cmu.hcii.calo.test.manual.PanelSwapDemo.main ( String[]  args  )  [static]

Main function.

Just sets the look and feel and creates a window.

Parameters:
args command-line args, as if you didn't know

void edu.cmu.hcii.calo.test.manual.PanelSwapDemo.actionPerformed ( ActionEvent  e  ) 

Called when the swap button is clicked.

Parameters:
e the action event
See also:
java.awt.event.ActionListener.actionPerformed(java.awt.event.ActionEvent)

void edu.cmu.hcii.calo.test.manual.PanelSwapDemo.animationDidUpdate ( Animation  a  ) 

Called when one of our animations updates.

Parameters:
a the animation that updated
See also:
edu.cmu.hcii.calo.view.animation.AnimationListener.animationDidUpdate(edu.cmu.hcii.calo.view.animation.Animation)

Implements edu.cmu.hcii.calo.view.animation.AnimationListener.

void edu.cmu.hcii.calo.test.manual.PanelSwapDemo.layoutPanels ( JPanel[]  thePanels  )  [private]

Lays out the panels in the given array such that they are in order in the window from top to bottom.

Parameters:
thePanels the list of panels to lay out. This had better be allPanels unless you have a darn good reason why not.


Member Data Documentation

final long edu.cmu.hcii.calo.test.manual.PanelSwapDemo.serialVersionUID = 8006008058673487439L [static, private]

To prevent serialization collisions.

final Dimension edu.cmu.hcii.calo.test.manual.PanelSwapDemo.WINDOW_SIZE = new Dimension(640, 480) [static, private]

The initial size of the window.

final double edu.cmu.hcii.calo.test.manual.PanelSwapDemo.ANIMATION_DURATION = 0.5 [static, private]

How long the animation should take, in seconds.

JPanel [] edu.cmu.hcii.calo.test.manual.PanelSwapDemo.allPanels [private]

The array of all panels in the window, in order from top to bototm.

boolean edu.cmu.hcii.calo.test.manual.PanelSwapDemo.didCleanup [private]

Whether or not we've yet synchronized the layout of the panel to match the components' physical positions.

int edu.cmu.hcii.calo.test.manual.PanelSwapDemo.numberAnimating [private]

The number of panels that are still animating.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:19 2007 for CALO by  doxygen 1.5.2