KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > AnimationFeedbackBase


1 /*******************************************************************************
2  * Copyright (c) 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  ******************************************************************************/

11 package org.eclipse.ui.internal;
12
13 import org.eclipse.swt.widgets.Shell;
14
15 /**
16  * AnimationFeedBackBase is an abstract class which provides renderStep(), jobInit() and
17  * initialize() methods for AnimationEngine.
18  * Its the base class for all the
19  * animationFeedbacks
20  *
21  * @since 3.3
22  *
23  */

24 public abstract class AnimationFeedbackBase {
25
26     private Shell animationShell;
27
28     /**
29      * Creates an AnimationFeedback
30      *
31      * @param parentShell specifies the composite where the animation will be drawn
32      */

33     public AnimationFeedbackBase(Shell parentShell) {
34         animationShell = parentShell;
35     }
36
37     /**
38      * Perform any initialization you want to do -prior- to the Job actually
39      * gets scheduled.
40      *
41      * @param animationEngine The engine we're hosted in.
42      */

43     public abstract void initialize(AnimationEngine animationEngine);
44
45     /**
46      * Its a draw method. All the code to render an animation goes in this
47      * method.
48      *
49      * @param engine
50      */

51     public abstract void renderStep(AnimationEngine engine);
52
53     /**
54      * Perform any initialization you want to have happen -before- the animation
55      * starts. Subclasses may subclass but not override (i.e. you have to call super).
56      *
57      * @param engine The AnimationEngine hosting the feedback
58      * @return 'true' iff the animation is capable of running
59      */

60     public boolean jobInit(AnimationEngine engine) { return engine != null; }
61
62     /**
63      * Dispose any locally created resources
64      */

65     public abstract void dispose();
66
67     public Shell getAnimationShell() {
68         return animationShell;
69     }
70
71 }
72
Popular Tags