users
[Top] [All Lists]

Re: [cinjug-users] tracing a path

To: James Carman <james@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: [cinjug-users] tracing a path
From: Michael Schneider <michaelschneider@xxxxxxxx>
Date: Tue, 15 Mar 2005 11:00:08 -0500
Cc: 'Jason Kretzer' <jrkretzer@xxxxxxxxx>, 'Chris McMahan' <cmcmahan@xxxxxxx>, 'Amol Deshmukh' <adeshmukh@xxxxxxxxxxxxxx>, users@xxxxxxxxxx
Delivered-to: mailing list users@cinjug.org
In-reply-to: <000901c52976$79270fd0$30b2769b@carmani600m>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <000901c52976$79270fd0$30b2769b@carmani600m>
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
Path seems to be a good solution, Another option is to store current equations, and replay on repaint.




James Carman wrote:

So, you need to remember the points (or the path).  That's why I suggested
the GeneralPath solution.

-----Original Message-----
From: Jason Kretzer [mailto:jrkretzer@xxxxxxxxx] Sent: Tuesday, March 15, 2005 10:41 AM
To: Chris McMahan; Amol Deshmukh
Cc: 'Jason Kretzer'; users@xxxxxxxxxx
Subject: RE: [cinjug-users] tracing a path



I agree, I have tested this out and it works great! I just need to put some type of focus listener on the frame. When it loses focus via being covered by another window or minimization, the previously painted points disappear. It then continues drawing and leaving a line where it left off.

Thanks for the great help!

-Jason


--- Chris McMahan <cmcmahan@xxxxxxx> wrote:


That's a very nice solution!

- Chris

Amol Deshmukh writes:


-----Original Message-----
From: Jason Kretzer


[mailto:jrkretzer@xxxxxxxxx]


Sent: Tuesday, March 15, 2005 9:44 AM
To: users@xxxxxxxxxx
Subject: Re: [cinjug-users] tracing a path
...
the points to stay put? After I draw a point


and


call
repaint on the JComponent toshow that point,


the


point
that I drew just before that disappears.
...


you may want to consider using

   repaint(int x,int y,int width,int height)

instead of repaint(). Then redraw the set of points


in only


that portion of rectangle. So every time the ball


moves,


you only update a small rectanlgular portion of the


Component instead of redrawing all the points.


More help at :



http://java.sun.com/products/jfc/tsc/articles/painting/index.html


HTH,
~ amol


--
   ================================
   Chris McMahan | cmcmahan@xxxxxxx
   ================================







__________________________________ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs


---------
You may unsubscribe from this mailing list
by sending a blank email addressed to: users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx



---------
You may unsubscribe from this mailing list
by sending a blank email addressed to:
users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx






<Prev in Thread] Current Thread [Next in Thread>