Ignore:
Timestamp:
04/11/14 11:21:45 (10 years ago)
Author:
pharms
Message:
  • state of the HCSE 2014 Paper. An appropriate tag will follow.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityDefectDescription.java

    r1335 r1493  
    1818import java.io.InputStream; 
    1919import java.util.ArrayList; 
     20import java.util.Collection; 
    2021import java.util.List; 
    2122import java.util.Map; 
     
    3334public enum UsabilityDefectDescription { 
    3435     
    35     SCROLL_REQUIRED, 
     36    INEFFICIENT_ACTIONS, 
    3637    TEXT_FIELD_INPUT_RATIO, 
    3738    TEXT_FIELD_INPUT_REPETITIONS, 
    38     TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO; 
     39    TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO, 
     40    COOCCURENCE_SUCCEED, 
     41    COOCCURENCE_PRECED, 
     42    HIGH_EVENT_COVERAGE, 
     43    HIGH_TARGET_DISTANCE, 
     44    MISSING_FEEDBACK, 
     45    UNUSED_GUI_ELEMENTS; 
    3946 
    4047    /** */ 
     
    122129     *  
    123130     */ 
    124     public String toString(Map<String, String> parameters) throws IllegalArgumentException { 
     131    public String toString(Map<String, Object> parameters) throws IllegalArgumentException { 
    125132        StringBuffer result = new StringBuffer(); 
    126133 
     
    131138 
    132139            if (fragment instanceof ParameterFragment) { 
    133                 String value = null; 
     140                Object value = null; 
    134141                if (parameters != null) { 
    135142                    value = parameters.get(((ParameterFragment) fragment).getParameterName()); 
     
    137144 
    138145                if (value != null) { 
    139                     result.append(value); 
     146                    if (value instanceof Collection<?>) { 
     147                        int counter = 1; 
     148                        for (Object elem : ((Collection<?>) value)) { 
     149                            result.append('\n'); 
     150                            result.append(counter++); 
     151                            result.append(".: "); 
     152                            result.append(elem); 
     153                        } 
     154                    } 
     155                    else { 
     156                        result.append(value.toString()); 
     157                    } 
    140158                } 
    141159                else { 
     
    154172    } 
    155173 
     174    /** 
     175     *  
     176     */ 
     177    public List<Object> toFragmentList(Map<String, Object> parameters) 
     178        throws IllegalArgumentException 
     179    { 
     180        List<Object> result = new ArrayList<Object>(); 
     181 
     182        for (Object fragment : defectDescription.getTextFragmentOrParameterFragment()) { 
     183            if (fragment instanceof ParameterFragment) { 
     184                Object value = null; 
     185                if (parameters != null) { 
     186                    value = parameters.get(((ParameterFragment) fragment).getParameterName()); 
     187                } 
     188 
     189                if (value != null) { 
     190                    result.add(value); 
     191                } 
     192                else { 
     193                    throw new IllegalArgumentException 
     194                        ("required parameter \"" + 
     195                         ((ParameterFragment) fragment).getParameterName() + 
     196                         "\" for usability defect description " + this.name() + " not provided"); 
     197                } 
     198            } 
     199            else { 
     200                result.add(getFragmentString(fragment)); 
     201            } 
     202        } 
     203 
     204        return result; 
     205    } 
     206     
     207    /** 
     208     *  
     209     */ 
     210    public String getBriefDescription() { 
     211        return defectDescription.briefText; 
     212    } 
     213 
    156214    /* 
    157215     * (non-Javadoc) 
Note: See TracChangeset for help on using the changeset viewer.