01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: ******************************************************************************/package org.eclipse.ui.internal;
11:
12: import org.eclipse.swt.widgets.Shell;
13:
14: /**
15: * AnimationFeedBackBase is an abstract class which provides renderStep(), jobInit() and
16: * initialize() methods for AnimationEngine.
17: * Its the base class for all the
18: * animationFeedbacks
19: *
20: * @since 3.3
21: *
22: */
23: public abstract class AnimationFeedbackBase {
24:
25: private Shell animationShell;
26:
27: /**
28: * Creates an AnimationFeedback
29: *
30: * @param parentShell specifies the composite where the animation will be drawn
31: */
32: public AnimationFeedbackBase(Shell parentShell) {
33: animationShell = parentShell;
34: }
35:
36: /**
37: * Perform any initialization you want to do -prior- to the Job actually
38: * gets scheduled.
39: *
40: * @param animationEngine The engine we're hosted in.
41: */
42: public abstract void initialize(AnimationEngine animationEngine);
43:
44: /**
45: * Its a draw method. All the code to render an animation goes in this
46: * method.
47: *
48: * @param engine
49: */
50: public abstract void renderStep(AnimationEngine engine);
51:
52: /**
53: * Perform any initialization you want to have happen -before- the animation
54: * starts. Subclasses may subclass but not override (i.e. you have to call super).
55: *
56: * @param engine The AnimationEngine hosting the feedback
57: * @return 'true' iff the animation is capable of running
58: */
59: public boolean jobInit(AnimationEngine engine) {
60: return engine != null;
61: }
62:
63: /**
64: * Dispose any locally created resources
65: */
66: public abstract void dispose();
67:
68: public Shell getAnimationShell() {
69: return animationShell;
70: }
71:
72: }
|