Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » eRCP » eSWT -- MouseEvents(Atomocity during processing of mouse events -- S60 5th Ed.)
icon5.gif  eSWT -- MouseEvents [message #519788] Wed, 10 March 2010 00:33 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: March 2010
Junior Member
On S60 5th Edition eSWT SDK I want to know that if one is guarenteed that while services mouseevent another will not happen while I am servicing event?
For example;
public class Fubar implements MouseListener, MouseEventListener {
    private Point mouseLoc = new Point(-1,-1);

    public void mouseDoubleClick(MouseEvent e){
    }
    public void mouseDown(MouseEvent e)
    {
        mouseLoc.x = e.x;
        mouseLoc.y = e.y;
        /* 
         * do other processing: 
         *  ANOTHER EVENT OCCUR AND CHANGE mouseLoc?
         */
    }
    public void mouseUp(MouseEvent e)
    {
        /* 
         * do other processing (maybe change mouseLoc): 
         *  ANOTHER EVENT OCCUR AND CHANGE mouseLoc?
         */
    }
    public void mouseMove(MouseEvent e)
    {
        /* 
         * do other processing (maybe change mouseLoc): 
         *  ANOTHER EVENT OCCUR AND CHANGE mouseLoc?
         */
    }
}
Am I ok as long as another mouseevent is not invoked while i am in one because need to use value. I thought about locks but if I don't need why bother.
Re: eSWT -- MouseEvents [message #540838 is a reply to message #519788] Thu, 17 June 2010 13:10 Go to previous message
Gorkem Ercan is currently offline Gorkem ErcanFriend
Messages: 166
Registered: July 2009
Senior Member
In eSWT all the UI access is limited to a single thread that is the UI thread. That means that all the listeners are also called on that same single thread. Since it is not possible for a thread to execute code pieces of code at the same time it is guaranteed that only a single event is serviced at a time.
--
Gorkem
Previous Topic:eSWT -- MouseEvents
Next Topic:help Mvc implementation very important
Goto Forum:
  


Current Time: Mon Dec 22 02:56:12 GMT 2014

Powered by FUDForum. Page generated in 0.01658 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software