Menu

ClassLoader

2002-06-07
2002-06-07
  • Kirill Kalishev

    Kirill Kalishev - 2002-06-07

    Matthew,

    I just got back to look at your code again :)

    What I can gather from tests and one comment that you left: you want jfc & junit classes be loaded by the system classloader, but the rest you want to load yourself, every time from the disk. As far as I can guess, by this, you want the user to be able to recomplile his classes on-the-fly. Am I right?

    Kirill

     
    • Kirill Kalishev

      Kirill Kalishev - 2002-06-07

      I've just realized that the point is not only in the ClassLoader :) So, sorry for naming this thread like this...

      When loaded by the system class loader, my applications now appears on the screen... So this is still a problem for me. For now I haven't looked into it enough to understand why it is so...

      Anyway, there is a bigger problem.

      What I found is that pounder cannot replay mouse events that were actually d'n'd events. I noticed that you generate events by hand and then post them into the dispatching queue. Perhaps, if you used AWT Robot instead, it would be simpler.

      We use Robot and it works great. I don't know why, but guys who work on JFCUnit also don't like Robot. They block the AWT thread and generate events themselves... We just use robot and a very simple utility, which is called Waiter that hangs on an event (that the user defines) with timeout clause. It solves all problems with synchronization.

      Thoughts on d'n'd in pounder?

      Kirill

       
      • Matthew Pekar

        Matthew Pekar - 2002-06-07

        I have a guess on the ClassLoader issue.  A class of the same type may get loaded twice.  For example, say there is a Foo object loaded from foo.jar, and it gets loaded again by Pounder.  They are different classes and errors will occur.  Do you place a jar file AND build directory in your classpath?

        As for dnd, I think I need to detect DragGestureEvent, DragSourceDragEvent, DragSourceDropEvent, DropTargetDragEvent, and DropTargetDropEvent.  I had thought the mouse events would take care of this but I guess not.

        As for Robot, I don't dislike it.  ;)  It simply has some limitations that make it unusable for what I had planned.  It uses absolute coordinates, which will almost definitely fail when run on different platforms and desktops.  However, I could use its waitForIdle() method.  I currently have my own, but theirs is probably better.

        Thanks for the feedback.

         
        • Matthew Pekar

          Matthew Pekar - 2002-06-07

          I take that back, Robot could be used to post the key and mouse events.  Are you able to use Robot mouse events to handle dnd?

           
    • Kirill Kalishev

      Kirill Kalishev - 2002-06-07

      I have only one dir with classes... so I need to look at the more.

      We use Robot's methods to repoduce d'n'd and all events that only exist. Very simple...

      Is that an issue, that on diffrent platfroms Robots will work differently? Does SwingUtilities.convertPointToScreen work inproperly on different platfroms?

      Kirill

       
      • Matthew Pekar

        Matthew Pekar - 2002-06-07

        No, I must have misread the Robot class the first time I looked through it.  I'm going to start writing some tests for dnd and see what the problem is.

        I'm also planning on including an option to use the system class loader.  However, I'd still really like to know what is causing the errors because it's a feature I want working well.

         

Log in to post a comment.