Re: What's the swing equivalent for Canvas?
From: Andrew Thompson (SeeMySites_at_www.invalid)
Date: 04/06/04
- Next message: Todd Corley: "Re: swing.properties full-spec, where we can find it?"
- Previous message: Manish Hatwalne: "JTable cell value"
- In reply to: King W.Wang: "Re: What's the swing equivalent for Canvas?"
- Next in thread: Babu Kalakrishnan: "Re: What's the swing equivalent for Canvas?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 06 Apr 2004 16:19:49 GMT
On 6 Apr 2004 06:03:10 -0700, King W.Wang wrote:
> king_wwang@yahoo.de (King W.Wang) wrote in message news:<51d6351d.0404020149.55de80f@posting.google.com>...
>> Andrew Thompson <SeeMySites@www.invalid> wrote in message news:<elt0mt6yb97m.1bnfpzpt1zqa0$.dlg@40tude.net>...
>>> you can find an example here..
>>>
>>> <http://www.physci.org/launcher.jsp#JAnimateFrame>
...
> I've read in your program
This is exasperating, I try very hard to
ensure all materials at my site/s are
correctly attributed.
For that reason, it was quite important to
me to add @author tags straight from the
JDoc comments, so that I could include them
on the page with the link.
But nobody notices them!
> ..and found that the grid is
> painted each time when the balls are moved. Certainly
> it's easy to do so for your program, since the grid
> are painted with 2 for loops.
Yes, it is a bit hackish.
(And yes, that is a part I _did_ write).
>..But if the picture is
> more complicated, (e.g. a map, which is painted after
> complex calculation,) it would be inefficient.
I am not sure, perhaps some painting Guru
could correct me if I'm wrong..
I had considered what you mentioned, and
was thinking of approaching more complex
rendering like this..
a) declare a Graphics object as a class attribute.
Graphics complexBG;
b) each time you enter the 'drawGrid' method,
check if the attibute is null, it it is (1st time
only) draw everything you need to on the current one,
then Graphics.create on the current one..
complexBG = g.create();
c) use the reverse at the end of the method,
once the complexBG is not null, and is drawn..
g = complexBG.create();
This may, or may not, work. If it does,
it will only draw the complex bit once.
HTH
-- Andrew Thompson http://www.PhySci.org/ Open-source software suite http://www.PhySci.org/codes/ Web & IT Help http://www.1point1C.org/ Science & Technology
- Next message: Todd Corley: "Re: swing.properties full-spec, where we can find it?"
- Previous message: Manish Hatwalne: "JTable cell value"
- In reply to: King W.Wang: "Re: What's the swing equivalent for Canvas?"
- Next in thread: Babu Kalakrishnan: "Re: What's the swing equivalent for Canvas?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|