Ignore:
Timestamp:
09/02/14 15:46:57 (10 years ago)
Author:
dmay
Message:

rudimentary mouse drag support, this seems to require a lot of pixel precision that is not there currently

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java

    r1713 r1714  
    4646 
    4747    public StructureNode(String type) { 
    48         content = "<StructureElement class=\"jacareto.struct." + type + "\">"; 
     48        setContent(type); 
    4949        children = new ArrayList<StructureNode>(); 
    5050    } 
     
    5353        content = "<Recordable ref=\"" + (nextRef++) + "\" />"; 
    5454        children = new ArrayList<StructureNode>(); 
     55    } 
     56 
     57    public void setContent(String type) { 
     58        content = "<StructureElement class=\"jacareto.struct." + type + "\">"; 
    5559    } 
    5660 
     
    224228                Event event = eventIter.next(); 
    225229 
     230                System.out.println(event.getType()); 
     231                System.out.println(event.getTarget()); 
     232                System.out.println("---"); 
     233 
    226234                if (event.getType() instanceof MouseButtonDown) { 
    227235                    lastKeySequenceEvent = null; 
     236                    checkIfMouseDragged(); 
    228237 
    229238                    lastMouseClickEvent = new StructureNode("MouseClick"); 
     
    255264 
    256265                        lastFocusChangeEvent = null; 
     266                        lastMouseClickEvent = null; 
    257267                    } 
    258268                } 
     
    263273                } 
    264274                else if (event.getType() instanceof KeyPressed) { 
     275                    checkIfMouseDragged(); 
     276 
    265277                    if (lastKeySequenceEvent == null) { 
    266278                        lastKeySequenceEvent = structure.add("KeySequence"); 
     
    270282                } 
    271283                else if (event.getType() instanceof KeyReleased) { 
     284                    checkIfMouseDragged(); 
     285 
    272286                    writeKeyEvent(writer, event, 402); 
    273287                } 
    274288            } 
     289        } 
     290    } 
     291 
     292    private void checkIfMouseDragged() { 
     293        if (lastMouseClickEvent != null) { 
     294            // this was not really a click, just a drag 
     295            lastMouseClickEvent.setContent("MouseDrag"); 
     296            structure.children.add(lastMouseClickEvent); 
     297            lastMouseClickEvent = null; 
    275298        } 
    276299    } 
Note: See TracChangeset for help on using the changeset viewer.