2362N/A * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * <code>InputMap</code> provides a binding between an input event 0N/A * (currently only <code>KeyStroke</code>s are used) 0N/A * and an <code>Object</code>. <code>InputMap</code>s 0N/A * are usually used with an <code>ActionMap</code>, 0N/A * to determine an <code>Action</code> to perform 0N/A * when a key is pressed. 0N/A * An <code>InputMap</code> can have a parent 0N/A * that is searched for bindings not defined in the <code>InputMap</code>. 0N/A * <p>As with <code>ActionMap</code> if you create a cycle, eg: 0N/A * InputMap am = new InputMap(); 0N/A * InputMap bm = new InputMap(): 0N/A * some of the methods will cause a StackOverflowError to be thrown. 0N/A * @author Scott Violet 0N/A /** Handles the mapping between KeyStroke and Action name. */ 0N/A /** Parent that handles any bindings we don't contain. */ 0N/A * Creates an <code>InputMap</code> with no parent and no mappings. 0N/A * Sets this <code>InputMap</code>'s parent. 0N/A * @param map the <code>InputMap</code> that is the parent of this one 0N/A * Gets this <code>InputMap</code>'s parent. 0N/A * @return map the <code>InputMap</code> that is the parent of this one, 0N/A * or null if this <code>InputMap</code> has no parent 0N/A * Adds a binding for <code>keyStroke</code> to <code>actionMapKey</code>. 0N/A * If <code>actionMapKey</code> is null, this removes the current binding 0N/A * for <code>keyStroke</code>. 0N/A * Returns the binding for <code>keyStroke</code>, messaging the 0N/A * parent <code>InputMap</code> if the binding is not locally defined. 0N/A * Removes the binding for <code>key</code> from this 0N/A * <code>InputMap</code>. 0N/A * Removes all the mappings from this <code>InputMap</code>. 0N/A * Returns the <code>KeyStroke</code>s that are bound in this <code>InputMap</code>. 0N/A * Returns the number of <code>KeyStroke</code> bindings. 0N/A * Returns an array of the <code>KeyStroke</code>s defined in this 0N/A * <code>InputMap</code> and its parent. This differs from <code>keys()</code> in that 0N/A * this method includes the keys defined in the parent. 0N/A // Should only happen if size() != keys.length, which should only 0N/A // happen if mutated from multiple threads (or a bogus subclass).