classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] FYI: JTable changeSelection and multiple selection impl


From: Robert Schuster
Subject: Re: [cp-patches] FYI: JTable changeSelection and multiple selection implementation
Date: Thu, 30 Jun 2005 23:50:28 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.8) Gecko/20050514

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I have a small performance suggestion for the class in this patch.

> @@ -131,7 +141,7 @@
>      public void mouseDragged(MouseEvent e) 
>      {
>        curr = new Point(e.getX(), e.getY());
> -      updateSelection();      
> +      updateSelection(e.isControlDown());      
>      }
>      public void mouseEntered(MouseEvent e) 
>      {
> @@ -146,7 +156,8 @@
>      {
>        begin = new Point(e.getX(), e.getY());
>        curr = new Point(e.getX(), e.getY());
> -      updateSelection();
> +      updateSelection(e.isControlDown());
> +      
The Point instantiations will IMHO happen very often. I would change the
 code in a way that 'curr' and 'begin' are just updated with the new
values of 'e' instead of creating a new instance every time.

Ok to prepare a patch for this?

cu
Robert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFCxGkkG9cfwmwwEtoRAuKcAJ9P6JV+PRiy8zCBbGkvqlylDLov6wCgiX2O
Tb1xJom+w1De8IcyLTYoAaw=
=rxSx
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]