Lines Matching refs:mapping

55  * The input manager has two concepts, a {@link Trigger} and a mapping.

57 * or a mouse axis. A mapping represents a link onto one or several triggers,
59 * mapping will be invoked. Any listeners registered to receive an event
60 * from the mapping will have an event raised.
162 Mapping mapping = maps.get(i);
163 ArrayList<InputListener> listeners = mapping.listeners;
168 ((ActionListener) listener).onAction(mapping.name, pressed, frameTPF);
237 Mapping mapping = maps.get(i);
238 ArrayList<InputListener> listeners = mapping.listeners;
244 ((AnalogListener) listener).onAnalog(mapping.name, value, frameTPF);
268 Mapping mapping = maps.get(i);
269 ArrayList<InputListener> listeners = mapping.listeners;
275 ((ActionListener) listener).onAction(mapping.name, true, frameTPF);
279 ((AnalogListener) listener).onAnalog(mapping.name, value, frameTPF);
466 * on the specified mapping names. When a mapping raises an event, the
475 * @param mappingNames The mapping names which the listener will receive
482 Mapping mapping = mappings.get(mappingName);
483 if (mapping == null) {
484 mapping = new Mapping(mappingName);
485 mappings.put(mappingName, mapping);
487 if (!mapping.listeners.contains(listener)) {
488 mapping.listeners.add(listener);
505 for (Mapping mapping : mappings.values()) {
506 mapping.listeners.remove(listener);
511 * Create a new mapping to the given triggers.
514 * The given mapping will be assigned to the given triggers, when
518 * @param mappingName The mapping name to assign.
519 * @param triggers The triggers to which the mapping is to be registered.
524 Mapping mapping = mappings.get(mappingName);
525 if (mapping == null) {
526 mapping = new Mapping(mappingName);
527 mappings.put(mappingName, mapping);
537 if (!names.contains(mapping)) {
538 names.add(mapping);
539 mapping.triggers.add(hash);
541 logger.log(Level.WARNING, "Attempted to add mapping \"{0}\" twice to trigger.", mappingName);
547 * Returns true if this InputManager has a mapping registered
550 * @param mappingName The mapping name to check.
560 * Deletes a mapping from receiving trigger events.
563 * The given mapping will no longer be assigned to receive trigger
566 * @param mappingName The mapping name to unregister.
571 Mapping mapping = mappings.remove(mappingName);
572 if (mapping == null) {
573 throw new IllegalArgumentException("Cannot find mapping: " + mappingName);
576 ArrayList<Integer> triggers = mapping.triggers;
580 maps.remove(mapping);
585 * Deletes a specific trigger registered to a mapping.
588 * The given mapping will no longer receive events raised by the
591 * @param mappingName The mapping name to cease receiving events from the
593 * @param trigger The trigger to no longer invoke events on the mapping.
596 Mapping mapping = mappings.get(mappingName);
597 if (mapping == null) {
598 throw new IllegalArgumentException("Cannot find mapping: " + mappingName);
602 maps.remove(mapping);
870 Mapping mapping = maps.get(i);
871 ArrayList<InputListener> listeners = mapping.listeners;
876 ((TouchListener) listener).onTouch(mapping.name, evt, frameTPF);