/** * Make sure that the internal behaviour lists are up to date. For this, we keep track the * modification count of {@link #inputMap} and {@link #behaviourMap}. If expected mod counts are * not matched, call {@link #updateInternalMaps()} to rebuild the internal behaviour lists. */ private synchronized void update() { final int imc = inputMap.modCount(); final int bmc = behaviourMap.modCount(); if (imc != inputMapExpectedModCount || bmc != behaviourMapExpectedModCount) { inputMapExpectedModCount = imc; behaviourMapExpectedModCount = bmc; updateInternalMaps(); } }
public void setInputMap(final InputTriggerMap inputMap) { this.inputMap = inputMap; inputMapExpectedModCount = inputMap.modCount() - 1; }