diff options
Diffstat (limited to 'libjava/classpath/javax/swing/undo')
4 files changed, 15 insertions, 14 deletions
diff --git a/libjava/classpath/javax/swing/undo/CompoundEdit.java b/libjava/classpath/javax/swing/undo/CompoundEdit.java index e1cfbb619b3..fbff2a26418 100644 --- a/libjava/classpath/javax/swing/undo/CompoundEdit.java +++ b/libjava/classpath/javax/swing/undo/CompoundEdit.java @@ -1,5 +1,5 @@ /* CompoundEdit.java -- Combines multiple UndoableEdits. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -75,7 +75,7 @@ public class CompoundEdit * The <code>UndoableEdit</code>s being combined into a compound * editing action. */ - protected Vector edits; + protected Vector<UndoableEdit> edits; /** @@ -92,7 +92,7 @@ public class CompoundEdit */ public CompoundEdit() { - edits = new Vector(); + edits = new Vector<UndoableEdit>(); inProgress = true; } @@ -118,7 +118,7 @@ public class CompoundEdit super.undo(); for (int i = edits.size() - 1; i >= 0; i--) - ((UndoableEdit) edits.elementAt(i)).undo(); + edits.elementAt(i).undo(); } @@ -143,7 +143,7 @@ public class CompoundEdit super.redo(); for (int i = 0; i < edits.size(); i++) - ((UndoableEdit) edits.elementAt(i)).redo(); + edits.elementAt(i).redo(); } @@ -156,7 +156,7 @@ public class CompoundEdit if (edits.size() == 0) return null; else - return (UndoableEdit) edits.elementAt(edits.size() - 1); + return edits.elementAt(edits.size() - 1); } @@ -172,7 +172,7 @@ public class CompoundEdit public void die() { for (int i = edits.size() - 1; i >= 0; i--) - ((UndoableEdit) edits.elementAt(i)).die(); + edits.elementAt(i).die(); super.die(); } @@ -316,7 +316,7 @@ public class CompoundEdit public boolean isSignificant() { for (int i = edits.size() - 1; i >= 0; i--) - if (((UndoableEdit) edits.elementAt(i)).isSignificant()) + if (edits.elementAt(i).isSignificant()) return true; return false; diff --git a/libjava/classpath/javax/swing/undo/StateEdit.java b/libjava/classpath/javax/swing/undo/StateEdit.java index 326abea1f4e..91fc88faa60 100644 --- a/libjava/classpath/javax/swing/undo/StateEdit.java +++ b/libjava/classpath/javax/swing/undo/StateEdit.java @@ -121,14 +121,14 @@ public class StateEdit * The state of <code>object</code> at the time of constructing * this <code>StateEdit</code>. */ - protected Hashtable preState; + protected Hashtable<Object, Object> preState; /** * The state of <code>object</code> at the time when {@link #end()} * was called. */ - protected Hashtable postState; + protected Hashtable<Object, Object> postState; /** diff --git a/libjava/classpath/javax/swing/undo/StateEditable.java b/libjava/classpath/javax/swing/undo/StateEditable.java index 459025be7da..7e6cc97856f 100644 --- a/libjava/classpath/javax/swing/undo/StateEditable.java +++ b/libjava/classpath/javax/swing/undo/StateEditable.java @@ -100,7 +100,7 @@ public interface StateEditable * @param state a hash table containing the relevant state * information. */ - void restoreState(Hashtable state); + void restoreState(Hashtable<?, ?> state); /** @@ -110,5 +110,5 @@ public interface StateEditable * @param state a hash table for storing relevant state * information. */ - void storeState(Hashtable state); + void storeState(Hashtable<Object, Object> state); } diff --git a/libjava/classpath/javax/swing/undo/UndoableEditSupport.java b/libjava/classpath/javax/swing/undo/UndoableEditSupport.java index 6d7bbea0728..b5a93341954 100644 --- a/libjava/classpath/javax/swing/undo/UndoableEditSupport.java +++ b/libjava/classpath/javax/swing/undo/UndoableEditSupport.java @@ -69,7 +69,8 @@ public class UndoableEditSupport /** * The currently registered listeners. */ - protected Vector listeners = new Vector(); + protected Vector<UndoableEditListener> listeners = + new Vector<UndoableEditListener>(); /** @@ -148,7 +149,7 @@ public class UndoableEditSupport public synchronized UndoableEditListener[] getUndoableEditListeners() { UndoableEditListener[] result = new UndoableEditListener[listeners.size()]; - return (UndoableEditListener[]) listeners.toArray(result); + return listeners.toArray(result); } |