Ignore:
Timestamp:
08/31/12 09:57:46 (12 years ago)
Author:
pharms
Message:
  • now keyboard focus change events are discarded because they are implicitly included through the correction of the event targets.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/gui/KeyInteractionTargetCorrector.java

    r708 r719  
    1717 * to the GUI element having the current keyboard focus. The current keyboard focus is determined 
    1818 * either by keyboard focus events or by using the target of the first key interaction in the 
    19  * provided sequence sequence. 
     19 * provided sequence. Events changing the keyboard focus are discarded herewith. 
    2020 * </p> 
    2121 *  
     
    4141        List<Event> resultingSequence = new LinkedList<Event>(); 
    4242        IGUIElement currentKeyboardFocusGUIElement = null; 
    43         Event resultingEvent; 
    4443         
    4544        for (Event event : sequence) { 
    46             resultingEvent = null; 
    47              
    4845            if (event.getTarget() instanceof IGUIElement) { 
    4946                if (event.getType() instanceof KeyboardFocusChange) { 
    5047                    currentKeyboardFocusGUIElement = (IGUIElement) event.getTarget(); 
     48                    event = null; 
    5149                } 
    5250                else if (event.getType() instanceof KeyInteraction) { 
     
    5654                     
    5755                    if (!currentKeyboardFocusGUIElement.equals(event.getTarget())) { 
    58                         resultingEvent = new Event(event.getType(), currentKeyboardFocusGUIElement); 
     56                        event = new Event(event.getType(), currentKeyboardFocusGUIElement); 
    5957                    } 
    6058                } 
    6159            } 
    6260             
    63             if (resultingEvent != null) { 
    64                 resultingSequence.add(resultingEvent); 
    65             } 
    66             else { 
     61            if (event != null) { 
    6762                resultingSequence.add(event); 
    6863            } 
Note: See TracChangeset for help on using the changeset viewer.