/** * Adds a preconfigured set of mappings in Properties object * form where the names are dot notation "joystick"."axis/button" * and the values are the remapped component name. This calls * addMapping(stickName, sourceComponent, remap) for every property * that it is able to parse. */ public static void addMappings( Properties p ) { for( Map.Entry<Object,Object> e : p.entrySet() ) { String key = String.valueOf(e.getKey()).trim(); int split = key.lastIndexOf( '.' ); if( split < 0 ) { logger.log(Level.WARNING, "Skipping mapping:{0}", e); continue; } String stick = key.substring(0, split).trim(); String component = key.substring(split+1).trim(); String value = String.valueOf(e.getValue()).trim(); addMapping(stick, component, value); } }
/** * Adds a preconfigured set of mappings in Properties object * form where the names are dot notation "joystick"."axis/button" * and the values are the remapped component name. This calls * addMapping(stickName, sourceComponent, remap) for every property * that it is able to parse. */ public static void addMappings( Properties p ) { for( Map.Entry<Object,Object> e : p.entrySet() ) { String key = String.valueOf(e.getKey()).trim(); int split = key.lastIndexOf( '.' ); if( split < 0 ) { logger.log(Level.WARNING, "Skipping mapping:{0}", e); continue; } String stick = key.substring(0, split).trim(); String component = key.substring(split+1).trim(); String value = String.valueOf(e.getValue()).trim(); addMapping(stick, component, value); } }