/** * Adds a single Joystick axis or button remapping based on the * joystick's name and axis/button name. The "remap" value will be * used instead. */ public static void addMapping( String stickName, String sourceComponentId, String remapId ) { logger.log(Level.FINE, "addMapping(" + stickName + ", " + sourceComponentId + ", " + remapId + ")" ); getMappings(stickName, true).put( sourceComponentId, remapId ); }
/** * Returns the remapped version of the axis/button name if there * is a mapping for it otherwise it returns the original name. */ public static String remapComponent( String joystickName, String componentId ) { Map<String,String> map = getMappings(joystickName.trim(), false); if( map == null ) return componentId; if( !map.containsKey(componentId) ) return componentId; return map.get(componentId); }
/** * Returns a set of Joystick axis/button name remappings if they exist otherwise * it returns an empty map. */ public static Map<String,String> getJoystickMappings( String joystickName ) { Map<String,String> result = getMappings(joystickName.trim(), false); if( result == null ) return Collections.emptyMap(); return Collections.unmodifiableMap(result); }
/** * Adds a single Joystick axis or button remapping based on the * joystick's name and axis/button name. The "remap" value will be * used instead. */ public static void addMapping( String stickName, String sourceComponentId, String remapId ) { logger.log(Level.FINE, "addMapping(" + stickName + ", " + sourceComponentId + ", " + remapId + ")" ); getMappings(stickName, true).put( sourceComponentId, remapId ); }
/** * Returns a set of Joystick axis/button name remappings if they exist otherwise * it returns an empty map. */ public static Map<String,String> getJoystickMappings( String joystickName ) { Map<String,String> result = getMappings(joystickName.trim(), false); if( result == null ) return Collections.emptyMap(); return Collections.unmodifiableMap(result); }
/** * Returns the remapped version of the axis/button name if there * is a mapping for it otherwise it returns the original name. */ public static String remapComponent( String joystickName, String componentId ) { Map<String,String> map = getMappings(joystickName.trim(), false); if( map == null ) return componentId; if( !map.containsKey(componentId) ) return componentId; return map.get(componentId); }