Ignore:
Timestamp:
09/03/12 12:05:42 (12 years ago)
Author:
sherbold
Message:
  • TextInput? events can now be configured to support a specific type of equality: Lexical, Syntactical, and Semantical
  • the command detextTestInputEvents now allows the definition of the equality of the generated TextInput? events (see above)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/commands/sequences/CMDdetectTextInputEvents.java

    r750 r751  
    1010import de.ugoe.cs.quest.SequenceInstanceOf; 
    1111import de.ugoe.cs.quest.eventcore.Event; 
     12import de.ugoe.cs.quest.eventcore.gui.TextInput.TextEquality; 
    1213import de.ugoe.cs.quest.eventcore.gui.TextInputDetector; 
    1314import de.ugoe.cs.util.console.Command; 
     15import de.ugoe.cs.util.console.Console; 
    1416import de.ugoe.cs.util.console.GlobalDataContainer; 
    1517 
     
    3133    @Override 
    3234    public String help() { 
    33         return "detectTextInputEvents <sequences> {<new sequences>}"; 
     35        return "detectTextInputEvents <sequences> {<new sequences>} {<textEqualityType>}"; 
    3436    } 
    3537 
     
    4446        String sequencesName; 
    4547        String newSequencesName; 
     48        String textEqualityTypeString = "LEXICAL"; 
    4649        try { 
    4750            sequencesName = (String) parameters.get(0); 
     
    5154            else { 
    5255                newSequencesName = sequencesName; 
     56            } 
     57            if( parameters.size() > 2) { 
     58                textEqualityTypeString = (String) parameters.get(2); 
    5359            } 
    5460        } 
     
    6773            return; 
    6874        } 
     75         
     76        TextEquality textEqualityType = null; 
     77        try { 
     78            textEqualityType = TextEquality.valueOf(textEqualityTypeString); 
     79        } 
     80        catch (IllegalArgumentException e) { 
     81            Console.printerrln("Invalid mode. Only LEXICAL, SYNTACTICAL, and SEMANTICAL are allowed values!"); 
     82            return; 
     83        } 
    6984 
    7085        sequences = (Collection<List<Event>>) dataObject; 
     
    7388        
    7489        for (List<Event> sequence : sequences) { 
    75             newSequences.add(new TextInputDetector().detectTextInputs(sequence)); 
     90            newSequences.add(new TextInputDetector(textEqualityType).detectTextInputs(sequence)); 
    7691        } 
    7792 
Note: See TracChangeset for help on using the changeset viewer.