diff options
author | Michael Koch <konqueror@gmx.de> | 2003-03-31 06:30:01 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-03-31 06:30:01 +0000 |
commit | 2ce0d0b097225538935a0ac9e1b713c024183547 (patch) | |
tree | 14b48288634510a2d92d2fedc668b585e82853f6 /libjava | |
parent | 98d3d336205c751fcf2f6a31a5b5553994556060 (diff) | |
download | gcc-2ce0d0b097225538935a0ac9e1b713c024183547.zip gcc-2ce0d0b097225538935a0ac9e1b713c024183547.tar.gz gcc-2ce0d0b097225538935a0ac9e1b713c024183547.tar.bz2 |
AbstractCellEditor.java, [...]: Merges from classpath.
2003-03-31 Michael Koch <konqueror@gmx.de>
* javax/swing/AbstractCellEditor.java,
javax/swing/AbstractListModel.java,
javax/swing/ActionMap.java,
javax/swing/BorderFactory.java,
javax/swing/ButtonGroup.java,
javax/swing/DefaultBoundedRangeModel.java,
javax/swing/DefaultButtonModel.java,
javax/swing/DefaultCellEditor.java,
javax/swing/DefaultComboBoxModel.java,
javax/swing/DefaultDesktopManager.java,
javax/swing/DefaultListCellRenderer.java,
javax/swing/DefaultSingleSelectionModel.java,
javax/swing/InputMap.java,
javax/swing/JComponent.java,
javax/swing/JMenu.java,
javax/swing/JSlider.java,
javax/swing/KeyStroke.java,
javax/swing/OverlayLayout.java,
javax/swing/ScrollPaneLayout.java,
javax/swing/SizeRequirements.java,
javax/swing/UIManager.java,
javax/swing/ViewportLayout.java,
javax/swing/border/AbstractBorder.java,
javax/swing/colorchooser/DefaultColorSelectionModel.java,
javax/swing/event/EventListenerList.java,
javax/swing/table/AbstractTableModel.java,
javax/swing/table/DefaultTableCellRenderer.java,
javax/swing/table/DefaultTableColumnModel.java,
javax/swing/table/DefaultTableModel.java,
javax/swing/table/TableColumn.java,
javax/swing/text/StyledEditorKit.java,
javax/swing/tree/DefaultMutableTreeNode.java,
javax/swing/tree/DefaultTreeModel.java,
javax/swing/tree/DefaultTreeSelectionModel.java,
javax/swing/tree/TreePath.java,
javax/swing/undo/AbstractUndoableEdit.java,
javax/swing/undo/StateEdit.java,
javax/swing/undo/StateEditable.java,
javax/swing/undo/UndoableEditSupport.java:
Merges from classpath.
From-SVN: r65077
Diffstat (limited to 'libjava')
40 files changed, 713 insertions, 440 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 84b6b6c..142e27c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,46 @@ +2003-03-31 Michael Koch <konqueror@gmx.de> + + * javax/swing/AbstractCellEditor.java, + javax/swing/AbstractListModel.java, + javax/swing/ActionMap.java, + javax/swing/BorderFactory.java, + javax/swing/ButtonGroup.java, + javax/swing/DefaultBoundedRangeModel.java, + javax/swing/DefaultButtonModel.java, + javax/swing/DefaultCellEditor.java, + javax/swing/DefaultComboBoxModel.java, + javax/swing/DefaultDesktopManager.java, + javax/swing/DefaultListCellRenderer.java, + javax/swing/DefaultSingleSelectionModel.java, + javax/swing/InputMap.java, + javax/swing/JComponent.java, + javax/swing/JMenu.java, + javax/swing/JSlider.java, + javax/swing/KeyStroke.java, + javax/swing/OverlayLayout.java, + javax/swing/ScrollPaneLayout.java, + javax/swing/SizeRequirements.java, + javax/swing/UIManager.java, + javax/swing/ViewportLayout.java, + javax/swing/border/AbstractBorder.java, + javax/swing/colorchooser/DefaultColorSelectionModel.java, + javax/swing/event/EventListenerList.java, + javax/swing/table/AbstractTableModel.java, + javax/swing/table/DefaultTableCellRenderer.java, + javax/swing/table/DefaultTableColumnModel.java, + javax/swing/table/DefaultTableModel.java, + javax/swing/table/TableColumn.java, + javax/swing/text/StyledEditorKit.java, + javax/swing/tree/DefaultMutableTreeNode.java, + javax/swing/tree/DefaultTreeModel.java, + javax/swing/tree/DefaultTreeSelectionModel.java, + javax/swing/tree/TreePath.java, + javax/swing/undo/AbstractUndoableEdit.java, + javax/swing/undo/StateEdit.java, + javax/swing/undo/StateEditable.java, + javax/swing/undo/UndoableEditSupport.java: + Merges from classpath. + 2003-03-30 Tom Tromey <tromey@redhat.com> * java/lang/String.java (data, boffset, count): Documented. diff --git a/libjava/javax/swing/AbstractCellEditor.java b/libjava/javax/swing/AbstractCellEditor.java index 098aa99..e25e97b 100644 --- a/libjava/javax/swing/AbstractCellEditor.java +++ b/libjava/javax/swing/AbstractCellEditor.java @@ -47,7 +47,10 @@ import javax.swing.event.*; * @author Andrew Selkirk * @version 1.0 */ -public abstract class AbstractCellEditor implements CellEditor, Serializable { +public abstract class AbstractCellEditor + implements CellEditor, Serializable +{ + static final long serialVersionUID = -1048006551406220959L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/AbstractListModel.java b/libjava/javax/swing/AbstractListModel.java index f1033cf..4f7e827 100644 --- a/libjava/javax/swing/AbstractListModel.java +++ b/libjava/javax/swing/AbstractListModel.java @@ -48,7 +48,10 @@ import javax.swing.event.*; * @author Andrew Selkirk * @version 1.0 */ -public abstract class AbstractListModel implements ListModel, Serializable { +public abstract class AbstractListModel + implements ListModel, Serializable +{ + static final long serialVersionUID = -3285184064379168730L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/ActionMap.java b/libjava/javax/swing/ActionMap.java index b95144d..ea9e0aa 100644 --- a/libjava/javax/swing/ActionMap.java +++ b/libjava/javax/swing/ActionMap.java @@ -46,7 +46,9 @@ import java.util.*; * @author Andrew Selkirk * @version 1.0 */ -public class ActionMap implements Serializable { +public class ActionMap implements Serializable +{ + static final long serialVersionUID = -6277518704513986346L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/BorderFactory.java b/libjava/javax/swing/BorderFactory.java index 4a4433c..808144f 100644 --- a/libjava/javax/swing/BorderFactory.java +++ b/libjava/javax/swing/BorderFactory.java @@ -1,3 +1,41 @@ +/* BorderFactory.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + package javax.swing; import java.awt.*; diff --git a/libjava/javax/swing/ButtonGroup.java b/libjava/javax/swing/ButtonGroup.java index 2301e51..502d084 100644 --- a/libjava/javax/swing/ButtonGroup.java +++ b/libjava/javax/swing/ButtonGroup.java @@ -44,6 +44,8 @@ import javax.swing.event.*; public class ButtonGroup implements Serializable { + static final long serialVersionUID = 4259076101881721375L; + Vector v = new Vector(); ButtonModel sel; diff --git a/libjava/javax/swing/DefaultBoundedRangeModel.java b/libjava/javax/swing/DefaultBoundedRangeModel.java index a0b1abd..c6ea1d0 100644 --- a/libjava/javax/swing/DefaultBoundedRangeModel.java +++ b/libjava/javax/swing/DefaultBoundedRangeModel.java @@ -47,7 +47,10 @@ import javax.swing.event.*; * @author Andrew Selkirk * @version 1.0 */ -public class DefaultBoundedRangeModel implements BoundedRangeModel, Serializable { +public class DefaultBoundedRangeModel + implements BoundedRangeModel, Serializable +{ + static final long serialVersionUID = 5034068491295259790L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/DefaultButtonModel.java b/libjava/javax/swing/DefaultButtonModel.java index 1dc0c8c..9d6f408 100644 --- a/libjava/javax/swing/DefaultButtonModel.java +++ b/libjava/javax/swing/DefaultButtonModel.java @@ -42,9 +42,11 @@ import java.awt.event.*; import java.awt.*; import javax.swing.event.*; -public -class DefaultButtonModel implements ButtonModel, java.io.Serializable +public class DefaultButtonModel + implements ButtonModel, java.io.Serializable { + static final long serialVersionUID = -5342609566534980231L; + Vector actions = new Vector(); Vector items = new Vector(); diff --git a/libjava/javax/swing/DefaultCellEditor.java b/libjava/javax/swing/DefaultCellEditor.java index 3f9442e..5e35701 100644 --- a/libjava/javax/swing/DefaultCellEditor.java +++ b/libjava/javax/swing/DefaultCellEditor.java @@ -50,7 +50,11 @@ import javax.swing.tree.*; * @author Andrew Selkirk * @version 1.0 */ -public class DefaultCellEditor extends AbstractCellEditor implements TableCellEditor, TreeCellEditor { +public class DefaultCellEditor + extends AbstractCellEditor + implements TableCellEditor, TreeCellEditor +{ + static final long serialVersionUID = 3564035141373880027L; //------------------------------------------------------------- // Classes ---------------------------------------------------- diff --git a/libjava/javax/swing/DefaultComboBoxModel.java b/libjava/javax/swing/DefaultComboBoxModel.java index 2ceb15a..5c8361a 100644 --- a/libjava/javax/swing/DefaultComboBoxModel.java +++ b/libjava/javax/swing/DefaultComboBoxModel.java @@ -47,7 +47,9 @@ import java.util.*; * @version 1.0 */ public class DefaultComboBoxModel extends AbstractListModel - implements MutableComboBoxModel, Serializable { + implements MutableComboBoxModel, Serializable +{ + static final long serialVersionUID = 6698657703676921904L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/DefaultDesktopManager.java b/libjava/javax/swing/DefaultDesktopManager.java index 5581e58..132fb61 100644 --- a/libjava/javax/swing/DefaultDesktopManager.java +++ b/libjava/javax/swing/DefaultDesktopManager.java @@ -46,7 +46,9 @@ import java.io.*; * @author Andrew Selkirk * @version 1.0 */ -public class DefaultDesktopManager implements DesktopManager, Serializable { +public class DefaultDesktopManager implements DesktopManager, Serializable +{ + static final long serialVersionUID = 4657624909838017887L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/DefaultListCellRenderer.java b/libjava/javax/swing/DefaultListCellRenderer.java index c6f8809..204c4ec 100644 --- a/libjava/javax/swing/DefaultListCellRenderer.java +++ b/libjava/javax/swing/DefaultListCellRenderer.java @@ -49,7 +49,9 @@ import javax.swing.plaf.*; * @version 1.0 */ public class DefaultListCellRenderer extends JLabel - implements ListCellRenderer, Serializable { + implements ListCellRenderer, Serializable +{ + static final long serialVersionUID = 7708947179685189462L; //------------------------------------------------------------- // Classes ---------------------------------------------------- diff --git a/libjava/javax/swing/DefaultSingleSelectionModel.java b/libjava/javax/swing/DefaultSingleSelectionModel.java index a55c911..0f6e280 100644 --- a/libjava/javax/swing/DefaultSingleSelectionModel.java +++ b/libjava/javax/swing/DefaultSingleSelectionModel.java @@ -48,7 +48,9 @@ import javax.swing.event.*; * @version 1.0 */ public class DefaultSingleSelectionModel implements - SingleSelectionModel, Serializable { + SingleSelectionModel, Serializable +{ + static final long serialVersionUID = 3676229404753786004L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/InputMap.java b/libjava/javax/swing/InputMap.java index 9f81121..861fe57 100644 --- a/libjava/javax/swing/InputMap.java +++ b/libjava/javax/swing/InputMap.java @@ -46,7 +46,9 @@ import java.io.*; * @author Andrew Selkirk * @version 1.0 */ -public class InputMap implements Serializable { +public class InputMap implements Serializable +{ + static final long serialVersionUID = -5429059542008604257L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/JComponent.java b/libjava/javax/swing/JComponent.java index fad7b6c..119e385 100644 --- a/libjava/javax/swing/JComponent.java +++ b/libjava/javax/swing/JComponent.java @@ -61,6 +61,7 @@ import javax.accessibility.*; */ public abstract class JComponent extends Container implements Serializable { + static final long serialVersionUID = -5242478962609715464L; /** * accessibleContext */ diff --git a/libjava/javax/swing/JMenu.java b/libjava/javax/swing/JMenu.java index 0d4d868..961d802 100644 --- a/libjava/javax/swing/JMenu.java +++ b/libjava/javax/swing/JMenu.java @@ -51,7 +51,11 @@ import javax.swing.event.*; * @author Andrew Selkirk * @version 1.0 */ -public class JMenu extends JMenuItem implements Accessible, MenuElement { +public class JMenu + extends JMenuItem + implements Accessible, MenuElement +{ + static final long serialVersionUID = 4227225638931828014L; //------------------------------------------------------------- // Classes ---------------------------------------------------- diff --git a/libjava/javax/swing/JSlider.java b/libjava/javax/swing/JSlider.java index e058828..58475b6 100644 --- a/libjava/javax/swing/JSlider.java +++ b/libjava/javax/swing/JSlider.java @@ -49,7 +49,11 @@ import javax.swing.plaf.*; * @author Andrew Selkirk * @version 1.0 */ -public class JSlider extends JComponent implements SwingConstants, Accessible { +public class JSlider + extends JComponent + implements SwingConstants, Accessible +{ + static final long serialVersionUID = -1441275936141218479L; //------------------------------------------------------------- // Classes ---------------------------------------------------- diff --git a/libjava/javax/swing/KeyStroke.java b/libjava/javax/swing/KeyStroke.java index b2687cd..7fe0699 100644 --- a/libjava/javax/swing/KeyStroke.java +++ b/libjava/javax/swing/KeyStroke.java @@ -46,7 +46,9 @@ import java.io.*; * @author Andrew Selkirk * @version 1.0 */ -public class KeyStroke implements Serializable { +public class KeyStroke implements Serializable +{ + static final long serialVersionUID = -9060180771037902530L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/OverlayLayout.java b/libjava/javax/swing/OverlayLayout.java index a238a436..4698e10 100644 --- a/libjava/javax/swing/OverlayLayout.java +++ b/libjava/javax/swing/OverlayLayout.java @@ -46,7 +46,10 @@ import java.io.*; * @author Andrew Selkirk * @version 1.0 */ -public class OverlayLayout implements LayoutManager2, Serializable { +public class OverlayLayout + implements LayoutManager2, Serializable +{ + static final long serialVersionUID = 18082829169631543L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/ScrollPaneLayout.java b/libjava/javax/swing/ScrollPaneLayout.java index 503113e..bd65471 100644 --- a/libjava/javax/swing/ScrollPaneLayout.java +++ b/libjava/javax/swing/ScrollPaneLayout.java @@ -47,7 +47,10 @@ import javax.swing.plaf.*; * @author Andrew Selkirk * @version 1.0 */ -public class ScrollPaneLayout implements LayoutManager, ScrollPaneConstants, Serializable { +public class ScrollPaneLayout + implements LayoutManager, ScrollPaneConstants, Serializable +{ + static final long serialVersionUID = -4480022884523193743L; //------------------------------------------------------------- // Classes ---------------------------------------------------- diff --git a/libjava/javax/swing/SizeRequirements.java b/libjava/javax/swing/SizeRequirements.java index 4b5edf5..da6d112 100644 --- a/libjava/javax/swing/SizeRequirements.java +++ b/libjava/javax/swing/SizeRequirements.java @@ -45,7 +45,9 @@ import java.io.*; * @author Andrew Selkirk * @version 1.0 */ -public class SizeRequirements implements Serializable { +public class SizeRequirements implements Serializable +{ + static final long serialVersionUID = 9217749429906736553L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/UIManager.java b/libjava/javax/swing/UIManager.java index 18eebe3..8feaccf 100644 --- a/libjava/javax/swing/UIManager.java +++ b/libjava/javax/swing/UIManager.java @@ -51,6 +51,8 @@ import java.beans.*; public class UIManager implements Serializable { + static final long serialVersionUID = -5547433830339189365L; + static class LookAndFeelInfo { String name, clazz; diff --git a/libjava/javax/swing/ViewportLayout.java b/libjava/javax/swing/ViewportLayout.java index f5beb76..f735fe6 100644 --- a/libjava/javax/swing/ViewportLayout.java +++ b/libjava/javax/swing/ViewportLayout.java @@ -46,7 +46,9 @@ import java.io.*; * @author Andrew Selkirk * @version 1.0 */ -public class ViewportLayout implements LayoutManager, Serializable { +public class ViewportLayout implements LayoutManager, Serializable +{ + static final long serialVersionUID = -788225906076097229L; //------------------------------------------------------------- // Initialization --------------------------------------------- diff --git a/libjava/javax/swing/border/AbstractBorder.java b/libjava/javax/swing/border/AbstractBorder.java index 9716654..d0285b3 100644 --- a/libjava/javax/swing/border/AbstractBorder.java +++ b/libjava/javax/swing/border/AbstractBorder.java @@ -42,6 +42,8 @@ import java.awt.*; public abstract class AbstractBorder implements Border, Serializable { + static final long serialVersionUID = -545885975315191844L; + AbstractBorder() { } diff --git a/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java b/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java index 74bf064..1df4e32 100644 --- a/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java +++ b/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java @@ -48,7 +48,9 @@ import javax.swing.event.*; * @version 1.0 */ public class DefaultColorSelectionModel - implements ColorSelectionModel, Serializable { + implements ColorSelectionModel, Serializable +{ + static final long serialVersionUID = 580150227676302096L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/event/EventListenerList.java b/libjava/javax/swing/event/EventListenerList.java index 5017aa5..1197ccb 100644 --- a/libjava/javax/swing/event/EventListenerList.java +++ b/libjava/javax/swing/event/EventListenerList.java @@ -45,8 +45,9 @@ import java.util.EventListener; * EventListenerList * @author Andrew Selkirk */ -public class EventListenerList extends Object - implements Serializable { +public class EventListenerList extends Object implements Serializable +{ + static final long serialVersionUID = -5677132037850737084L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/table/AbstractTableModel.java b/libjava/javax/swing/table/AbstractTableModel.java index 790568f..08eeb82 100644 --- a/libjava/javax/swing/table/AbstractTableModel.java +++ b/libjava/javax/swing/table/AbstractTableModel.java @@ -46,7 +46,9 @@ import javax.swing.event.*; * AbstractTableModel * @author Andrew Selkirk */ -public abstract class AbstractTableModel implements TableModel, Serializable { +public abstract class AbstractTableModel implements TableModel, Serializable +{ + static final long serialVersionUID = -5798593159423650347L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/table/DefaultTableCellRenderer.java b/libjava/javax/swing/table/DefaultTableCellRenderer.java index 63c8db2..a7bcc5c 100644 --- a/libjava/javax/swing/table/DefaultTableCellRenderer.java +++ b/libjava/javax/swing/table/DefaultTableCellRenderer.java @@ -1,3 +1,41 @@ +/* DefaultTableCellRenderer.java + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + package javax.swing.table; import java.awt.Component; import java.io.Serializable; @@ -9,6 +47,8 @@ import javax.swing.JTable; public class DefaultTableCellRenderer extends JLabel implements TableCellRenderer, Serializable { + static final long serialVersionUID = 7878911414715528324L; + public static class UIResource extends DefaultTableCellRenderer implements javax.swing.plaf.UIResource { diff --git a/libjava/javax/swing/table/DefaultTableColumnModel.java b/libjava/javax/swing/table/DefaultTableColumnModel.java index 0ead6bd..9ab2fff 100644 --- a/libjava/javax/swing/table/DefaultTableColumnModel.java +++ b/libjava/javax/swing/table/DefaultTableColumnModel.java @@ -49,7 +49,11 @@ import javax.swing.event.*; * @author Andrew Selkirk * @version 1.0 */ -public class DefaultTableColumnModel implements TableColumnModel, PropertyChangeListener, ListSelectionListener, Serializable { +public class DefaultTableColumnModel + implements TableColumnModel, PropertyChangeListener, + ListSelectionListener, Serializable +{ + static final long serialVersionUID = 6580012493508960512L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/table/DefaultTableModel.java b/libjava/javax/swing/table/DefaultTableModel.java index 3815bb9..1587310 100644 --- a/libjava/javax/swing/table/DefaultTableModel.java +++ b/libjava/javax/swing/table/DefaultTableModel.java @@ -46,7 +46,10 @@ import javax.swing.event.*; * DefaultTableModel * @author Andrew Selkirk */ -public class DefaultTableModel extends AbstractTableModel implements Serializable { +public class DefaultTableModel extends AbstractTableModel + implements Serializable +{ + static final long serialVersionUID = 6680042567037222321L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/table/TableColumn.java b/libjava/javax/swing/table/TableColumn.java index 8be7c19..f5ace62 100644 --- a/libjava/javax/swing/table/TableColumn.java +++ b/libjava/javax/swing/table/TableColumn.java @@ -47,7 +47,9 @@ import javax.swing.event.*; * @author Andrew Selkirk * @version 1.0 */ -public class TableColumn implements Serializable { +public class TableColumn implements Serializable +{ + static final long serialVersionUID = -6113660025878112608L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/text/StyledEditorKit.java b/libjava/javax/swing/text/StyledEditorKit.java index 84b27bd..16af630 100644 --- a/libjava/javax/swing/text/StyledEditorKit.java +++ b/libjava/javax/swing/text/StyledEditorKit.java @@ -50,7 +50,9 @@ import javax.swing.event.*; * @author Andrew Selkirk * @version 1.0 */ -public class StyledEditorKit extends DefaultEditorKit { +public class StyledEditorKit extends DefaultEditorKit +{ + static final long serialVersionUID = 7002391892985555948L; //------------------------------------------------------------- // Classes ---------------------------------------------------- diff --git a/libjava/javax/swing/tree/DefaultMutableTreeNode.java b/libjava/javax/swing/tree/DefaultMutableTreeNode.java index 288b0ed..0c2b545 100644 --- a/libjava/javax/swing/tree/DefaultMutableTreeNode.java +++ b/libjava/javax/swing/tree/DefaultMutableTreeNode.java @@ -45,7 +45,10 @@ import java.util.*; * DefaultMutableTreeNode * @author Andrew Selkirk */ -public class DefaultMutableTreeNode implements Cloneable, MutableTreeNode, Serializable { +public class DefaultMutableTreeNode + implements Cloneable, MutableTreeNode, Serializable +{ + static final long serialVersionUID = -4298474751201349152L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/tree/DefaultTreeModel.java b/libjava/javax/swing/tree/DefaultTreeModel.java index daf3f11..d905be9 100644 --- a/libjava/javax/swing/tree/DefaultTreeModel.java +++ b/libjava/javax/swing/tree/DefaultTreeModel.java @@ -46,7 +46,9 @@ import javax.swing.event.*; * DefaultTreeModel * @author Andrew Selkirk */ -public class DefaultTreeModel implements Serializable, TreeModel { +public class DefaultTreeModel implements Serializable, TreeModel +{ + static final long serialVersionUID = -2621068368932566998L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/tree/DefaultTreeSelectionModel.java b/libjava/javax/swing/tree/DefaultTreeSelectionModel.java index f772c18..9b53582 100644 --- a/libjava/javax/swing/tree/DefaultTreeSelectionModel.java +++ b/libjava/javax/swing/tree/DefaultTreeSelectionModel.java @@ -48,7 +48,10 @@ import javax.swing.event.*; * DefaultTreeSelectionModel * @author Andrew Selkirk */ -public class DefaultTreeSelectionModel implements Cloneable, Serializable, TreeSelectionModel { +public class DefaultTreeSelectionModel + implements Cloneable, Serializable, TreeSelectionModel +{ + static final long serialVersionUID = 3288129636638950196L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/tree/TreePath.java b/libjava/javax/swing/tree/TreePath.java index 56899cf..77627db 100644 --- a/libjava/javax/swing/tree/TreePath.java +++ b/libjava/javax/swing/tree/TreePath.java @@ -44,7 +44,9 @@ import java.io.*; * TreePath * @author Andrew Selkirk */ -public class TreePath implements Serializable { +public class TreePath implements Serializable +{ + static final long serialVersionUID = 4380036194768077479L; //------------------------------------------------------------- // Variables -------------------------------------------------- diff --git a/libjava/javax/swing/undo/AbstractUndoableEdit.java b/libjava/javax/swing/undo/AbstractUndoableEdit.java index e98b87c..68c2813 100644 --- a/libjava/javax/swing/undo/AbstractUndoableEdit.java +++ b/libjava/javax/swing/undo/AbstractUndoableEdit.java @@ -1,5 +1,5 @@ /* AbstractTableModel.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -44,171 +44,175 @@ import java.io.Serializable; * AbstractUndoableEdit * @author Andrew Selkirk */ -public class AbstractUndoableEdit extends Object - implements UndoableEdit, - Serializable { - - //------------------------------------------------------------- - // Constants -------------------------------------------------- - //------------------------------------------------------------- - - /** - * String returned by getRedoPresentationName() - */ - protected static String RedoName = "Redo"; - - /** - * String returned by getUndoPresentationName() - */ - protected static String UndoName = "Undo"; - - - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * TODO - */ - private boolean hasBeenDone = false; - - /** - * The edit is alive - */ - private boolean alive = true; - - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * Create new AbstractUndoableEdit - */ - public AbstractUndoableEdit() { - } // AbstractUndoableEdit() - - - //------------------------------------------------------------- - // Interface: UndoableEdit ------------------------------------ - //------------------------------------------------------------- - - /** - * addEdit - * @param anEdit TODO - * @returns TODO - */ - public boolean addEdit(UndoableEdit anEdit) { - return false; - } // addEdit() - - /** - * canRedo() - * @returns true if redoable, false otherwise - */ - public boolean canRedo() { - if (alive == true && hasBeenDone == false) { - return true; - } // if - return false; - } // canRedo() - - /** - * canUndo() - * @returns true if undoable, false otherwise - */ - public boolean canUndo() { - if (alive == true && hasBeenDone == true) { - return true; - } // if - return false; - } // canUndo() - - /** - * die - */ - public void die() { - alive = false; - } // die() - - /** - * getPresentation - * @returns TODO - */ - public String getPresentationName() { - return ""; - } // getPresentationName() - - /** - * getRedoPresentationName - * @returns TODO - */ - public String getRedoPresentationName() { - if (getPresentationName().equals("") == true) { - return RedoName; - } else { - return RedoName + " " + getPresentationName(); - } - } // getRedoPresentationName() - - /** - * getUndoPresentationName - * @returns TODO - */ - public String getUndoPresentationName() { - if (getPresentationName().equals("") == true) { - return UndoName; - } else { - return UndoName + " " + getPresentationName(); - } - } // getUndoPresentationName() - - /** - * isSignificant - * @returns true - */ - public boolean isSignificant() { - return true; - } // isSignificant() - - /** - * redo - * @throws CannotRedoException TODO - */ - public void redo() throws CannotRedoException { - if (canRedo() == false) { - throw new CannotRedoException(); - } - hasBeenDone = true; - } // redo() - - /** - * replaceEdit - * @param anEdit TODO - * @returns TODO - */ - public boolean replaceEdit(UndoableEdit anEdit) { - return false; - } // replaceEdit() - - /** - * String representation - * @returns String representation - */ - public String toString() { - return null; // TODO - } // toString() - - /** - * undo - * @throws CannotUndoException TODO - */ - public void undo() throws CannotUndoException { - if (canUndo() == false) { - throw new CannotUndoException(); - } - hasBeenDone = false; - } // undo() - - +public class AbstractUndoableEdit implements UndoableEdit, Serializable +{ + static final long serialVersionUID = 580150227676302096L; + + //------------------------------------------------------------- + // Constants -------------------------------------------------- + //------------------------------------------------------------- + + /** + * String returned by getRedoPresentationName() + */ + protected static final String RedoName = "Redo"; + + /** + * String returned by getUndoPresentationName() + */ + protected static final String UndoName = "Undo"; + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * TODO + */ + private boolean hasBeenDone = false; + + /** + * The edit is alive + */ + private boolean alive = true; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Create new AbstractUndoableEdit + */ + public AbstractUndoableEdit() + { + } // AbstractUndoableEdit() + + + //------------------------------------------------------------- + // Interface: UndoableEdit ------------------------------------ + //------------------------------------------------------------- + + /** + * addEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean addEdit(UndoableEdit anEdit) + { + return false; + } // addEdit() + + /** + * canRedo() + * @returns true if redoable, false otherwise + */ + public boolean canRedo() + { + if (alive == true && hasBeenDone == false) + return true; + return false; + } // canRedo() + + /** + * canUndo() + * @returns true if undoable, false otherwise + */ + public boolean canUndo() + { + if (alive == true && hasBeenDone == true) + return true; + return false; + } // canUndo() + + /** + * die + */ + public void die() + { + alive = false; + } // die() + + /** + * getPresentation + * @returns TODO + */ + public String getPresentationName() + { + return ""; + } // getPresentationName() + + /** + * getRedoPresentationName + * @returns TODO + */ + public String getRedoPresentationName() + { + if (getPresentationName().equals("")) + return RedoName; + return RedoName + " " + getPresentationName(); + } // getRedoPresentationName() + + /** + * getUndoPresentationName + * @returns TODO + */ + public String getUndoPresentationName() + { + if (getPresentationName().equals("")) + return UndoName; + return UndoName + " " + getPresentationName(); + } // getUndoPresentationName() + + /** + * isSignificant + * @returns true + */ + public boolean isSignificant() + { + return true; + } // isSignificant() + + /** + * redo + * @throws CannotRedoException TODO + */ + public void redo() throws CannotRedoException + { + if (! canRedo()) + throw new CannotRedoException(); + hasBeenDone = true; + } // redo() + + /** + * replaceEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean replaceEdit(UndoableEdit anEdit) + { + return false; + } // replaceEdit() + + /** + * String representation + * @returns String representation + */ + public String toString() + { + return (super.toString() + " hasBeenDone: " + hasBeenDone + + " alive: " + alive); + } + + /** + * undo + * @throws CannotUndoException TODO + */ + public void undo() throws CannotUndoException + { + if (! canUndo()) + throw new CannotUndoException(); + hasBeenDone = false; + } // undo() } // AbstractUndoableEdit diff --git a/libjava/javax/swing/undo/StateEdit.java b/libjava/javax/swing/undo/StateEdit.java index a56564b..f617bc3 100644 --- a/libjava/javax/swing/undo/StateEdit.java +++ b/libjava/javax/swing/undo/StateEdit.java @@ -1,5 +1,5 @@ -/* AbstractTableModel.java -- - Copyright (C) 2002 Free Software Foundation, Inc. +/* StateEdit.java -- + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -44,108 +44,133 @@ import java.util.*; * StateEdit * @author Andrew Selkirk */ -public class StateEdit extends AbstractUndoableEdit { - - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * RCSID - */ - protected static final String RCSID = ""; // TODO - - /** - * object - */ - protected StateEditable object; - - /** - * preState - */ - protected Hashtable preState; - - /** - * postState - */ - protected Hashtable postState; - - /** - * undoRedoName - */ - protected String undoRedoName; - - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * Constructor StateEdit - * @param value0 TODO - */ - public StateEdit(StateEditable value0) { - // TODO - } // StateEdit() - - /** - * Constructor StateEdit - * @param value0 TODO - * @param value1 TODO - */ - public StateEdit(StateEditable value0, String value1) { - // TODO - } // StateEdit() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * init - * @param value0 TODO - * @param value1 TODO - */ - protected void init(StateEditable value0, String value1) { - // TODO - } // init() - - /** - * end - */ - public void end() { - // TODO - } // end() - - /** - * undo - */ - public void undo() { - // TODO - } // undo() - - /** - * redo - */ - public void redo() { - // TODO - } // redo() - - /** - * getPresentationName - * @returns String - */ - public String getPresentationName() { - return null; // TODO - } // getPresentationName() - - /** - * removeRedundantState - */ - protected void removeRedundantState() { - // TODO - } // removeRedundantState() - - -} // StateEdit +public class StateEdit extends AbstractUndoableEdit +{ + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * RCSID + */ + protected static final String RCSID = ""; // TODO + + /** + * object + */ + protected StateEditable object; + + /** + * preState + */ + protected Hashtable preState; + + /** + * postState + */ + protected Hashtable postState; + + /** + * undoRedoName + */ + protected String undoRedoName; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor StateEdit + * @param obj Object to edit + */ + public StateEdit(StateEditable obj) + { + init(obj, null); + } + + /** + * Constructor StateEdit + * @param obj Object to edit + * @param name Presentation name + */ + public StateEdit(StateEditable obj, String name) + { + init(obj, name); + } + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * Initialize this object. + * @param obj Object to edit + * @param name Presentation name + */ + protected void init(StateEditable obj, String name) + { + object = obj; + undoRedoName = name; + preState = new Hashtable(); + postState = new Hashtable(); + obj.storeState(preState); + } + + /** + * Indicate that all edits are finished, and update this object + * with final state. + */ + public void end() + { + object.storeState(postState); + removeRedundantState(); + } + + /** + * Undo this edit by applying the initial state to the edited object. + */ + public void undo() + { + object.restoreState(preState); + } + + /** + * Undo this edit by applying the final state to the edited object. + */ + public void redo() + { + object.restoreState(postState); + } + + /** + * Return the presentation name of this object. + * @returns The name, or null if not set + */ + public String getPresentationName() + { + return undoRedoName; + } + + /** + * removeRedundantState + */ + protected void removeRedundantState() + { + Iterator i = preState.keySet().iterator(); + while (i.hasNext()) + { + Object key = i.next(); + if (postState.containsKey(key)) + { + if (preState.get(key).equals(postState.get(key))) + { + i.remove(); + postState.remove(key); + } + } + } + } +} diff --git a/libjava/javax/swing/undo/StateEditable.java b/libjava/javax/swing/undo/StateEditable.java index 76eedad..d757438 100644 --- a/libjava/javax/swing/undo/StateEditable.java +++ b/libjava/javax/swing/undo/StateEditable.java @@ -1,5 +1,5 @@ -/* AbstractTableModel.java -- - Copyright (C) 2002 Free Software Foundation, Inc. +/* StateEditable.java -- + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,20 +46,20 @@ import java.util.Hashtable; */ public interface StateEditable { - /** - * Upon receiving this message the receiver should extract any relevant - * state out of state - * + * Restore State * @param state State */ public void restoreState(Hashtable state); /** - * Upon receiving this message the receiver should place any relevant state - * into state - * + * Store State * @param state State */ public void storeState(Hashtable state); + + /** + * For some reason, Sun made the RCS IDs visible. + */ + public static final String RCSID = "We aren't compatible"; } // StateEditable diff --git a/libjava/javax/swing/undo/UndoableEditSupport.java b/libjava/javax/swing/undo/UndoableEditSupport.java index 6f87398..f09f3ff 100644 --- a/libjava/javax/swing/undo/UndoableEditSupport.java +++ b/libjava/javax/swing/undo/UndoableEditSupport.java @@ -1,5 +1,5 @@ -/* AbstractTableModel.java -- - Copyright (C) 2002 Free Software Foundation, Inc. +/* UndoableEditSupport.java -- + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,126 +45,169 @@ import javax.swing.event.*; * UndoableEditSupport * @author Andrew Selkirk */ -public class UndoableEditSupport { - - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * updateLevel - */ - protected int updateLevel; - - /** - * compoundEdit - */ - protected CompoundEdit compoundEdit; - - /** - * listeners - */ - protected Vector listeners = new Vector(); - - /** - * realSource - */ - protected Object realSource; - - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * Constructor UndoableEditSupport - */ - public UndoableEditSupport() { - // TODO - } // UndoableEditSupport() - - /** - * Constructor UndoableEditSupport - * @param object TODO - */ - public UndoableEditSupport(Object object) { - realSource = object; - } // UndoableEditSupport() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * toString - * @returns String - */ - public String toString() { - return null; // TODO - } // toString() - - /** - * addUndoableEditListener - * @param value0 TODO - */ - public synchronized void addUndoableEditListener(UndoableEditListener value0) { - // TODO - } // addUndoableEditListener() - - /** - * removeUndoableEditListener - * @param value0 TODO - */ - public synchronized void removeUndoableEditListener(UndoableEditListener value0) { - // TODO - } // removeUndoableEditListener() - - /** - * _postEdit - * @param value0 TODO - */ - protected void _postEdit(UndoableEdit value0) { - // TODO - } // _postEdit() - - /** - * postEdit - * @param value0 TODO - */ - public synchronized void postEdit(UndoableEdit value0) { - // TODO - } // postEdit() - - /** - * getUpdateLevel - * @returns int - */ - public int getUpdateLevel() { - return 0; // TODO - } // getUpdateLevel() - - /** - * beginUpdate - */ - public synchronized void beginUpdate() { - // TODO - } // beginUpdate() - - /** - * createCompoundEdit - * @returns CompoundEdit - */ - protected CompoundEdit createCompoundEdit() { - return null; // TODO - } // createCompoundEdit() - - /** - * endUpdate - */ - public synchronized void endUpdate() { - // TODO - } // endUpdate() - - -} // UndoableEditSupport +public class UndoableEditSupport +{ + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * updateLevel + */ + protected int updateLevel; + + /** + * compoundEdit + */ + protected CompoundEdit compoundEdit; + + /** + * listeners + */ + protected Vector listeners = new Vector(); + + /** + * realSource + */ + protected Object realSource; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor UndoableEditSupport + */ + public UndoableEditSupport() + { + } + + /** + * Constructor UndoableEditSupport + * @param object TODO + */ + public UndoableEditSupport(Object object) + { + realSource = object; + } + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * toString + * @returns String + */ + public String toString() + { + return (super.toString() + " realSource: " + realSource + + " updateLevel: " + updateLevel); + } + + /** + * Add a listener. + * @param val the listener + */ + public synchronized void addUndoableEditListener(UndoableEditListener val) + { + listeners.add(val); + } + + /** + * Remove a listener. + * @param val the listener + */ + public synchronized void removeUndoableEditListener(UndoableEditListener val) + { + listeners.removeElement(val); + } + + /** + * Return an array of all listeners. + * @returns all the listeners + */ + public synchronized UndoableEditListener[] getUndoableEditListeners() + { + UndoableEditListener[] result = new UndoableEditListener[listeners.size()]; + return (UndoableEditListener[]) listeners.toArray(result); + } + + /** + * _postEdit + * @param value0 TODO + */ + protected void _postEdit(UndoableEdit edit) + { + UndoableEditEvent event = new UndoableEditEvent(realSource, edit); + int max = listeners.size(); + for (int i = 0; i < max; ++i) + { + UndoableEditListener l + = (UndoableEditListener) (listeners.elementAt(i)); + l.undoableEditHappened(event); + } + } + + /** + * postEdit + * @param value0 TODO + */ + public synchronized void postEdit(UndoableEdit edit) + { + if (compoundEdit == null) + compoundEdit.addEdit(edit); + else + _postEdit(edit); + } + + /** + * getUpdateLevel + * @returns int + */ + public int getUpdateLevel() + { + return updateLevel; + } + + /** + * beginUpdate + */ + public synchronized void beginUpdate() + { + if (compoundEdit != null) + { + // FIXME: what? We can't push a new one. This isn't even + // documented anyway. + endUpdate(); + } + + compoundEdit = createCompoundEdit(); + ++updateLevel; + } + + /** + * createCompoundEdit + * @returns CompoundEdit + */ + protected CompoundEdit createCompoundEdit() + { + return new CompoundEdit(); + } + + /** + * endUpdate + */ + public synchronized void endUpdate() + { + // FIXME: assert updateLevel == 1; + compoundEdit.end(); + CompoundEdit c = compoundEdit; + compoundEdit = null; + --updateLevel; + _postEdit(c); + } +} |