01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings.plaf.css;
14:
15: import javax.swing.InputMap;
16: import javax.swing.KeyStroke;
17:
18: /**
19: * @author hengels
20: */
21: public class VersionedInputMap extends InputMap {
22: private static final long serialVersionUID = 1L;
23: InputMap inputMap;
24: int version = 0;
25:
26: public VersionedInputMap() {
27: }
28:
29: public VersionedInputMap(InputMap inputMap) {
30: this .inputMap = inputMap;
31: }
32:
33: public int size() {
34: return inputMap.size();
35: }
36:
37: public void clear() {
38: version++;
39: inputMap.clear();
40: }
41:
42: public InputMap getParent() {
43: return inputMap.getParent();
44: }
45:
46: public void setParent(InputMap map) {
47: version++;
48: inputMap.setParent(map);
49: }
50:
51: public KeyStroke[] allKeys() {
52: return inputMap.allKeys();
53: }
54:
55: public KeyStroke[] keys() {
56: return inputMap.keys();
57: }
58:
59: public void remove(KeyStroke key) {
60: version++;
61: inputMap.remove(key);
62: }
63:
64: public Object get(KeyStroke keyStroke) {
65: return inputMap.get(keyStroke);
66: }
67:
68: public void put(KeyStroke keyStroke, Object actionMapKey) {
69: version++;
70: inputMap.put(keyStroke, actionMapKey);
71: }
72:
73: public int getVersion() {
74: return version;
75: }
76: }
|