|
From: Slava P. <sp...@gj...> - 2000-07-06 12:41:53
|
Matija Kejzar wrote: > > Hi. > > > > Hmmm, I noticed that too on my Pentium 200 MMX, 128 MB RAM, Sun JDK 1.3, > but > > > I just thought that Swing/JVM are at fault. Anyways, it wasn't that > bad/slow > > > so I just left it alone. The only thing that comes to me right now is > that > > > the rendering procedure might be too slow or too complicated - the table > > > renders directories, files and hidden files differently. Obviously, for > that > > > to work, it must check each file to see in which category it belongs. > Then > > > it checks if the file/directory/hidden file already is rendered the way > it > > > should be. Only if that returns false, the new rendering occurs. As you > can > > > see that is quite a lot of work that needs to be done before the > rendering > > > takes place. It might be the cause of the problem. I'll investigate it > > > further in the future. > > > (Btw, now that I think about that, shouldn't there be a way to turn > > > rendering off while scrolling occurs? I mean couldn't the table just > render > > > itself once the user's done scrolling it? If you know about a way to do > > > that, please let me know). > > > > Are you calling File.isHidden()/isDirectry() *each time* a table cell is > > painted? That could be slow. Maybe you should cache the information > somehow > > and only query the filesystem when actually loading a directory. > > Well you're proabobly right here. It seems that a JTable (or maybe > JScrollPane) calls its paint procedure repeatedly while user's scrolling it, > instead of only calling it when the user's done with the scrolling or the > table's data changes. I'll investigate this further. Yes, that is indeed the case. I suggest you store all data obtained from the filesystem in some sort of structure, and only use that structure when painting. > OK, that could make things easier for everyone I suppose. My Source Forge > name is 'mkejzar'. You've now been added to the project. Commit jEditCommander to cvs.jedit.sourceforge.net/plugins/jEditCommander, and also create a text file named /guidelines/README.jEditCommander stating if others may or may not commit changes to your plugin. Slava |