From: <cr...@us...> - 2009-09-09 15:52:41
|
Revision: 5670 http://jnode.svn.sourceforge.net/jnode/?rev=5670&view=rev Author: crawley Date: 2009-09-09 15:52:30 +0000 (Wed, 09 Sep 2009) Log Message: ----------- Merge changes from 'trunk' at r5663 (textui) Modified Paths: -------------- branches/jikesRVM/textui/.classpath branches/jikesRVM/textui/.project branches/jikesRVM/textui/.settings/org.eclipse.jdt.core.prefs branches/jikesRVM/textui/src/textui/charva/awt/AbstractToolkit.java branches/jikesRVM/textui/src/textui/charva/awt/Component.java branches/jikesRVM/textui/src/textui/charva/awt/Container.java branches/jikesRVM/textui/src/textui/charva/awt/EventQueue.java branches/jikesRVM/textui/src/textui/charva/awt/FlowLayout.java branches/jikesRVM/textui/src/textui/charva/awt/GridBagLayout.java branches/jikesRVM/textui/src/textui/charva/awt/IllegalComponentStateException.java branches/jikesRVM/textui/src/textui/charva/awt/SyncQueue.java branches/jikesRVM/textui/src/textui/charva/awt/TerminfoCapabilityException.java branches/jikesRVM/textui/src/textui/charva/awt/Toolkit.java branches/jikesRVM/textui/src/textui/charva/awt/Window.java branches/jikesRVM/textui/src/textui/charva/awt/event/AWTEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/ActionEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/AdjustmentEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/FocusEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/GarbageCollectionEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/InputEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/InvocationEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/ItemEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/KeyEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/MouseEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/PaintEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/ScrollEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/SyncEvent.java branches/jikesRVM/textui/src/textui/charva/awt/event/WindowEvent.java branches/jikesRVM/textui/src/textui/charva/awt/util/MultiLineLabel.java branches/jikesRVM/textui/src/textui/charvax/swing/AbstractButton.java branches/jikesRVM/textui/src/textui/charvax/swing/AbstractListModel.java branches/jikesRVM/textui/src/textui/charvax/swing/ButtonGroup.java branches/jikesRVM/textui/src/textui/charvax/swing/DefaultComboBoxModel.java branches/jikesRVM/textui/src/textui/charvax/swing/DefaultListModel.java branches/jikesRVM/textui/src/textui/charvax/swing/DefaultListSelectionModel.java branches/jikesRVM/textui/src/textui/charvax/swing/JComboBox.java branches/jikesRVM/textui/src/textui/charvax/swing/JFileChooser.java branches/jikesRVM/textui/src/textui/charvax/swing/JList.java branches/jikesRVM/textui/src/textui/charvax/swing/JMenu.java branches/jikesRVM/textui/src/textui/charvax/swing/JPopupMenu.java branches/jikesRVM/textui/src/textui/charvax/swing/JScrollBar.java branches/jikesRVM/textui/src/textui/charvax/swing/JTabbedPane.java branches/jikesRVM/textui/src/textui/charvax/swing/JTable.java branches/jikesRVM/textui/src/textui/charvax/swing/JTextArea.java branches/jikesRVM/textui/src/textui/charvax/swing/JTextField.java branches/jikesRVM/textui/src/textui/charvax/swing/event/ListDataEvent.java branches/jikesRVM/textui/src/textui/charvax/swing/event/ListSelectionEvent.java branches/jikesRVM/textui/src/textui/charvax/swing/event/TableModelEvent.java branches/jikesRVM/textui/src/textui/charvax/swing/event/TreeModelEvent.java branches/jikesRVM/textui/src/textui/charvax/swing/event/TreeSelectionEvent.java branches/jikesRVM/textui/src/textui/charvax/swing/table/AbstractTableModel.java branches/jikesRVM/textui/src/textui/charvax/swing/table/DefaultTableModel.java branches/jikesRVM/textui/src/textui/charvax/swing/tree/DefaultMutableTreeNode.java branches/jikesRVM/textui/src/textui/charvax/swing/tree/DefaultTreeModel.java branches/jikesRVM/textui/src/textui/charvax/swing/tree/TreeNode.java branches/jikesRVM/textui/src/textui/charvax/swing/tree/TreePath.java branches/jikesRVM/textui/textui.iml Added Paths: ----------- branches/jikesRVM/textui/.checkstyle Copied: branches/jikesRVM/textui/.checkstyle (from rev 5663, trunk/textui/.checkstyle) =================================================================== --- branches/jikesRVM/textui/.checkstyle (rev 0) +++ branches/jikesRVM/textui/.checkstyle 2009-09-09 15:52:30 UTC (rev 5670) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fileset-config file-format-version="1.2.0" simple-config="true"> + <fileset name="tous" enabled="true" check-config-name="Sun Checks" local="false"> + <file-match-pattern match-pattern="." include-pattern="true"/> + </fileset> +</fileset-config> Modified: branches/jikesRVM/textui/.classpath =================================================================== --- branches/jikesRVM/textui/.classpath 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/.classpath 2009-09-09 15:52:30 UTC (rev 5670) @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src/textui"/> - <classpathentry exported="true" kind="src" path="/JNode-Core"/> - <classpathentry exported="true" kind="lib" path="/JNode-Core/lib/log4j-1.2.8.jar"/> - <classpathentry exported="true" kind="src" path="/JNode-Shell"/> + <classpathentry exported="true" kind="src" path="/core"/> + <classpathentry exported="true" kind="src" path="/shell"/> + <classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/> + <classpathentry kind="lib" path="/all/lib/classlib.jar" sourcepath="/all/lib/classlib-src.jar"/> <classpathentry kind="output" path="build/classes"/> </classpath> Modified: branches/jikesRVM/textui/.project =================================================================== --- branches/jikesRVM/textui/.project 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/.project 2009-09-09 15:52:30 UTC (rev 5670) @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name>JNode-TextUI</name> + <name>textui</name> <comment></comment> <projects> + <project>all</project> <project>JNode-Core</project> <project>JNode-Shell</project> </projects> Modified: branches/jikesRVM/textui/.settings/org.eclipse.jdt.core.prefs =================================================================== --- branches/jikesRVM/textui/.settings/org.eclipse.jdt.core.prefs 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/.settings/org.eclipse.jdt.core.prefs 2009-09-09 15:52:30 UTC (rev 5670) @@ -1,12 +1,12 @@ -#Tue Apr 12 20:13:31 CEST 2005 +#Mon Jul 14 11:34:13 CEST 2008 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.source=1.6 Modified: branches/jikesRVM/textui/src/textui/charva/awt/AbstractToolkit.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/AbstractToolkit.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/AbstractToolkit.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -660,7 +660,8 @@ { // throw new RuntimeException( // "trying to remove window not in windowlist"); - System.err.println( "Trying to remove window not in list" ); + //todo why does it happen this case? +// System.err.println( "Trying to remove window not in list" ); } // throw new RuntimeException( // "trying to remove window not in windowlist"); @@ -673,7 +674,7 @@ * modifying it, because the window list is accessed by the * keyboard-reading thread as well as by the event-dispatching thread. */ - Vector getWindowList() { + Vector<Window> getWindowList() { return _windowList; } @@ -813,12 +814,12 @@ * A list of visible Windows. The first in the list is at the bottom, the * last is on top. */ - private Vector _windowList = new Vector(); + private Vector<Window> _windowList = new Vector<Window>(); /** * A list of color-pairs. */ - protected Vector _colorPairs = new Vector(); + protected Vector<ColorPair> _colorPairs = new Vector<ColorPair>(); protected EventQueue _evtQueue; Modified: branches/jikesRVM/textui/src/textui/charva/awt/Component.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/Component.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/Component.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -190,7 +190,7 @@ * collected when there are no more strong references to it. */ public void setParent(Container container_) { - _parent = new WeakReference(container_); + _parent = new WeakReference<Container>(container_); // If this component's colors have not been set yet, inherit // the parent container's colors. @@ -219,7 +219,7 @@ */ public void addKeyListener(KeyListener kl_) { if (_keyListeners == null) - _keyListeners = new Vector(); + _keyListeners = new Vector<KeyListener>(); _keyListeners.add(kl_); } @@ -228,7 +228,7 @@ */ public void addFocusListener(FocusListener fl_) { if (_focusListeners == null) - _focusListeners = new Vector(); + _focusListeners = new Vector<FocusListener>(); _focusListeners.add(fl_); } @@ -270,7 +270,7 @@ */ public void processKeyEvent(KeyEvent ke_) { if (_keyListeners != null) { - for (Enumeration e = _keyListeners.elements(); + for (Enumeration<KeyListener> e = _keyListeners.elements(); e.hasMoreElements(); ) { KeyListener kl = (KeyListener) e.nextElement(); @@ -305,7 +305,7 @@ */ public void processFocusEvent(FocusEvent fe_) { if (_focusListeners != null) { - for (Enumeration e = _focusListeners.elements(); + for (Enumeration<FocusListener> e = _focusListeners.elements(); e.hasMoreElements(); ) { FocusListener fl = (FocusListener) e.nextElement(); @@ -400,7 +400,7 @@ Rectangle bounds = getBounds(); Window ancestor = getAncestorWindow(); - Vector windowList = Toolkit.getDefaultToolkit().getWindowList(); + Vector<Window> windowList = Toolkit.getDefaultToolkit().getWindowList(); boolean obscured = false; synchronized (windowList) { @@ -592,7 +592,7 @@ * allow the parent to be garbage-collected when there are no more * strong references to it. */ - protected WeakReference _parent = null; + protected WeakReference<Container> _parent = null; /** * This flag is true if this component can react to user input. @@ -612,12 +612,12 @@ /** * A list of KeyListeners registered for this component. */ - protected Vector _keyListeners = null; + protected Vector<KeyListener> _keyListeners = null; /** * A list of FocusListeners registered for this component. */ - protected Vector _focusListeners = null; + protected Vector<FocusListener> _focusListeners = null; /** * the X-alignment of this component Modified: branches/jikesRVM/textui/src/textui/charva/awt/Container.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/Container.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/Container.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -108,7 +108,7 @@ * the point are relative to the origin of this container. */ public Component getComponentAt(int x, int y) { - Enumeration e = _components.elements(); + Enumeration<Component> e = _components.elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); if (c.contains(x, y)) { @@ -217,7 +217,7 @@ if ( !isVisible()) return; - Enumeration e = _components.elements(); + Enumeration<Component> e = _components.elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); if (c.isVisible()) @@ -234,7 +234,7 @@ { super.setForeground(color_); - Enumeration e = _components.elements(); + Enumeration<Component> e = _components.elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); if (c.getForeground() == null) @@ -251,7 +251,7 @@ { super.setBackground(color_); - Enumeration e = _components.elements(); + Enumeration <Component>e = _components.elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); if (c.getBackground() == null) @@ -297,7 +297,7 @@ /* _currentFocus is not yet set. Try to set it to the first * FocusTraversable component contained in this container. */ - Enumeration e = _components.elements(); + Enumeration<Component> e = _components.elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); if (c.isFocusTraversable()) { @@ -464,7 +464,7 @@ if ( !super.isFocusTraversable()) return false; - Enumeration e = _components.elements(); + Enumeration<Component> e = _components.elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); if (c.isFocusTraversable()) @@ -478,7 +478,7 @@ /* Default implementation of debug, gets overridden by subclasses. */ public void debug(int level_) { - Enumeration e = _components.elements(); + Enumeration<Component> e = _components.elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); c.debug(level_ + 1); @@ -494,7 +494,7 @@ */ private void firstFocus() { - Enumeration e = _components.elements(); + Enumeration<Component> e = _components.elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); if (c.isFocusTraversable()) { @@ -568,7 +568,7 @@ /** * The list of components contained within this Container. */ - protected Vector _components = new Vector(); + protected Vector<Component> _components = new Vector<Component>(); /** The container's size */ Modified: branches/jikesRVM/textui/src/textui/charva/awt/EventQueue.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/EventQueue.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/EventQueue.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -126,9 +126,9 @@ //==================================================================== // INSTANCE VARIABLES - private LinkedList _lowPriorityQueue = new LinkedList(); + private LinkedList<AWTEvent> _lowPriorityQueue = new LinkedList<AWTEvent>(); - private LinkedList _highPriorityQueue = new LinkedList(); + private LinkedList<AWTEvent> _highPriorityQueue = new LinkedList<AWTEvent>(); //==================================================================== // STATIC VARIABLES Modified: branches/jikesRVM/textui/src/textui/charva/awt/FlowLayout.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/FlowLayout.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/FlowLayout.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -114,7 +114,7 @@ int voffset = insets.top; Component[] components = container_.getComponents(); - Vector localvector = new Vector(); + Vector<Component> localvector = new Vector<Component>(); for (int i=0; i<components.length; i++) { Component c = components[i]; @@ -160,7 +160,7 @@ /** private function to layout a single row of components. * @return The height of the laid-out row. */ - private int layoutRow(Container container_, Vector components_, + private int layoutRow(Container container_, Vector<Component> components_, int widthleft_, int heightleft_, int voffset_) { int hoffset = 0; @@ -179,7 +179,7 @@ break; } - Enumeration e = components_.elements(); + Enumeration<Component> e = components_.elements(); while (e.hasMoreElements()) { Component c = (Component) e.nextElement(); if (c.getSize().height > rowHeight) Modified: branches/jikesRVM/textui/src/textui/charva/awt/GridBagLayout.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/GridBagLayout.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/GridBagLayout.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -47,9 +47,9 @@ */ _rows = 0; _columns = 0; - Enumeration e1 = _constraints.elements(); + Enumeration<GridBagConstraints> e1 = _constraints.elements(); while (e1.hasMoreElements()) { - GridBagConstraints gbc = (GridBagConstraints) e1.nextElement(); + GridBagConstraints gbc = e1.nextElement(); if (gbc.gridx + gbc.gridwidth > _columns) _columns = gbc.gridx + gbc.gridwidth; @@ -72,11 +72,11 @@ int width_left[] = new int[_components.size()]; int height_left[] = new int[_components.size()]; - e1 = _components.elements(); - Enumeration e2 = _constraints.elements(); - for (int i=0; e1.hasMoreElements(); i++) { - Component c = (Component) e1.nextElement(); - GridBagConstraints gbc = (GridBagConstraints) e2.nextElement(); + Enumeration<Component> e3 = _components.elements(); + Enumeration<GridBagConstraints> e2 = _constraints.elements(); + for (int i=0; e3.hasMoreElements(); i++) { + Component c = e3.nextElement(); + GridBagConstraints gbc = e2.nextElement(); /* Calculate the minimum width & height required for this * component. @@ -97,9 +97,9 @@ * value determines the height of this row. */ _calculatedRowHeights[row] = 0; - Enumeration e = _constraints.elements(); + Enumeration<GridBagConstraints> e = _constraints.elements(); for (int i=0; e.hasMoreElements(); i++) { - GridBagConstraints gbc = (GridBagConstraints) e.nextElement(); + GridBagConstraints gbc = e.nextElement(); if (row == gbc.gridy + gbc.gridheight - 1) { /* This component's bottom edge is in the current row. @@ -115,7 +115,7 @@ */ e = _constraints.elements(); for (int i=0; e.hasMoreElements(); i++) { - GridBagConstraints gbc = (GridBagConstraints) e.nextElement(); + GridBagConstraints gbc = e.nextElement(); if (row >= gbc.gridy && row < gbc.gridy + gbc.gridheight) { @@ -133,9 +133,9 @@ * value determines the width of this column. */ _calculatedColumnWidths[column] = 0; - Enumeration e = _constraints.elements(); + Enumeration<GridBagConstraints> e = _constraints.elements(); for (int i=0; e.hasMoreElements(); i++) { - GridBagConstraints gbc = (GridBagConstraints) e.nextElement(); + GridBagConstraints gbc = e.nextElement(); if (column == gbc.gridx + gbc.gridwidth - 1) { /* This component's right edge is in the current column. @@ -151,7 +151,7 @@ */ e = _constraints.elements(); for (int i=0; e.hasMoreElements(); i++) { - GridBagConstraints gbc = (GridBagConstraints) e.nextElement(); + GridBagConstraints gbc = e.nextElement(); if (column >= gbc.gridx && column < gbc.gridx + gbc.gridwidth) { @@ -165,7 +165,7 @@ */ e2 = _constraints.elements(); while (e2.hasMoreElements()) { - GridBagConstraints gbc = (GridBagConstraints) e2.nextElement(); + GridBagConstraints gbc = e2.nextElement(); for (int i=gbc.gridx; i< gbc.gridx + gbc.gridwidth; i++) { if (gbc.weightx > _calculatedColumnWeights[i]) @@ -209,12 +209,12 @@ int extraColumns = size.width - minsize.width; int extraRows = size.height - minsize.height; - Enumeration e1 = _components.elements(); - Enumeration e2 = _constraints.elements(); + Enumeration<Component> e1 = _components.elements(); + Enumeration<GridBagConstraints> e2 = _constraints.elements(); while (e1.hasMoreElements()) { - Component c = (Component) e1.nextElement(); + Component c = e1.nextElement(); - GridBagConstraints gbc = (GridBagConstraints) e2.nextElement(); + GridBagConstraints gbc = e2.nextElement(); /* Calculate the boundaries of the grid cell that this * component occupies. @@ -406,13 +406,13 @@ /** * As components are added, they are stored in this vector. */ - private Vector _components = new Vector(); + private Vector<Component> _components = new Vector<Component>(); /** * As components are added, their constraint objects are stored in * this vector. */ - private Vector _constraints = new Vector(); + private Vector<GridBagConstraints> _constraints = new Vector<GridBagConstraints>(); /** The number of rows in the grid (calculated from all the added * components and their gridx, gridy, gridwidth and gridheight Modified: branches/jikesRVM/textui/src/textui/charva/awt/IllegalComponentStateException.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/IllegalComponentStateException.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/IllegalComponentStateException.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -23,9 +23,10 @@ * This exception is thrown when a CHARVA component is in an * illegal state for the requested operation. */ -public class IllegalComponentStateException - extends RuntimeException +public class IllegalComponentStateException extends RuntimeException { + private static final long serialVersionUID = 1L; + /** Construct an IllegalComponentStateException. */ public IllegalComponentStateException() Modified: branches/jikesRVM/textui/src/textui/charva/awt/SyncQueue.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/SyncQueue.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/SyncQueue.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -26,9 +26,9 @@ * if possible. This speeds up redrawing. * The queue also handles GarbageCollectionEvents. */ -class SyncQueue - extends java.util.LinkedList +class SyncQueue extends java.util.LinkedList<AWTEvent> { + private static final long serialVersionUID = 1L; private static SyncQueue _instance; private boolean stopped = false; Modified: branches/jikesRVM/textui/src/textui/charva/awt/TerminfoCapabilityException.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/TerminfoCapabilityException.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/TerminfoCapabilityException.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -25,9 +25,10 @@ * when it finds the requested capability but it is of the wrong * type). */ -public class TerminfoCapabilityException - extends Exception +public class TerminfoCapabilityException extends Exception { + private static final long serialVersionUID = 1L; + public TerminfoCapabilityException() { super(); Modified: branches/jikesRVM/textui/src/textui/charva/awt/Toolkit.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/Toolkit.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/Toolkit.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -33,7 +33,8 @@ private int[] colorpairs = new int[256]; - private LinkedList keyQueue = new LinkedList(); + // This is a mixed queue of Integer and MouseEvent instances + private LinkedList<Object> keyQueue = new LinkedList<Object>(); private final TextConsole console; @@ -132,7 +133,7 @@ } registered = true; conMan.registerConsole(console); - System.out.println("Registering charva Toolkit with consoleManager."); + //System.out.println("Registering charva Toolkit with consoleManager."); // pause(); conMan.focus(console); @@ -154,8 +155,11 @@ try { final ShellManager sm = InitialNaming.lookup(ShellManager.NAME); final ConsoleManager conMgr = sm.getCurrentShell().getConsole().getManager(); - final TextConsole console = (TextConsole) conMgr - .createConsole("charva", ConsoleManager.CreateOptions.TEXT); + final TextConsole console = (TextConsole) conMgr.createConsole( + "charva", + ConsoleManager.CreateOptions.TEXT | + ConsoleManager.CreateOptions.STACKED | + ConsoleManager.CreateOptions.NO_LINE_EDITTING); console.addKeyboardListener(new KeyboardAdapter() { public void keyPressed(KeyboardEvent event) { if (event.isControlDown() && event.getKeyChar() == 'z') { @@ -448,6 +452,7 @@ keyQueue.add(new Integer(key)); keyQueue.notifyAll(); + event.consume(); } } Modified: branches/jikesRVM/textui/src/textui/charva/awt/Window.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/Window.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/Window.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -76,7 +76,7 @@ * Register a WindowListener object for this window. */ public void addWindowListener(WindowListener listener_) { - if (_windowListeners == null) _windowListeners = new Vector(); + if (_windowListeners == null) _windowListeners = new Vector<WindowListener>(); _windowListeners.add(listener_); } @@ -88,7 +88,7 @@ protected void processWindowEvent(WindowEvent evt_) { if (_windowListeners == null) return; - Enumeration e = _windowListeners.elements(); + Enumeration<WindowListener> e = _windowListeners.elements(); while (e.hasMoreElements()) { WindowListener wl = (WindowListener) e.nextElement(); switch (evt_.getID()) { @@ -257,7 +257,7 @@ /* * Now redraw all of the windows, from the bottom to the top. */ - Vector winlist = _term.getWindowList(); + Vector<Window> winlist = _term.getWindowList(); Window window = null; synchronized (winlist) { for (int i = 0; i < winlist.size(); i++) { @@ -323,7 +323,7 @@ */ if (!((Component) source).isTotallyObscured()) { - Vector windowlist = _term.getWindowList(); + Vector<Window> windowlist = _term.getWindowList(); synchronized (windowlist) { /* @@ -425,6 +425,7 @@ super.debug(1); } + @SuppressWarnings("unused") private void startPlayback() { // System.err.println("Playback disabled (awaiting security exception fix..)"); return; @@ -456,7 +457,7 @@ private boolean _windowClosed = false; - private Vector _windowListeners = null; + private Vector<WindowListener> _windowListeners = null; private static boolean _dispatchThreadRunning = false; Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/AWTEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/AWTEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/AWTEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -24,9 +24,9 @@ * This is the base class for all the CHARVA user-interface events. * It encapsulates information about the event. */ -public abstract class AWTEvent - extends java.util.EventObject +public abstract class AWTEvent extends java.util.EventObject { + private static final long serialVersionUID = 1L; /** * Construct an event with the specified source and ID. * @param source_ The component that emitted this event. Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/ActionEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/ActionEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/ActionEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -25,9 +25,9 @@ * An event which indicates that a component-defined action (typically * the pressing of a button) occurred. */ -public class ActionEvent - extends AWTEvent +public class ActionEvent extends AWTEvent { + private static final long serialVersionUID = 1L; String _command; public ActionEvent(Component source_, String command_) { Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/AdjustmentEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/AdjustmentEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/AdjustmentEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -24,9 +24,9 @@ /** * The adjustment event emitted by Adjustable objects (eg a scrollbar). */ -public class AdjustmentEvent - extends AWTEvent +public class AdjustmentEvent extends AWTEvent { + private static final long serialVersionUID = 1L; /** * Create a new AdjustmentEvent. * @param source_ The component to which the event must be delivered. Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/FocusEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/FocusEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/FocusEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -28,9 +28,9 @@ * registered to receive such events using the object's addFocusListener() * method. */ -public class FocusEvent - extends AWTEvent +public class FocusEvent extends AWTEvent { + private static final long serialVersionUID = 1L; /** * Create a new FocusEvent. * @param id_ The event identifier. Must be FOCUS_LOST or FOCUS_GAINED. Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/GarbageCollectionEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/GarbageCollectionEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/GarbageCollectionEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -30,9 +30,9 @@ * returned. This is a useful but optional way of limiting the growth * of the heap without causing noticeable delays. */ -public class GarbageCollectionEvent - extends AWTEvent +public class GarbageCollectionEvent extends AWTEvent { + private static final long serialVersionUID = 1L; public GarbageCollectionEvent(Component source_) { super(source_, AWTEvent.GARBAGE_COLLECTION); } Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/InputEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/InputEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/InputEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -23,9 +23,9 @@ /** * This is the superclass of KeyEvent and MouseEvent. */ -public class InputEvent - extends AWTEvent +public class InputEvent extends AWTEvent { + private static final long serialVersionUID = 1L; public InputEvent(Component source_, int id_) { super(source_, id_); } Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/InvocationEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/InvocationEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/InvocationEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -24,9 +24,9 @@ * An event which executes the <code>run()</code> method on a * <code>Runnable</code> when dispatched by the AWT event dispatcher thread. */ -public class InvocationEvent - extends AWTEvent +public class InvocationEvent extends AWTEvent { + private static final long serialVersionUID = 1L; /** * Constructs an InvocationEvent with the specified source which * will execute the Runnable's run() method when dispatched by Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/ItemEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/ItemEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/ItemEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -24,9 +24,9 @@ /** * An event which indicates that an item was selected or deselected. */ -public class ItemEvent - extends AWTEvent +public class ItemEvent extends AWTEvent { + private static final long serialVersionUID = 1L; /** * Constructs an ItemEvent object. * @param source_ The object (such as a List) that originated the event. Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/KeyEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/KeyEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/KeyEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -25,9 +25,9 @@ /** * An event which indicates that a keystroke occurred in an object. */ -public class KeyEvent - extends InputEvent +public class KeyEvent extends InputEvent { + private static final long serialVersionUID = 1L; private int _key; public KeyEvent(int key_, int id_, Component source_) { Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/MouseEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/MouseEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/MouseEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -23,9 +23,9 @@ /** * An event which encapsulates information about a mouse-click. */ -public class MouseEvent - extends InputEvent +public class MouseEvent extends InputEvent { + private static final long serialVersionUID = 1L; public MouseEvent(Component source_, int modifiers_, int x_, int y_, int clickcount_, int button_) { Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/PaintEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/PaintEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/PaintEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -26,9 +26,9 @@ * An event which is used to ensure that painting of components is * serialized, i.e that it occurs in the main event-processing loop. */ -public class PaintEvent - extends AWTEvent +public class PaintEvent extends AWTEvent { + private static final long serialVersionUID = 1L; Rectangle _updateRect; public PaintEvent(Component source_, Rectangle rect_) { Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/ScrollEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/ScrollEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/ScrollEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -28,9 +28,9 @@ * such as a Table, when its state changes in such a way that it may * need to be scrolled (if it is contained within a ScrollPane). */ -public class ScrollEvent - extends AWTEvent +public class ScrollEvent extends AWTEvent { + private static final long serialVersionUID = 1L; /** * Construct a ScrollEvent with the specified direction and limit * parameters. Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/SyncEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/SyncEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/SyncEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -25,9 +25,9 @@ * A special event which is used for coalescing screen-refresh actions * if possible, in order to speed up redrawing. */ -public class SyncEvent - extends AWTEvent +public class SyncEvent extends AWTEvent { + private static final long serialVersionUID = 1L; public SyncEvent(Component source_) { super(source_, AWTEvent.SYNC_EVENT); Modified: branches/jikesRVM/textui/src/textui/charva/awt/event/WindowEvent.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/event/WindowEvent.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/event/WindowEvent.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -29,9 +29,9 @@ * The event is passed to each WindowListener object that is registered to * receive such events using the window's addWindowListener method. */ -public class WindowEvent - extends AWTEvent +public class WindowEvent extends AWTEvent { + private static final long serialVersionUID = 1L; public WindowEvent(Window source_, int id_) { super(source_, id_); Modified: branches/jikesRVM/textui/src/textui/charva/awt/util/MultiLineLabel.java =================================================================== --- branches/jikesRVM/textui/src/textui/charva/awt/util/MultiLineLabel.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charva/awt/util/MultiLineLabel.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -43,7 +43,7 @@ public Dimension minimumSize() { int width=0, height=0; - Enumeration e = _labeltext.elements(); + Enumeration<String> e = _labeltext.elements(); while (e.hasMoreElements()) { String s = (String) e.nextElement(); if (s.length() > width) @@ -62,7 +62,7 @@ // we'll sort out justification and video-attributes etc later. - Enumeration e = _labeltext.elements(); + Enumeration<String> e = _labeltext.elements(); for (int row=0; e.hasMoreElements(); row++) { String s = (String) e.nextElement(); toolkit.setCursor(origin.addOffset(0, row)); @@ -93,7 +93,7 @@ public String[] getText() { String[] strings = new String[_labeltext.size()]; - Enumeration e = _labeltext.elements(); + Enumeration<String> e = _labeltext.elements(); for (int i=0; e.hasMoreElements(); i++) { String s = (String) e.nextElement(); strings[i] = s; @@ -122,7 +122,7 @@ " size=" + getSize() + " label=" + (String) _labeltext.elementAt(0)); } - private Vector _labeltext = new Vector(); + private Vector<String> _labeltext = new Vector<String>(); //private int _justification = LEFT; Modified: branches/jikesRVM/textui/src/textui/charvax/swing/AbstractButton.java =================================================================== --- branches/jikesRVM/textui/src/textui/charvax/swing/AbstractButton.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charvax/swing/AbstractButton.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -185,7 +185,7 @@ */ public void addActionListener(ActionListener al_) { if (_actionListeners == null) - _actionListeners = new Vector(); + _actionListeners = new Vector<ActionListener>(); _actionListeners.add(al_); } @@ -194,7 +194,7 @@ */ protected void fireActionPerformed(ActionEvent ae_) { if (_actionListeners != null) { - for (Enumeration e = _actionListeners.elements(); + for (Enumeration<ActionListener> e = _actionListeners.elements(); e.hasMoreElements(); ) { ActionListener al = (ActionListener) e.nextElement(); @@ -208,7 +208,7 @@ */ public void addItemListener(ItemListener il_) { if (_itemListeners == null) - _itemListeners = new Vector(); + _itemListeners = new Vector<ItemListener>(); _itemListeners.add(il_); } @@ -250,7 +250,7 @@ */ protected void fireItemStateChanged(ItemEvent ie_) { if (_itemListeners != null) { - for (Enumeration e = _itemListeners.elements(); + for (Enumeration<ItemListener> e = _itemListeners.elements(); e.hasMoreElements(); ) { ItemListener il = (ItemListener) e.nextElement(); @@ -308,10 +308,10 @@ /** * A list of ActionListeners registered for this component. */ - protected Vector _actionListeners = null; + protected Vector<ActionListener> _actionListeners = null; /** * A list of ItemListeners registered for this component. */ - protected Vector _itemListeners = null; + protected Vector<ItemListener> _itemListeners = null; } Modified: branches/jikesRVM/textui/src/textui/charvax/swing/AbstractListModel.java =================================================================== --- branches/jikesRVM/textui/src/textui/charvax/swing/AbstractListModel.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charvax/swing/AbstractListModel.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -37,7 +37,7 @@ */ public void addListDataListener(ListDataListener l_) { if (_listeners == null) - _listeners = new ArrayList(); + _listeners = new ArrayList<ListDataListener>(); _listeners.add(l_); } @@ -62,7 +62,7 @@ ListDataEvent event = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, index0_, index1_); - for (Iterator iter = _listeners.iterator(); iter.hasNext(); ) { + for (Iterator<ListDataListener> iter = _listeners.iterator(); iter.hasNext(); ) { ListDataListener l = (ListDataListener) iter.next(); l.contentsChanged(event); } @@ -78,7 +78,7 @@ ListDataEvent event = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED, index0_, index1_); - for (Iterator iter = _listeners.iterator(); iter.hasNext(); ) { + for (Iterator<ListDataListener> iter = _listeners.iterator(); iter.hasNext(); ) { ListDataListener l = (ListDataListener) iter.next(); l.contentsChanged(event); } @@ -94,7 +94,7 @@ ListDataEvent event = new ListDataEvent(this, ListDataEvent.INTERVAL_ADDED, index0_, index1_); - for (Iterator iter = _listeners.iterator(); iter.hasNext(); ) { + for (Iterator<ListDataListener> iter = _listeners.iterator(); iter.hasNext(); ) { ListDataListener l = (ListDataListener) iter.next(); l.contentsChanged(event); } @@ -106,6 +106,6 @@ /** * A list of ListDataListeners registered for this object. */ - protected ArrayList _listeners = null; + protected ArrayList<ListDataListener> _listeners = null; } Modified: branches/jikesRVM/textui/src/textui/charvax/swing/ButtonGroup.java =================================================================== --- branches/jikesRVM/textui/src/textui/charvax/swing/ButtonGroup.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charvax/swing/ButtonGroup.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -56,7 +56,7 @@ */ public ButtonGroup() { - _buttons = new Vector(); + _buttons = new Vector<AbstractButton>(); } /** Adds the specified button to the group. @@ -77,7 +77,7 @@ /** Returns an Enumeration of all the buttons in this group. */ - public Enumeration getElements() + public Enumeration<AbstractButton> getElements() { return _buttons.elements(); } @@ -86,7 +86,7 @@ */ public AbstractButton getSelection() { - for (Enumeration e = _buttons.elements(); e.hasMoreElements();) { + for (Enumeration<AbstractButton> e = _buttons.elements(); e.hasMoreElements();) { AbstractButton b = (AbstractButton) e.nextElement(); if (b.isSelected() == true) @@ -130,7 +130,7 @@ /* There should have been only one button in the selected * state. All the other buttons should be in the deselected state. */ - for (Enumeration e = _buttons.elements(); e.hasMoreElements(); ) { + for (Enumeration<AbstractButton> e = _buttons.elements(); e.hasMoreElements(); ) { AbstractButton b = (AbstractButton) e.nextElement(); if (source != b || statechange != ItemEvent.SELECTED) { @@ -145,5 +145,5 @@ //==================================================================== // INSTANCE VARIABLES - private Vector _buttons; + private Vector<AbstractButton> _buttons; } Modified: branches/jikesRVM/textui/src/textui/charvax/swing/DefaultComboBoxModel.java =================================================================== --- branches/jikesRVM/textui/src/textui/charvax/swing/DefaultComboBoxModel.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charvax/swing/DefaultComboBoxModel.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -37,7 +37,7 @@ /** Constructs a DefaultComboBoxModel object initialized with a vector. */ - public DefaultComboBoxModel(Vector items_) { + public DefaultComboBoxModel(Vector<?> items_) { super(); for (int i=0; i<items_.size(); i++) { _list.add(items_.elementAt(i)); @@ -162,7 +162,7 @@ //==================================================================== // INSTANCE VARIABLES - private ArrayList _list = new ArrayList(); + private ArrayList<Object> _list = new ArrayList<Object>(); private Object _selectedItem; } Modified: branches/jikesRVM/textui/src/textui/charvax/swing/DefaultListModel.java =================================================================== --- branches/jikesRVM/textui/src/textui/charvax/swing/DefaultListModel.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charvax/swing/DefaultListModel.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -97,5 +97,5 @@ // INSTANCE VARIABLES - private ArrayList _list = new ArrayList(); + private ArrayList<Object> _list = new ArrayList<Object>(); } Modified: branches/jikesRVM/textui/src/textui/charvax/swing/DefaultListSelectionModel.java =================================================================== --- branches/jikesRVM/textui/src/textui/charvax/swing/DefaultListSelectionModel.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charvax/swing/DefaultListSelectionModel.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -123,11 +123,11 @@ */ public void addSelectionInterval(int index0, int index1) { - TreeSet range = getRange(index0, index1); + TreeSet<Integer> range = getRange(index0, index1); /* Find the differences */ - TreeSet newSelection = (TreeSet) _selection.clone(); + TreeSet<Integer> newSelection = new TreeSet<Integer>(_selection); newSelection.addAll(range); handleSelectionChange(newSelection); @@ -141,11 +141,11 @@ */ public void removeSelectionInterval(int index0, int index1) { - TreeSet range = getRange(index0, index1); + TreeSet<Integer> range = getRange(index0, index1); /* Find the differences */ - TreeSet newSelection = (TreeSet) _selection.clone(); + TreeSet<Integer> newSelection = new TreeSet<Integer>(_selection); newSelection.removeAll(range); handleSelectionChange(newSelection); @@ -158,7 +158,7 @@ */ public void setSelectionInterval(int index0, int index1) { - TreeSet newSelection = getRange(index0, index1); + TreeSet<Integer> newSelection = getRange(index0, index1); handleSelectionChange(newSelection); } @@ -196,7 +196,7 @@ ListSelectionEvent event = new ListSelectionEvent(this, firstindex_, lastindex_, false); - Iterator iter = _listeners.iterator(); + Iterator<ListSelectionListener> iter = _listeners.iterator(); while (iter.hasNext()) { ListSelectionListener l = (ListSelectionListener) iter.next(); @@ -207,7 +207,7 @@ /** Returns a TreeSet that contains the indices between index0 and index1 * inclusive. */ - private TreeSet getRange(int index0, int index1) { + private TreeSet<Integer> getRange(int index0, int index1) { int start = 0; int end = 0; @@ -218,19 +218,19 @@ start = index1; end = index0; } - TreeSet range = new TreeSet(); + TreeSet<Integer> range = new TreeSet<Integer>(); for (int i=start; i<=end; i++) { range.add(new Integer(i)); } return range; } - private void handleSelectionChange(TreeSet newSelection_) { + private void handleSelectionChange(TreeSet<Integer> newSelection_) { /* Find the differences between the old selection and the new * selection. */ - TreeSet copyOld = (TreeSet) _selection.clone(); - TreeSet differences = (TreeSet) newSelection_.clone(); + TreeSet<Integer> copyOld = new TreeSet<Integer>(_selection); + TreeSet<Integer> differences = new TreeSet<Integer>(newSelection_); differences.removeAll(_selection); copyOld.removeAll(newSelection_); @@ -253,11 +253,11 @@ /** The list of listeners. */ - protected ArrayList _listeners = new ArrayList(); + protected ArrayList<ListSelectionListener> _listeners = new ArrayList<ListSelectionListener>(); /** The set of selected indices. */ - protected TreeSet _selection = new TreeSet(); + protected TreeSet<Integer> _selection = new TreeSet<Integer>(); private int _selectionMode = ListSelectionModel.SINGLE_SELECTION; } Modified: branches/jikesRVM/textui/src/textui/charvax/swing/JComboBox.java =================================================================== --- branches/jikesRVM/textui/src/textui/charvax/swing/JComboBox.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charvax/swing/JComboBox.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -101,7 +101,7 @@ * Vector. * @param items_ the vector of items to display in the combobox */ - public JComboBox(Vector items_) + public JComboBox(Vector<?> items_) { DefaultComboBoxModel model = new DefaultComboBoxModel(items_); setModel(model); @@ -265,7 +265,7 @@ */ public void addItemListener(ItemListener il_) { if (_itemListeners == null) - _itemListeners = new Vector(); + _itemListeners = new Vector<ItemListener>(); _itemListeners.add(il_); } @@ -281,7 +281,7 @@ */ protected void fireItemStateChanged(ItemEvent ie_) { if (_itemListeners != null) { - for (Enumeration e = _itemListeners.elements(); + for (Enumeration<ItemListener> e = _itemListeners.elements(); e.hasMoreElements(); ) { ItemListener il = (ItemListener) e.nextElement(); @@ -308,7 +308,7 @@ */ public void addActionListener(ActionListener al_) { if (_actionListeners == null) - _actionListeners = new Vector(); + _actionListeners = new Vector<ActionListener>(); _actionListeners.add(al_); } @@ -317,7 +317,7 @@ */ protected void fireActionEvent(ActionEvent ae_) { if (_actionListeners != null) { - for (Enumeration e = _actionListeners.elements(); + for (Enumeration<ActionListener> e = _actionListeners.elements(); e.hasMoreElements(); ) { ActionListener al = (ActionListener) e.nextElement(); @@ -439,12 +439,12 @@ /** * A list of ActionListeners registered for this component. */ - protected Vector _actionListeners = null; + protected Vector<ActionListener> _actionListeners = null; /** * A list of ItemListeners registered for this component. */ - protected Vector _itemListeners = null; + protected Vector<ItemListener> _itemListeners = null; /** * This is a non-static inner class that implements the popup Modified: branches/jikesRVM/textui/src/textui/charvax/swing/JFileChooser.java =================================================================== --- branches/jikesRVM/textui/src/textui/charvax/swing/JFileChooser.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charvax/swing/JFileChooser.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -306,7 +306,7 @@ protected void fireFileChooserEvent() { - Enumeration e = _filelisteners.elements(); + Enumeration<FileChooserListener> e = _filelisteners.elements(); while (e.hasMoreElements()) { FileChooserListener l = (FileChooserListener) e.nextElement(); l.fileChanged(new FileChooserEvent(this)); @@ -326,7 +326,7 @@ protected boolean _cancelWasPressed = true; protected int _fileSelectionMode = FILES_ONLY; protected FileFilter _fileFilter = null; - protected Vector _filelisteners = new Vector(); + protected Vector<FileChooserListener> _filelisteners = new Vector<FileChooserListener>(); protected static final int _COLS = 50; protected static final int _ROWS = 20; @@ -656,15 +656,13 @@ * the Comparator interface. This will be used by the TreeSet * to keep the filenames in lexicographical order. */ - Comparator fileSorter = new Comparator() { - public int compare(Object obj1, Object obj2) { - String file1 = (String) obj1; - String file2 = (String) obj2; + Comparator<String> fileSorter = new Comparator<String>() { + public int compare(String file1, String file2) { return file1.compareTo(file2); } }; - TreeSet dirs = new TreeSet(fileSorter); + TreeSet<String> dirs = new TreeSet<String>(fileSorter); int numEntries = 0; for (int i=0; i<files.length; i++) { if (files[i].isDirectory()) { @@ -684,7 +682,7 @@ /* Copy the filenames from the TreeSet to the JList widget */ - Iterator iter = dirs.iterator(); + Iterator<String> iter = dirs.iterator(); while (iter.hasNext()) { listModel.addElement(iter.next()); } @@ -857,16 +855,16 @@ // end of inner class NewDirDialog - private interface FileChooserListener - extends EventListener + private interface FileChooserListener extends EventListener { public void fileChanged(FileChooserEvent e); } - private class FileChooserEvent - extends java.util.EventObject + private class FileChooserEvent extends java.util.EventObject { - public FileChooserEvent(Object source_) + private static final long serialVersionUID = 1L; + + public FileChooserEvent(Object source_) { super(source_); } Modified: branches/jikesRVM/textui/src/textui/charvax/swing/JList.java =================================================================== --- branches/jikesRVM/textui/src/textui/charvax/swing/JList.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charvax/swing/JList.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -84,7 +84,7 @@ /** * Construct a JList containing the items in the specified Vector. */ - public JList(Vector items_) + public JList(Vector<?> items_) { setListData(items_); } @@ -103,8 +103,8 @@ /** Constructs a ListModel from a Vector and then applies setModel to it. */ - public void setListData(Vector listData_) { - Enumeration e = listData_.elements(); + public void setListData(Vector<?> listData_) { + Enumeration<?> e = listData_.elements(); DefaultListModel model = new DefaultListModel(); while (e.hasMoreElements()) { @@ -205,7 +205,7 @@ * sorted in increasing index order. */ public int[] getSelectedIndices() { - ArrayList objects = new ArrayList(); + ArrayList<Integer> objects = new ArrayList<Integer>(); if ( ! _selectionModel.isSelectionEmpty()) { int first = _selectionModel.getMinSelectionIndex(); int last = _selectionModel.getMaxSelectionIndex(); @@ -217,7 +217,7 @@ int[] values = new int[objects.size()]; for (int i=0; i<values.length; i++) { - values[i] = ((Integer) objects.get(i)).intValue(); + values[i] = objects.get(i).intValue(); } return values; } @@ -241,7 +241,7 @@ * sorted in increasing index order. */ public Object[] getSelectedValues() { - ArrayList objects = new ArrayList(); + ArrayList<Object> objects = new ArrayList<Object>(); if ( ! _selectionModel.isSelectionEmpty()) { int first = _selectionModel.getMinSelectionIndex(); int last = _selectionModel.getMaxSelectionIndex(); @@ -589,7 +589,7 @@ */ public void addScrollListener(ScrollListener sl_) { if (_scrollListeners == null) - _scrollListeners = new Vector(); + _scrollListeners = new Vector<ScrollListener>(); _scrollListeners.add(sl_); } @@ -606,7 +606,7 @@ */ public void processScrollEvent(ScrollEvent e_) { if (_scrollListeners != null) { - for (Enumeration e = _scrollListeners.elements(); + for (Enumeration<ScrollListener> e = _scrollListeners.elements(); e.hasMoreElements(); ) { ScrollListener sl = (ScrollListener) e.nextElement(); @@ -647,6 +647,6 @@ /** A list of ScrollListeners registered for this JList. */ - private Vector _scrollListeners = null; + private Vector<ScrollListener> _scrollListeners = null; } Modified: branches/jikesRVM/textui/src/textui/charvax/swing/JMenu.java =================================================================== --- branches/jikesRVM/textui/src/textui/charvax/swing/JMenu.java 2009-09-09 15:49:36 UTC (rev 5669) +++ branches/jikesRVM/textui/src/textui/charvax/swing/JMenu.java 2009-09-09 15:52:30 UTC (rev 5670) @@ -104,9 +104,9 @@ { super.setForeground(color_); - Enumeration e = _menuItems.elements(); + Enumeration<Component> e = _menuItems.elements(); while (e.hasMoreElements()) { - Component c = (Component) e.nextElement(); + Component c = e.nextElement(); if (c.getForeground() == null) c.setForeground(color_); } @@ -121,9 +121,9 @@ { super.setBackground(color_); - Enumeration e = _menuItems.elements(); + Enumeration<Component> e = _menuItems.elements(); while (e.hasMoreElements()) { - Component c = (Component) e.nextElement(); + Component c = e.nextElement(); if (c.getBackground() == null) c.setBackground(color_); } @@ -311,7 +311,7 @@ */ void setParentMenu(Component parent_) { - _parentMenu = new WeakReference(parent_); + _parentMenu = new WeakReference<Component>(parent_); // If the colors of this menu have not been set yet, inherit the // colors of the parent. @@ -329,12 +329,12 @@ //==================================================================== // INSTANCE VARIABLES - private Vector _menuItems = new Vector(); + private Vector<Component> _menuItems = new Vector<Component>(); // Note that the reference to the parent is stored as a WeakReference // so that the parent can be garbage-collected when it no longer has // any strong references to it. - private WeakReference _parentMenu; + private WeakReference<Component> _parentMenu; private boolean _popupMenuVisible = false; //private final Point _popupMenuOrigin; Modified: branches/jikesRVM/textui/src/textui/charvax/swing/JPopupMenu.java ========================================... [truncated message content] |