Return-Path: Delivered-To: apmail-xmlgraphics-batik-users-archive@www.apache.org Received: (qmail 17079 invoked from network); 9 Apr 2006 11:15:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Apr 2006 11:15:14 -0000 Received: (qmail 41514 invoked by uid 500); 9 Apr 2006 11:15:13 -0000 Delivered-To: apmail-xmlgraphics-batik-users-archive@xmlgraphics.apache.org Received: (qmail 41505 invoked by uid 500); 9 Apr 2006 11:15:13 -0000 Mailing-List: contact batik-users-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: batik-users@xmlgraphics.apache.org Delivered-To: mailing list batik-users@xmlgraphics.apache.org Received: (qmail 41494 invoked by uid 99); 9 Apr 2006 11:15:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Apr 2006 04:15:13 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=DNS_FROM_RFC_POST,NO_REAL_NAME,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of rafiqy@blueyonder.co.uk designates 195.188.213.6 as permitted sender) Received: from [195.188.213.6] (HELO smtp-out3.blueyonder.co.uk) (195.188.213.6) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Apr 2006 04:15:12 -0700 Received: from [172.23.170.141] (helo=anti-virus02-08) by smtp-out3.blueyonder.co.uk with smtp (Exim 4.52) id 1FSXsZ-00083f-Hq for batik-users@xmlgraphics.apache.org; Sun, 09 Apr 2006 12:14:51 +0100 Received: from [195.188.53.231] (helo=webmail.blueyonder.co.uk) by asmtp-out2.blueyonder.co.uk with esmtp (Exim 4.52) id 1FSXsZ-0002P9-4i for batik-users@xmlgraphics.apache.org; Sun, 09 Apr 2006 12:14:51 +0100 Received: from 195.188.213.34 (SquirrelMail authenticated user); by webmail.blueyonder.co.uk with HTTP; Sun, 9 Apr 2006 12:14:51 +0100 (BST) Message-ID: <32111.195.188.213.34.1144581291.squirrel@195.188.213.34> Date: Sun, 9 Apr 2006 12:14:51 +0100 (BST) Subject: RE: Dragable rectangle - Resent From: rafiqy@blueyonder.co.uk To: batik-users@xmlgraphics.apache.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Thomas, I'm not sure how to assign my button to AbstractZoomInteractor, i.e. say I have a 'button2' and when the user clicks it provokes the AbsractZoomIneractor() class ...so, is my code going to be very similar to the one below only changes are: ie.getID() == MouseEvent.MOUSE_PRESSED && (mods & InputEvent.BUTTON1_MASK) != 0 && (mods & InputEvent.button2) != 0; ???? pls advice yasmin > Hi Yasmin, > > You just need to create a new subclass of > AbstractZoomInteractor.startInteraction, the one in > the Canvas has: > > protected Interactor zoomInteractor = new AbstractZoomInteractor() { > public boolean startInteraction(InputEvent ie) { > int mods = ie.getModifiers(); > return > ie.getID() == MouseEvent.MOUSE_PRESSED && > (mods & InputEvent.BUTTON1_MASK) != 0 && > (mods & InputEvent.CTRL_MASK) != 0; > } > }; > > You will want to check that it's mouse down and that the user has > clicked your button, instead of just checking if it is a button1 with ctrl down. > > rafiqy@blueyonder.co.uk wrote on 04/08/2006 06:39:16 PM: > >> >> Hi Javid, >> >> Yes, the JSVGCanvas already does what I want to do, you know when u > wantto >> select an area on ur canvas to zoomIn, you do that by holding the 'CTRL > & >> MouseDown' ...well, I want to achieve the same by assigning this to a button, so the user can just click the button and then drag a rectangle > to >> select the area ...so, that my UI is user friendly, assuming that the > user >> does not know about the 'Key' shortCuts... hope that make sense :( >> >> yasmin >> >> >> > Yasmin, >> > What do you mean by assign it to JButton? To me, it looks like > whatever >> > you >> > are trying to do JSVGCanvas already does that. >> > Can you explain a bit more? >> > >> > Javid >> > >> > -----Original Message----- >> > From: rafiqy@blueyonder.co.uk [mailto:rafiqy@blueyonder.co.uk] Sent: Saturday, April 08, 2006 3:24 PM >> > To: batik-users@xmlgraphics.apache.org >> > Subject: Dragable rectangle >> > >> > >> > Hi there, >> > >> > I'm trying to create a dragable rectangle on my JSVGCanvas so that the area that is selected within the rectangle is zoomed-in, has anyone > got >> > any ideas how I should go about doing this ...my thoughts are that I create a mouseListener, to listen for mouseDown, whilst the mouse is > kept >> > down to drag the rectangle until the mouseRelease event and upon mouseRelease the svgMap then zoomIn to the selected area... in effect > I'm >> > trying to replicate the key-board short cut 'CTRL_MouseDown' ...and > assign >> > it to a Jbutton. >> > >> > Pls advice :( >> > >> > Thanx >> > >> > yasmin >> > >> > >> > >> > --------------------------------------------------------------------- To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: > batik-users-help@xmlgraphics.apache.org >> > >> > >> > --------------------------------------------------------------------- To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: > batik-users-help@xmlgraphics.apache.org >> > >> > >> > >> >> >> >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org >> > > > --------------------------------------------------------------------- To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org