jdk/src/share/classes/javax/swing/undo/StateEdit.java
changeset 1301 15e81207e1f2
parent 2 90ce3da70b43
child 1639 a97859015238
equal deleted inserted replaced
1300:e7bbe37ce03a 1301:15e81207e1f2
   114         init (anObject,name);
   114         init (anObject,name);
   115     }
   115     }
   116 
   116 
   117     protected void init (StateEditable anObject, String name) {
   117     protected void init (StateEditable anObject, String name) {
   118         this.object = anObject;
   118         this.object = anObject;
   119         this.preState = new Hashtable(11);
   119         this.preState = new Hashtable<Object, Object>(11);
   120         this.object.storeState(this.preState);
   120         this.object.storeState(this.preState);
   121         this.postState = null;
   121         this.postState = null;
   122         this.undoRedoName = name;
   122         this.undoRedoName = name;
   123     }
   123     }
   124 
   124 
   131     /**
   131     /**
   132      * Gets the post-edit state of the StateEditable object and
   132      * Gets the post-edit state of the StateEditable object and
   133      * ends the edit.
   133      * ends the edit.
   134      */
   134      */
   135     public void end() {
   135     public void end() {
   136         this.postState = new Hashtable(11);
   136         this.postState = new Hashtable<Object, Object>(11);
   137         this.object.storeState(this.postState);
   137         this.object.storeState(this.postState);
   138         this.removeRedundantState();
   138         this.removeRedundantState();
   139     }
   139     }
   140 
   140 
   141     /**
   141     /**
   168 
   168 
   169     /**
   169     /**
   170      * Remove redundant key/values in state hashtables.
   170      * Remove redundant key/values in state hashtables.
   171      */
   171      */
   172     protected void removeRedundantState() {
   172     protected void removeRedundantState() {
   173         Vector uselessKeys = new Vector();
   173         Vector<Object> uselessKeys = new Vector<Object>();
   174         Enumeration myKeys = preState.keys();
   174         Enumeration myKeys = preState.keys();
   175 
   175 
   176         // Locate redundant state
   176         // Locate redundant state
   177         while (myKeys.hasMoreElements()) {
   177         while (myKeys.hasMoreElements()) {
   178             Object myKey = myKeys.nextElement();
   178             Object myKey = myKeys.nextElement();