KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > plaf > css > VersionedInputMap


1 /*
2  * $Id: VersionedInputMap.java,v 1.5 2005/03/03 13:18:25 neurolabs Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.plaf.css;
15
16 import javax.swing.*;
17
18 /**
19  * @author hengels
20  * @version $Revision: 1.5 $
21  */

22 public class VersionedInputMap extends InputMap {
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         inputMap.clear();
39     }
40
41     public InputMap getParent() {
42         return inputMap.getParent();
43     }
44
45     public void setParent(InputMap map) {
46         version++;
47         inputMap.setParent(map);
48     }
49
50     public KeyStroke[] allKeys() {
51         return inputMap.allKeys();
52     }
53
54     public KeyStroke[] keys() {
55         return inputMap.keys();
56     }
57
58     public void remove(KeyStroke key) {
59         inputMap.remove(key);
60     }
61
62     public Object JavaDoc get(KeyStroke keyStroke) {
63         return inputMap.get(keyStroke);
64     }
65
66     public void put(KeyStroke keyStroke, Object JavaDoc actionMapKey) {
67         version++;
68         inputMap.put(keyStroke, actionMapKey);
69     }
70
71     public int getVersion() {
72         return version;
73     }
74 }
75
Popular Tags