Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #13960
| From | Peter Cheung <cmk128@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: JOutlookBar |
| Date | 2012-04-28 03:06 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <30272854.404.1335607614038.JavaMail.geo-discussion-forums@pbgg10> (permalink) |
| References | <33049662.264.1335479370702.JavaMail.geo-discussion-forums@pbcnk4> <15997725.898.1335482389670.JavaMail.geo-discussion-forums@pbbps5> <7588566.806.1335496661608.JavaMail.geo-discussion-forums@pbqv7> <GqAmr.21580$FQ1.19656@newsfe12.iad> <jnes9f$145$1@dont-email.me> |
markspace於 2012年4月28日星期六UTC+8上午3時33分00秒寫道: > On 4/27/2012 10:11 AM, Daniel Pitts wrote: > > > On 4/26/12 8:17 PM, Peter Cheung wrote: > >> I already set it to 1ms, but it still runs slowly. > >> > >> So the animation is not smooth. > > > > You're timer simply calls draw. Also, 1ms is really too fast, and will > > cause more harm than good. You should aim for closer to 30hz->60hz. Try > > around 33ms timer. > > > I happen to know a little about animation (graphics is a personal hobby > of mine). The gold standard in animation is 25 frames per second, or 40 > ms in between frames. > > However, as a practical matter, much lower frames rates are acceptable. > Some cheaper animation, like some of the early so-called > "japanimation," used as little as 4 or 6 frames per second in parts of > their work. > > I'd start at 250 ms. 1 ms will clearly overwhelm any normal desktop > system with too much work. Get 250 ms working, then see if it can be > improved. > > > > Ideally, the "work" for your animation should be done in the timer > > handler too (so that your state changes on the timer, not just a redraw). > > > This. > > Peter, what I've looked at in your code base is pretty bad. Most of it > is really ugly generated code. Nothing has comments. There's no test > harness that I saw. You need to slow down and write some code by hand, > try to understand what is really going on. One good class is better > than 100 cruddy classes, and it is certainly my impression that the > latter is what you have. I changed to use Runnable, animation become smooth now. I use Jigloo plugins to generate UI code, I am happy with that plugin and its generated code, so I would like to stay with it. thanks
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
JOutlookBar Peter Cheung <cmk128@gmail.com> - 2012-04-26 15:29 -0700
Re: JOutlookBar Lew <lewbloch@gmail.com> - 2012-04-26 16:19 -0700
Re: JOutlookBar Peter Cheung <cmk128@gmail.com> - 2012-04-26 20:17 -0700
Re: JOutlookBar Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-04-27 10:11 -0700
Re: JOutlookBar markspace <-@.> - 2012-04-27 12:33 -0700
Re: JOutlookBar Lew <lewbloch@gmail.com> - 2012-04-27 13:51 -0700
Re: JOutlookBar Peter Cheung <cmk128@gmail.com> - 2012-04-28 03:10 -0700
Re: JOutlookBar Arne Vajhøj <arne@vajhoej.dk> - 2012-04-28 18:03 -0400
Re: JOutlookBar Peter Cheung <cmk128@gmail.com> - 2012-04-28 03:06 -0700
Re: JOutlookBar Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-04-28 15:06 -0700
Re: JOutlookBar Lew <noone@lewscanon.com> - 2012-04-28 21:08 -0700
Re: JOutlookBar Peter Cheung <cmk128@gmail.com> - 2012-04-29 00:13 -0700
Re: JOutlookBar Peter Cheung <cmk128@gmail.com> - 2012-04-29 00:31 -0700
Re: JOutlookBar Lew <noone@lewscanon.com> - 2012-04-29 01:56 -0700
Re: JOutlookBar Peter Cheung <cmk128@gmail.com> - 2012-04-29 07:37 -0700
Re: JOutlookBar Patricia Shanahan <pats@acm.org> - 2012-04-29 07:51 -0700
Re: JOutlookBar Lew <noone@lewscanon.com> - 2012-04-29 12:01 -0700
Re: JOutlookBar Arne Vajhøj <arne@vajhoej.dk> - 2012-05-05 19:53 -0400
csiph-web