25 |
|
|
26 |
we should call a new api which can be switch to debug the caller, like: :: |
we should call a new api which can be switch to debug the caller, like: :: |
27 |
|
|
28 |
AbstractUpdateManager.chg(String caller) |
AnimationAPI.chg(String caller) |
29 |
|
|
30 |
|
|
31 |
Issues |
Issues |
32 |
====== |
====== |
33 |
|
|
34 |
How come we make sure that none other object call the public method |
ISSUE: How come we make sure that none other object call the public method |
35 |
AbstractUpdateManager.chg()? |
AbstractUpdateManager.chg()? |
36 |
|
|
37 |
RESOLVED: Use the source, Luke. Yes, we have source and we can |
RESOLVED: Use the source, Luke. Yes, we have source and we can |
39 |
this is easy to convert as a simple test. |
this is easy to convert as a simple test. |
40 |
|
|
41 |
|
|
42 |
|
ISSUE: What about requesting a longer or shorter animation time, |
43 |
|
or a non-standardanimation curve (i.e. linear instead of the |
44 |
|
vibrating exponential)? |
45 |
|
Should this be covered by the animation API or bypassed to |
46 |
|
AbstractUpdateManager? If there's a particular change that |
47 |
|
should happen with a faster animation time (e.g. a menu closing) |
48 |
|
|
49 |
|
RESOLVED: Later. It's easy to add this feature into AnimationAPI: |
50 |
|
a) when we know issues with it, |
51 |
|
b) we have prototype of it and |
52 |
|
c) we have used the prototype in real program. |
53 |
|
|
54 |
|
All features in this peg are here because they are used in real |
55 |
|
programs and them are well known already. |
56 |
|
|
57 |
|
|
58 |
|
ISSUE: If we don't want people to see AbstractUpdateManager |
59 |
|
should we hide some of its methods to package private? |
60 |
|
|
61 |
|
Small demos might still need these methods. |
62 |
|
Otoh, safer the better. |
63 |
|
|
64 |
|
ISSUE: Should the default be to animate or not to animate? |
65 |
|
|
66 |
|
RESOLVED: chg() without update method set should throw an error. |
67 |
|
Explicity is better and it makes code cleaner somehow. |
68 |
|
|
69 |
|
|
70 |
Changes |
Changes |
71 |
======= |
======= |
72 |
|
|
73 |
We create a new animation layer which encapsulates |
We create a new animation layer which encapsulates |
74 |
AbstractUpdateManager method calls, i.e, chg() and setNoAnimation(). |
AbstractUpdateManager method calls, i.e, chg() and setNoAnimation(). |
75 |
The new layer is also the only one that takes care of reusing VobScenes. |
The new layer is also the only one that takes care of reusing VobScenes. |
76 |
*No other objects are allowed to call AbstractUpdateManager.chg() in |
*No other objects are allowed to call these methods in |
77 |
the whole source tree!* |
the source tree, except small demos.* |
78 |
|
|
79 |
Let us define the following interface: :: |
Let's define the following interface: :: |
80 |
|
|
81 |
package org.nongnu.libvob.view; |
package org.nongnu.libvob.view; |
82 |
import org.nongnu.libvob.VobScene; |
import org.nongnu.libvob.VobScene; |
101 |
*/ |
*/ |
102 |
public interface AnimationAPI { |
public interface AnimationAPI { |
103 |
|
|
104 |
/** Set the update method in next change to reuse of the previous vobscene. |
/** Set the update method in next change to reuse |
105 |
|
* of the previous vobscene. |
106 |
* There's no animation between this and next frame, |
* There's no animation between this and next frame, |
107 |
* only coordinate parameter changes are notable, |
* only coordinate parameter changes are notable, |
108 |
* which indeed can also be like animation. |
* which indeed can also be like animation. |
113 |
void reuseVS(String caller); |
void reuseVS(String caller); |
114 |
|
|
115 |
|
|
116 |
/** Set the update method in next change to animation/interpolation action between vobmatcher keys |
/** Set the update method in next change to animation/interpolation |
117 |
|
* action between vobmatcher keys |
118 |
* <p> |
* <p> |
119 |
* If the update is set with other update set method after this set but |
* If the update is set with other update set method after this set but |
120 |
* before change, this set is obsoleted. |
* before change, this set is obsoleted. |
124 |
|
|
125 |
|
|
126 |
/** Change to next frame. |
/** Change to next frame. |
127 |
|
* Throws an Error if no update method set. |
128 |
*/ |
*/ |
129 |
void chg(String caller); |
void chg(String caller); |
130 |
|
|
131 |
|
|
132 |
/** Shorthand for methods <code>reuseVS</code> and instant <code>chg</code>. |
/** Shorthand for methods <code>reuseVS</code> and |
133 |
|
* instant <code>chg</code>. |
134 |
*/ |
*/ |
135 |
void chgReusingVS(String caller); |
void chgReusingVS(String caller); |
136 |
|
|
137 |
/** Shorthand for methods <code>animation</code> and instant <code>chg</code>. |
/** Shorthand for methods <code>animation</code> and |
138 |
|
* instant <code>chg</code>. |
139 |
*/ |
*/ |
140 |
void chgWithAnimation(String caller); |
void chgWithAnimation(String caller); |
141 |
|
|