/[classpath]/classpath/javax/swing/ComponentInputMap.java
ViewVC logotype

Diff of /classpath/javax/swing/ComponentInputMap.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by aselkirk, Tue May 28 05:22:06 2002 UTC revision 1.4 by mark, Thu Jul 22 19:45:39 2004 UTC
# Line 1  Line 1 
1  /* ComponentInputMap.java --  /* ComponentInputMap.java --
2     Copyright (C) 2002 Free Software Foundation, Inc.     Copyright (C) 2002, 2004  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 37  exception statement from your version. * Line 37  exception statement from your version. *
37    
38  package javax.swing;  package javax.swing;
39    
40    
41  /**  /**
  * ComponentInputMap  
42   * @author      Andrew Selkirk   * @author      Andrew Selkirk
43   * @version     1.0   * @author Michael Koch
44   */   */
45  public class ComponentInputMap extends InputMap {  public class ComponentInputMap extends InputMap
46    {
         //-------------------------------------------------------------  
         // Variables --------------------------------------------------  
         //-------------------------------------------------------------  
   
47          /**          /**
48           * component     * The component to notify.
49           */           */
50          private JComponent component;          private JComponent component;
51    
   
         //-------------------------------------------------------------  
         // Initialization ---------------------------------------------  
         //-------------------------------------------------------------  
   
         /**  
          * Constructor ComponentInputMap  
          * @param value0 TODO  
          */  
         public ComponentInputMap(JComponent value0) {  
                 // TODO  
         } // ComponentInputMap()  
   
   
         //-------------------------------------------------------------  
         // Methods ----------------------------------------------------  
         //-------------------------------------------------------------  
   
         /**  
          * put  
          * @param keystroke TODO  
          * @param value TODO  
          */  
         public void put(KeyStroke keystroke, Object value) {  
                 // TODO  
         } // put()  
   
52          /**          /**
53           * clear     * Creates <code>ComponentInputMap</code> object that notifies the given
54           */     * component about changes to it.
55          public void clear() {     *
56                  // TODO     * @param comp the component to notify
57          } // clear()     *
58       * @exception IllegalArgumentException if comp is null
59          /**     */
60           * remove    public ComponentInputMap(JComponent comp)
61           * @param keystroke TODO    {
62           */      if (comp == null)
63          public void remove(KeyStroke keystroke) {        throw new IllegalArgumentException();
64                  // TODO      
65          } // remove()      this.component = comp;
66      }
67          /**  
68           * setParent    /**
69           * @param parent TODO     * Puts a new entry into the <code>InputMap</code>.
70           */     * If actionMapKey is null an existing entry will be removed.
71          public void setParent(InputMap parent) {     *
72                  // TODO     * @param keystroke the keystroke for the entry
73          } // setParent()     * @param actionMapKey the action.
74       */
75          /**    public void put(KeyStroke keystroke, Object value)
76           * getComponent    {
77           * @returns JComponent      super.put(keystroke, value);
78           */      // FIXME: Notify component.
79          public JComponent getComponent() {    }
80                  return null; // TODO  
81          } // getComponent()    /**
82       * Clears the <code>InputMap</code>.
83       */
84  } // ComponentInputMap    public void clear()
85      {
86        super.clear();
87        // FIXME: Notify component.
88      }
89    
90      /**
91       * Remove an entry from the <code>InputMap</code>.
92       *
93       * @param key the key of the entry to remove
94       */
95      public void remove(KeyStroke keystroke)
96      {
97        super.remove(keystroke);
98        // FIXME: Notify component.
99      }
100    
101      /**
102       * Sets a parent for this <code>ComponentInputMap</code>.
103       *
104       * @param parentMap the new parent
105       *
106       * @exception IllegalArgument if parentMap is not a
107       * <code>ComponentInputMap</code> or not associated with the same component
108       */
109      public void setParent(InputMap parentMap)
110      {
111        if (! (parentMap instanceof ComponentInputMap))
112          throw new IllegalArgumentException();
113    
114        if (((ComponentInputMap) parentMap).getComponent() != component)
115          throw new IllegalArgumentException();
116      
117        super.setParent(parentMap);
118        // FIXME: Notify component.
119      }
120    
121      /**
122       * Returns the component to notify about changes.
123       *
124       * @return a <code>JComponent</code> object
125       */
126      public JComponent getComponent()
127      {
128        return component;
129      }
130    }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26