Inheritance diagram for edu.cmu.hcii.calo.test.manual.PanelSwapDemo:
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.
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. |
edu.cmu.hcii.calo.test.manual.PanelSwapDemo.PanelSwapDemo | ( | ) |
Constructs a PanelSwapDemo frame and shows it onscreen.
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.
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.
e | the action event |
void edu.cmu.hcii.calo.test.manual.PanelSwapDemo.animationDidUpdate | ( | Animation | a | ) |
Called when one of our animations updates.
a | the animation that updated |
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.
thePanels | the list of panels to lay out. This had better be allPanels unless you have a darn good reason why not. |
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.
The number of panels that are still animating.