Ignore:
Timestamp:
08/30/12 14:05:47 (12 years ago)
Author:
pharms
Message:
  • moved target correction of key events regarding the current keyboard focus to a dedicated command
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/manager/TaskTreeManager.java

    r655 r710  
    44 
    55import de.ugoe.cs.quest.eventcore.Event; 
    6 import de.ugoe.cs.quest.eventcore.IEventTarget; 
    7 import de.ugoe.cs.quest.eventcore.gui.KeyInteraction; 
    86import de.ugoe.cs.quest.eventcore.gui.KeyboardFocusChange; 
    97import de.ugoe.cs.quest.tasktrees.treeifc.IEventTask; 
     
    4139    private ISequence rootSequence; 
    4240 
    43     /** */ 
    44     private IEventTarget currentKeyboardFocusGUIElement; 
    45  
    4641    /** 
    4742     * TODO: comment 
     
    5651     */ 
    5752    public void handleNewEvent(Event event) { 
    58         if (event.getType() instanceof KeyInteraction) { 
    59             if (currentKeyboardFocusGUIElement == null) { 
    60                 currentKeyboardFocusGUIElement = event.getTarget(); 
    61             } 
    62  
    63             addEventTask 
    64               (taskTreeNodeFactory.createNewEventTask 
    65                  (event.getType(), currentKeyboardFocusGUIElement)); 
    66         } 
    67         else { 
    68             addEventTask 
    69               (taskTreeNodeFactory.createNewEventTask(event.getType(), event.getTarget())); 
    70         } 
     53        addEventTask(taskTreeNodeFactory.createNewEventTask(event.getType(), event.getTarget())); 
    7154    } 
    7255 
     
    9881     */ 
    9982    private void handleEventTask(IEventTask eventTask) { 
    100         if (eventTask.getEventType() instanceof KeyboardFocusChange) { 
    101             currentKeyboardFocusGUIElement = eventTask.getEventTarget(); 
    102         } 
    103         else { 
    104             LOG.info("handling event task \"" + eventTask + "\""); 
    105             addTaskToSequence(eventTask, currentKeyboardFocusGUIElement); 
     83        if (!(eventTask.getEventType() instanceof KeyboardFocusChange)) { 
     84            LOG.info("handling interaction event task \"" + eventTask + "\""); 
     85            addTaskToSequence(eventTask); 
    10686        } 
    10787    } 
     
    11090     * 
    11191     */ 
    112     private void addTaskToSequence(ITaskTreeNode task, IEventTarget currentKeyboardFocusGUIElement) 
     92    private void addTaskToSequence(ITaskTreeNode task) 
    11393    { 
    11494        taskTreeBuilder.addChild(rootSequence, task); 
Note: See TracChangeset for help on using the changeset viewer.