|
Replies:
2
-
Last Post:
Jun 17, 2009 6:42 AM
by: seik
|
|
|
|
|
|
|
animation problem
Posted:
Jun 16, 2009 11:53 AM
|
|
|
hello guys! seik is here with new questions for you!(again...T_T) I'm making an app to show videos. If it was only to play and stop it would be great but NOOOO, we need to make it more complete.....(for boss hapiness and my despair lol) So after a lot of study and pratice (....2 days is alot to me) I finally was able to make the bar that shows the progress of the video ^^.....with a small problem.....it only updates itself when I change focus on the form....T_T
Finally, after lots of useless talk, HERE IS THE QUESTION: How can I animate a component "all the time" instand of "only when I change focus" I mean: I want it(the bar) to repaint always (it could be every 1 sec or so), without the need for the user(who would be watching the video) to press a button(to change focus/update the bar)
The Bar: -It extends Component -Its constructor creates a Thread that repeats itself while the component isVisible(), inside it, sets a DirtyRegion on my BarComponent and calls repaint <-not sure if its the best option..... -Has an overwriten method paint(), where I draw it(the bar);
If you didn't understand something, please ask, if you did understand and knows the answer.....please please please answer ^^ cya later
|
|
|
|
|
|
|
Re: animation problem
Posted:
Jun 16, 2009 12:44 PM
in response to: seik
|
|
|
Look into Animation
Here's a possible solution:
Ther form has registerAnimated() and deregisterAnimated() you can call in the form's initComponent() and deinitialize()
If your Bar implements Animation, then you can register it.
Next have a thread set a percentage field in the bar (percentage you want painted)
The bar's paint() method uses the percentage field to fill a rectangle.
Hope that makes sense.
|
|
|
|
|
|
|
|
Re: animation problem
Posted:
Jun 17, 2009 6:42 AM
in response to: thisisnotme
|
|
|
I implemented the animation on my component and registered it in the form as animated, but it wasn't working properly....then I overwrited the method animate() to return true, and fixed the problem ^^ Thanks for the help ^^
|
|
|
|
|