I'm not entirely sure I understand the question... but it sounds like you need to remember all the drawn graphics as a data structure. When you change something, you need to figure out the rectangle that completely encloses the changed region, and then redraw all of your drawn graphics that intersect that rectangle, in the correct "back to front" order.
If it's of interest, I've worked on a package that does this, even if you don't use it as-is you may find some of it useful, the license is fairly liberal: http://www.gigascale.org/diva/ JohnR > -----Original Message----- > From: Discussion list for Java 2D API > [mailto:JAVA2D-INTEREST@;JAVA.SUN.COM]On Behalf Of Abhishek Banugariya > Sent: Wednesday, October 16, 2002 10:00 PM > To: [EMAIL PROTECTED] > Subject: Re: [JAVA2D] JLayeredPane Layers with Canvas > > > my painting line is on the canvas . Yes that i can understand, infact i have already >implemented > that(detecting the point on line and all those stuff). The problem is repaint() >method. Because if you change > the stroke of a particular line then again u have to repaint whole drawing , so >for improvement i have > override update() method. what i am doing is for highlighting end points i am >drawing one circle around that > point. now if i go through update method then it will draw that circle without >flicker , now suppose mouse is > moved from the end point so i have to remove that drawn circle , if i draw another >circle at same place whose > color is same as background color of the canvas then it is also affecting the drawn >lines. > > > abhishek > > > > > > > > --- Ritesh Basatwar <[EMAIL PROTECTED]> wrote: > > Hi, > > I suppose ur painiting line on Panel, add mouse > > listener to that panel and > > in mouseMoved event track if intersecting any line > > and if it is > > intersecting, make that line's Stroke to thick or > > what ever you want. > > As far as my knowladge, you don't have to use > > layered pane, just while > > painitng you can change required line's stroke. > > Hope this clears your question. > > > > regards, > > Ritesh > > > > --------------------------------- > > Ritesh Basatwar > > Orillion India Software Pvt Ltd > > Vanenburg IT Park > > E-4,Plot No.17 > > Madhapur, > > Hyderabad-500033 (A.P) > > Tel (R): 3413762 > > (M): 98480 75967 > > --------------------------------- > > > > > > > > ----- Original Message ----- > > From: "Abhishek Banugariya" > > <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Thursday, October 17, 2002 9:31 AM > > Subject: [JAVA2D] JLayeredPane Layers with Canvas > > > > > > > Hi All > > > i am new with the graphics programming. I want > > to highlight the object > > on the canvas when mouse pointer comes on the > > object. e.g. if mouse comes on > > the end point of a particualr Line2D then i want to > > highlight that point, > > similarly if mouse comes anywhere on the line2D then > > i want to highlight > > that line. Now what i am thinking is if i go for > > layers then my program will > > be faster , one layer will be used for highlighting > > the objects,one for > > original drawing etc. > > > I am planning to use canvases with JLayeredPane > > for the layers, but for > > that my canvas should be tranparent. please guide me > > is there any other > > approach for the same or how generally people are > > implementing such > > mouseover effects. > > > > > > > > > Abhishek > > > > > > > > =========================================================================== > > > To unsubscribe, send email to > > [EMAIL PROTECTED] and include in the > > body > > > of the message "signoff JAVA2D-INTEREST". For > > general help, send email to > > > [EMAIL PROTECTED] and include in the body of > > the message "help". > > > > =========================================================================== > > To unsubscribe, send email to [EMAIL PROTECTED] > > and include in the body > > of the message "signoff JAVA2D-INTEREST". For > > general help, send email to > > [EMAIL PROTECTED] and include in the body of the > > message "help". > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff JAVA2D-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
