Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Peter Cheung Newsgroups: comp.lang.java.programmer Subject: Re: JOutlookBar Date: Sat, 28 Apr 2012 03:06:54 -0700 (PDT) Organization: http://groups.google.com Lines: 52 Message-ID: <30272854.404.1335607614038.JavaMail.geo-discussion-forums@pbgg10> 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> NNTP-Posting-Host: 210.5.164.14 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1335607707 12440 127.0.0.1 (28 Apr 2012 10:08:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 28 Apr 2012 10:08:27 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=210.5.164.14; posting-account=10LjMwkAAAAVcy8G3B3qqGRpk0olXjxD User-Agent: G2/1.0 Xref: csiph.com comp.lang.java.programmer:13960 markspace=E6=96=BC 2012=E5=B9=B44=E6=9C=8828=E6=97=A5=E6=98=9F=E6=9C=9F=E5= =85=ADUTC+8=E4=B8=8A=E5=8D=883=E6=99=8233=E5=88=8600=E7=A7=92=E5=AF=AB=E9= =81=93=EF=BC=9A > On 4/27/2012 10:11 AM, Daniel Pitts wrote: >=20 > > 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. >=20 >=20 > > 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. >=20 >=20 > I happen to know a little about animation (graphics is a personal hobby= =20 > of mine). The gold standard in animation is 25 frames per second, or 40= =20 > ms in between frames. >=20 > However, as a practical matter, much lower frames rates are acceptable.= =20 > Some cheaper animation, like some of the early so-called=20 > "japanimation," used as little as 4 or 6 frames per second in parts of=20 > their work. >=20 > I'd start at 250 ms. 1 ms will clearly overwhelm any normal desktop=20 > system with too much work. Get 250 ms working, then see if it can be=20 > improved. >=20 >=20 > > 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= ). >=20 >=20 > This. >=20 > Peter, what I've looked at in your code base is pretty bad. Most of it= =20 > is really ugly generated code. Nothing has comments. There's no test=20 > harness that I saw. You need to slow down and write some code by hand,= =20 > try to understand what is really going on. One good class is better=20 > than 100 cruddy classes, and it is certainly my impression that the=20 > latter is what you have. I changed to use Runnable, animation become smooth now.=20 I use Jigloo plugins to generate UI code, I am happy with that plugin and i= ts generated code, so I would like to stay with it. thanks