Commit 2ce0d0b0 by Michael Koch Committed by Michael Koch

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
parent 98d3d336
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> 2003-03-30 Tom Tromey <tromey@redhat.com>
* java/lang/String.java (data, boffset, count): Documented. * java/lang/String.java (data, boffset, count): Documented.
......
...@@ -47,7 +47,10 @@ import javax.swing.event.*; ...@@ -47,7 +47,10 @@ import javax.swing.event.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public abstract class AbstractCellEditor implements CellEditor, Serializable { public abstract class AbstractCellEditor
implements CellEditor, Serializable
{
static final long serialVersionUID = -1048006551406220959L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -48,7 +48,10 @@ import javax.swing.event.*; ...@@ -48,7 +48,10 @@ import javax.swing.event.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public abstract class AbstractListModel implements ListModel, Serializable { public abstract class AbstractListModel
implements ListModel, Serializable
{
static final long serialVersionUID = -3285184064379168730L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -46,7 +46,9 @@ import java.util.*; ...@@ -46,7 +46,9 @@ import java.util.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class ActionMap implements Serializable { public class ActionMap implements Serializable
{
static final long serialVersionUID = -6277518704513986346L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
/* 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; package javax.swing;
import java.awt.*; import java.awt.*;
......
...@@ -44,6 +44,8 @@ import javax.swing.event.*; ...@@ -44,6 +44,8 @@ import javax.swing.event.*;
public class ButtonGroup implements Serializable public class ButtonGroup implements Serializable
{ {
static final long serialVersionUID = 4259076101881721375L;
Vector v = new Vector(); Vector v = new Vector();
ButtonModel sel; ButtonModel sel;
......
...@@ -47,7 +47,10 @@ import javax.swing.event.*; ...@@ -47,7 +47,10 @@ import javax.swing.event.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class DefaultBoundedRangeModel implements BoundedRangeModel, Serializable { public class DefaultBoundedRangeModel
implements BoundedRangeModel, Serializable
{
static final long serialVersionUID = 5034068491295259790L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -42,9 +42,11 @@ import java.awt.event.*; ...@@ -42,9 +42,11 @@ import java.awt.event.*;
import java.awt.*; import java.awt.*;
import javax.swing.event.*; import javax.swing.event.*;
public public class DefaultButtonModel
class DefaultButtonModel implements ButtonModel, java.io.Serializable implements ButtonModel, java.io.Serializable
{ {
static final long serialVersionUID = -5342609566534980231L;
Vector actions = new Vector(); Vector actions = new Vector();
Vector items = new Vector(); Vector items = new Vector();
......
...@@ -50,7 +50,11 @@ import javax.swing.tree.*; ...@@ -50,7 +50,11 @@ import javax.swing.tree.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @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 ---------------------------------------------------- // Classes ----------------------------------------------------
......
...@@ -47,7 +47,9 @@ import java.util.*; ...@@ -47,7 +47,9 @@ import java.util.*;
* @version 1.0 * @version 1.0
*/ */
public class DefaultComboBoxModel extends AbstractListModel public class DefaultComboBoxModel extends AbstractListModel
implements MutableComboBoxModel, Serializable { implements MutableComboBoxModel, Serializable
{
static final long serialVersionUID = 6698657703676921904L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -46,7 +46,9 @@ import java.io.*; ...@@ -46,7 +46,9 @@ import java.io.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class DefaultDesktopManager implements DesktopManager, Serializable { public class DefaultDesktopManager implements DesktopManager, Serializable
{
static final long serialVersionUID = 4657624909838017887L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -49,7 +49,9 @@ import javax.swing.plaf.*; ...@@ -49,7 +49,9 @@ import javax.swing.plaf.*;
* @version 1.0 * @version 1.0
*/ */
public class DefaultListCellRenderer extends JLabel public class DefaultListCellRenderer extends JLabel
implements ListCellRenderer, Serializable { implements ListCellRenderer, Serializable
{
static final long serialVersionUID = 7708947179685189462L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Classes ---------------------------------------------------- // Classes ----------------------------------------------------
......
...@@ -48,7 +48,9 @@ import javax.swing.event.*; ...@@ -48,7 +48,9 @@ import javax.swing.event.*;
* @version 1.0 * @version 1.0
*/ */
public class DefaultSingleSelectionModel implements public class DefaultSingleSelectionModel implements
SingleSelectionModel, Serializable { SingleSelectionModel, Serializable
{
static final long serialVersionUID = 3676229404753786004L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -46,7 +46,9 @@ import java.io.*; ...@@ -46,7 +46,9 @@ import java.io.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class InputMap implements Serializable { public class InputMap implements Serializable
{
static final long serialVersionUID = -5429059542008604257L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -61,6 +61,7 @@ import javax.accessibility.*; ...@@ -61,6 +61,7 @@ import javax.accessibility.*;
*/ */
public abstract class JComponent extends Container implements Serializable public abstract class JComponent extends Container implements Serializable
{ {
static final long serialVersionUID = -5242478962609715464L;
/** /**
* accessibleContext * accessibleContext
*/ */
......
...@@ -51,7 +51,11 @@ import javax.swing.event.*; ...@@ -51,7 +51,11 @@ import javax.swing.event.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @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 ---------------------------------------------------- // Classes ----------------------------------------------------
......
...@@ -49,7 +49,11 @@ import javax.swing.plaf.*; ...@@ -49,7 +49,11 @@ import javax.swing.plaf.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @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 ---------------------------------------------------- // Classes ----------------------------------------------------
......
...@@ -46,7 +46,9 @@ import java.io.*; ...@@ -46,7 +46,9 @@ import java.io.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class KeyStroke implements Serializable { public class KeyStroke implements Serializable
{
static final long serialVersionUID = -9060180771037902530L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -46,7 +46,10 @@ import java.io.*; ...@@ -46,7 +46,10 @@ import java.io.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class OverlayLayout implements LayoutManager2, Serializable { public class OverlayLayout
implements LayoutManager2, Serializable
{
static final long serialVersionUID = 18082829169631543L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -47,7 +47,10 @@ import javax.swing.plaf.*; ...@@ -47,7 +47,10 @@ import javax.swing.plaf.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class ScrollPaneLayout implements LayoutManager, ScrollPaneConstants, Serializable { public class ScrollPaneLayout
implements LayoutManager, ScrollPaneConstants, Serializable
{
static final long serialVersionUID = -4480022884523193743L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Classes ---------------------------------------------------- // Classes ----------------------------------------------------
......
...@@ -45,7 +45,9 @@ import java.io.*; ...@@ -45,7 +45,9 @@ import java.io.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class SizeRequirements implements Serializable { public class SizeRequirements implements Serializable
{
static final long serialVersionUID = 9217749429906736553L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -51,6 +51,8 @@ import java.beans.*; ...@@ -51,6 +51,8 @@ import java.beans.*;
public class UIManager implements Serializable public class UIManager implements Serializable
{ {
static final long serialVersionUID = -5547433830339189365L;
static class LookAndFeelInfo static class LookAndFeelInfo
{ {
String name, clazz; String name, clazz;
......
...@@ -46,7 +46,9 @@ import java.io.*; ...@@ -46,7 +46,9 @@ import java.io.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class ViewportLayout implements LayoutManager, Serializable { public class ViewportLayout implements LayoutManager, Serializable
{
static final long serialVersionUID = -788225906076097229L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Initialization --------------------------------------------- // Initialization ---------------------------------------------
......
...@@ -42,6 +42,8 @@ import java.awt.*; ...@@ -42,6 +42,8 @@ import java.awt.*;
public abstract class AbstractBorder implements Border, Serializable public abstract class AbstractBorder implements Border, Serializable
{ {
static final long serialVersionUID = -545885975315191844L;
AbstractBorder() AbstractBorder()
{ {
} }
......
...@@ -48,7 +48,9 @@ import javax.swing.event.*; ...@@ -48,7 +48,9 @@ import javax.swing.event.*;
* @version 1.0 * @version 1.0
*/ */
public class DefaultColorSelectionModel public class DefaultColorSelectionModel
implements ColorSelectionModel, Serializable { implements ColorSelectionModel, Serializable
{
static final long serialVersionUID = 580150227676302096L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -45,8 +45,9 @@ import java.util.EventListener; ...@@ -45,8 +45,9 @@ import java.util.EventListener;
* EventListenerList * EventListenerList
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class EventListenerList extends Object public class EventListenerList extends Object implements Serializable
implements Serializable { {
static final long serialVersionUID = -5677132037850737084L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -46,7 +46,9 @@ import javax.swing.event.*; ...@@ -46,7 +46,9 @@ import javax.swing.event.*;
* AbstractTableModel * AbstractTableModel
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public abstract class AbstractTableModel implements TableModel, Serializable { public abstract class AbstractTableModel implements TableModel, Serializable
{
static final long serialVersionUID = -5798593159423650347L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
/* 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; package javax.swing.table;
import java.awt.Component; import java.awt.Component;
import java.io.Serializable; import java.io.Serializable;
...@@ -9,6 +47,8 @@ import javax.swing.JTable; ...@@ -9,6 +47,8 @@ import javax.swing.JTable;
public class DefaultTableCellRenderer extends JLabel public class DefaultTableCellRenderer extends JLabel
implements TableCellRenderer, Serializable implements TableCellRenderer, Serializable
{ {
static final long serialVersionUID = 7878911414715528324L;
public static class UIResource extends DefaultTableCellRenderer public static class UIResource extends DefaultTableCellRenderer
implements javax.swing.plaf.UIResource implements javax.swing.plaf.UIResource
{ {
......
...@@ -49,7 +49,11 @@ import javax.swing.event.*; ...@@ -49,7 +49,11 @@ import javax.swing.event.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @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 -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -46,7 +46,10 @@ import javax.swing.event.*; ...@@ -46,7 +46,10 @@ import javax.swing.event.*;
* DefaultTableModel * DefaultTableModel
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class DefaultTableModel extends AbstractTableModel implements Serializable { public class DefaultTableModel extends AbstractTableModel
implements Serializable
{
static final long serialVersionUID = 6680042567037222321L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -47,7 +47,9 @@ import javax.swing.event.*; ...@@ -47,7 +47,9 @@ import javax.swing.event.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class TableColumn implements Serializable { public class TableColumn implements Serializable
{
static final long serialVersionUID = -6113660025878112608L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -50,7 +50,9 @@ import javax.swing.event.*; ...@@ -50,7 +50,9 @@ import javax.swing.event.*;
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class StyledEditorKit extends DefaultEditorKit { public class StyledEditorKit extends DefaultEditorKit
{
static final long serialVersionUID = 7002391892985555948L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Classes ---------------------------------------------------- // Classes ----------------------------------------------------
......
...@@ -45,7 +45,10 @@ import java.util.*; ...@@ -45,7 +45,10 @@ import java.util.*;
* DefaultMutableTreeNode * DefaultMutableTreeNode
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class DefaultMutableTreeNode implements Cloneable, MutableTreeNode, Serializable { public class DefaultMutableTreeNode
implements Cloneable, MutableTreeNode, Serializable
{
static final long serialVersionUID = -4298474751201349152L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -46,7 +46,9 @@ import javax.swing.event.*; ...@@ -46,7 +46,9 @@ import javax.swing.event.*;
* DefaultTreeModel * DefaultTreeModel
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class DefaultTreeModel implements Serializable, TreeModel { public class DefaultTreeModel implements Serializable, TreeModel
{
static final long serialVersionUID = -2621068368932566998L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -48,7 +48,10 @@ import javax.swing.event.*; ...@@ -48,7 +48,10 @@ import javax.swing.event.*;
* DefaultTreeSelectionModel * DefaultTreeSelectionModel
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class DefaultTreeSelectionModel implements Cloneable, Serializable, TreeSelectionModel { public class DefaultTreeSelectionModel
implements Cloneable, Serializable, TreeSelectionModel
{
static final long serialVersionUID = 3288129636638950196L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
...@@ -44,7 +44,9 @@ import java.io.*; ...@@ -44,7 +44,9 @@ import java.io.*;
* TreePath * TreePath
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class TreePath implements Serializable { public class TreePath implements Serializable
{
static final long serialVersionUID = 4380036194768077479L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
......
/* AbstractTableModel.java -- /* AbstractTableModel.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -44,171 +44,175 @@ import java.io.Serializable; ...@@ -44,171 +44,175 @@ import java.io.Serializable;
* AbstractUndoableEdit * AbstractUndoableEdit
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class AbstractUndoableEdit extends Object public class AbstractUndoableEdit implements UndoableEdit, Serializable
implements UndoableEdit, {
Serializable { static final long serialVersionUID = 580150227676302096L;
//------------------------------------------------------------- //-------------------------------------------------------------
// Constants -------------------------------------------------- // Constants --------------------------------------------------
//------------------------------------------------------------- //-------------------------------------------------------------
/** /**
* String returned by getRedoPresentationName() * String returned by getRedoPresentationName()
*/ */
protected static String RedoName = "Redo"; protected static final String RedoName = "Redo";
/** /**
* String returned by getUndoPresentationName() * String returned by getUndoPresentationName()
*/ */
protected static String UndoName = "Undo"; protected static final String UndoName = "Undo";
//------------------------------------------------------------- //-------------------------------------------------------------
// Variables -------------------------------------------------- // Variables --------------------------------------------------
//------------------------------------------------------------- //-------------------------------------------------------------
/** /**
* TODO * TODO
*/ */
private boolean hasBeenDone = false; private boolean hasBeenDone = false;
/** /**
* The edit is alive * The edit is alive
*/ */
private boolean alive = true; private boolean alive = true;
//------------------------------------------------------------- //-------------------------------------------------------------
// Initialization --------------------------------------------- // Initialization ---------------------------------------------
//------------------------------------------------------------- //-------------------------------------------------------------
/** /**
* Create new AbstractUndoableEdit * Create new AbstractUndoableEdit
*/ */
public AbstractUndoableEdit() { public AbstractUndoableEdit()
} // AbstractUndoableEdit() {
} // AbstractUndoableEdit()
//-------------------------------------------------------------
// Interface: UndoableEdit ------------------------------------ //-------------------------------------------------------------
//------------------------------------------------------------- // Interface: UndoableEdit ------------------------------------
//-------------------------------------------------------------
/**
* addEdit /**
* @param anEdit TODO * addEdit
* @returns TODO * @param anEdit TODO
*/ * @returns TODO
public boolean addEdit(UndoableEdit anEdit) { */
return false; public boolean addEdit(UndoableEdit anEdit)
} // addEdit() {
return false;
/** } // addEdit()
* canRedo()
* @returns true if redoable, false otherwise /**
*/ * canRedo()
public boolean canRedo() { * @returns true if redoable, false otherwise
if (alive == true && hasBeenDone == false) { */
return true; public boolean canRedo()
} // if {
return false; if (alive == true && hasBeenDone == false)
} // canRedo() return true;
return false;
/** } // canRedo()
* canUndo()
* @returns true if undoable, false otherwise /**
*/ * canUndo()
public boolean canUndo() { * @returns true if undoable, false otherwise
if (alive == true && hasBeenDone == true) { */
return true; public boolean canUndo()
} // if {
return false; if (alive == true && hasBeenDone == true)
} // canUndo() return true;
return false;
/** } // canUndo()
* die
*/ /**
public void die() { * die
alive = false; */
} // die() public void die()
{
/** alive = false;
* getPresentation } // die()
* @returns TODO
*/ /**
public String getPresentationName() { * getPresentation
return ""; * @returns TODO
} // getPresentationName() */
public String getPresentationName()
/** {
* getRedoPresentationName return "";
* @returns TODO } // getPresentationName()
*/
public String getRedoPresentationName() { /**
if (getPresentationName().equals("") == true) { * getRedoPresentationName
return RedoName; * @returns TODO
} else { */
return RedoName + " " + getPresentationName(); public String getRedoPresentationName()
} {
} // getRedoPresentationName() if (getPresentationName().equals(""))
return RedoName;
/** return RedoName + " " + getPresentationName();
* getUndoPresentationName } // getRedoPresentationName()
* @returns TODO
*/ /**
public String getUndoPresentationName() { * getUndoPresentationName
if (getPresentationName().equals("") == true) { * @returns TODO
return UndoName; */
} else { public String getUndoPresentationName()
return UndoName + " " + getPresentationName(); {
} if (getPresentationName().equals(""))
} // getUndoPresentationName() return UndoName;
return UndoName + " " + getPresentationName();
/** } // getUndoPresentationName()
* isSignificant
* @returns true /**
*/ * isSignificant
public boolean isSignificant() { * @returns true
return true; */
} // isSignificant() public boolean isSignificant()
{
/** return true;
* redo } // isSignificant()
* @throws CannotRedoException TODO
*/ /**
public void redo() throws CannotRedoException { * redo
if (canRedo() == false) { * @throws CannotRedoException TODO
throw new CannotRedoException(); */
} public void redo() throws CannotRedoException
hasBeenDone = true; {
} // redo() if (! canRedo())
throw new CannotRedoException();
/** hasBeenDone = true;
* replaceEdit } // redo()
* @param anEdit TODO
* @returns TODO /**
*/ * replaceEdit
public boolean replaceEdit(UndoableEdit anEdit) { * @param anEdit TODO
return false; * @returns TODO
} // replaceEdit() */
public boolean replaceEdit(UndoableEdit anEdit)
/** {
* String representation return false;
* @returns String representation } // replaceEdit()
*/
public String toString() { /**
return null; // TODO * String representation
} // toString() * @returns String representation
*/
/** public String toString()
* undo {
* @throws CannotUndoException TODO return (super.toString() + " hasBeenDone: " + hasBeenDone
*/ + " alive: " + alive);
public void undo() throws CannotUndoException { }
if (canUndo() == false) {
throw new CannotUndoException(); /**
} * undo
hasBeenDone = false; * @throws CannotUndoException TODO
} // undo() */
public void undo() throws CannotUndoException
{
if (! canUndo())
throw new CannotUndoException();
hasBeenDone = false;
} // undo()
} // AbstractUndoableEdit } // AbstractUndoableEdit
/* AbstractTableModel.java -- /* StateEdit.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -44,108 +44,133 @@ import java.util.*; ...@@ -44,108 +44,133 @@ import java.util.*;
* StateEdit * StateEdit
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class StateEdit extends AbstractUndoableEdit { public class StateEdit extends AbstractUndoableEdit
{
//-------------------------------------------------------------
// Variables -------------------------------------------------- //-------------------------------------------------------------
//------------------------------------------------------------- // Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* RCSID /**
*/ * RCSID
protected static final String RCSID = ""; // TODO */
protected static final String RCSID = ""; // TODO
/**
* object /**
*/ * object
protected StateEditable object; */
protected StateEditable object;
/**
* preState /**
*/ * preState
protected Hashtable preState; */
protected Hashtable preState;
/**
* postState /**
*/ * postState
protected Hashtable postState; */
protected Hashtable postState;
/**
* undoRedoName /**
*/ * undoRedoName
protected String undoRedoName; */
protected String undoRedoName;
//-------------------------------------------------------------
// Initialization --------------------------------------------- //-------------------------------------------------------------
//------------------------------------------------------------- // Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor StateEdit /**
* @param value0 TODO * Constructor StateEdit
*/ * @param obj Object to edit
public StateEdit(StateEditable value0) { */
// TODO public StateEdit(StateEditable obj)
} // StateEdit() {
init(obj, null);
/** }
* Constructor StateEdit
* @param value0 TODO /**
* @param value1 TODO * Constructor StateEdit
*/ * @param obj Object to edit
public StateEdit(StateEditable value0, String value1) { * @param name Presentation name
// TODO */
} // StateEdit() public StateEdit(StateEditable obj, String name)
{
init(obj, name);
//------------------------------------------------------------- }
// Methods ----------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
/** // Methods ----------------------------------------------------
* init //-------------------------------------------------------------
* @param value0 TODO
* @param value1 TODO /**
*/ * Initialize this object.
protected void init(StateEditable value0, String value1) { * @param obj Object to edit
// TODO * @param name Presentation name
} // init() */
protected void init(StateEditable obj, String name)
/** {
* end object = obj;
*/ undoRedoName = name;
public void end() { preState = new Hashtable();
// TODO postState = new Hashtable();
} // end() obj.storeState(preState);
}
/**
* undo /**
*/ * Indicate that all edits are finished, and update this object
public void undo() { * with final state.
// TODO */
} // undo() public void end()
{
/** object.storeState(postState);
* redo removeRedundantState();
*/ }
public void redo() {
// TODO /**
} // redo() * Undo this edit by applying the initial state to the edited object.
*/
/** public void undo()
* getPresentationName {
* @returns String object.restoreState(preState);
*/ }
public String getPresentationName() {
return null; // TODO /**
} // getPresentationName() * Undo this edit by applying the final state to the edited object.
*/
/** public void redo()
* removeRedundantState {
*/ object.restoreState(postState);
protected void removeRedundantState() { }
// TODO
} // removeRedundantState() /**
* Return the presentation name of this object.
* @returns The name, or null if not set
} // StateEdit */
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);
}
}
}
}
}
/* AbstractTableModel.java -- /* StateEditable.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -46,20 +46,20 @@ import java.util.Hashtable; ...@@ -46,20 +46,20 @@ import java.util.Hashtable;
*/ */
public interface StateEditable public interface StateEditable
{ {
/** /**
* Upon receiving this message the receiver should extract any relevant * Restore State
* state out of state
*
* @param state State * @param state State
*/ */
public void restoreState(Hashtable state); public void restoreState(Hashtable state);
/** /**
* Upon receiving this message the receiver should place any relevant state * Store State
* into state
*
* @param state State * @param state State
*/ */
public void storeState(Hashtable 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 } // StateEditable
/* AbstractTableModel.java -- /* UndoableEditSupport.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -45,126 +45,169 @@ import javax.swing.event.*; ...@@ -45,126 +45,169 @@ import javax.swing.event.*;
* UndoableEditSupport * UndoableEditSupport
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class UndoableEditSupport { public class UndoableEditSupport
{
//-------------------------------------------------------------
// Variables -------------------------------------------------- //-------------------------------------------------------------
//------------------------------------------------------------- // Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* updateLevel /**
*/ * updateLevel
protected int updateLevel; */
protected int updateLevel;
/**
* compoundEdit /**
*/ * compoundEdit
protected CompoundEdit compoundEdit; */
protected CompoundEdit compoundEdit;
/**
* listeners /**
*/ * listeners
protected Vector listeners = new Vector(); */
protected Vector listeners = new Vector();
/**
* realSource /**
*/ * realSource
protected Object realSource; */
protected Object realSource;
//-------------------------------------------------------------
// Initialization --------------------------------------------- //-------------------------------------------------------------
//------------------------------------------------------------- // Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor UndoableEditSupport /**
*/ * Constructor UndoableEditSupport
public UndoableEditSupport() { */
// TODO public UndoableEditSupport()
} // UndoableEditSupport() {
}
/**
* Constructor UndoableEditSupport /**
* @param object TODO * Constructor UndoableEditSupport
*/ * @param object TODO
public UndoableEditSupport(Object object) { */
realSource = object; public UndoableEditSupport(Object object)
} // UndoableEditSupport() {
realSource = object;
}
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//------------------------------------------------------------- //-------------------------------------------------------------
// Methods ----------------------------------------------------
/** //-------------------------------------------------------------
* toString
* @returns String /**
*/ * toString
public String toString() { * @returns String
return null; // TODO */
} // toString() public String toString()
{
/** return (super.toString() + " realSource: " + realSource
* addUndoableEditListener + " updateLevel: " + updateLevel);
* @param value0 TODO }
*/
public synchronized void addUndoableEditListener(UndoableEditListener value0) { /**
// TODO * Add a listener.
} // addUndoableEditListener() * @param val the listener
*/
/** public synchronized void addUndoableEditListener(UndoableEditListener val)
* removeUndoableEditListener {
* @param value0 TODO listeners.add(val);
*/ }
public synchronized void removeUndoableEditListener(UndoableEditListener value0) {
// TODO /**
} // removeUndoableEditListener() * Remove a listener.
* @param val the listener
/** */
* _postEdit public synchronized void removeUndoableEditListener(UndoableEditListener val)
* @param value0 TODO {
*/ listeners.removeElement(val);
protected void _postEdit(UndoableEdit value0) { }
// TODO
} // _postEdit() /**
* Return an array of all listeners.
/** * @returns all the listeners
* postEdit */
* @param value0 TODO public synchronized UndoableEditListener[] getUndoableEditListeners()
*/ {
public synchronized void postEdit(UndoableEdit value0) { UndoableEditListener[] result = new UndoableEditListener[listeners.size()];
// TODO return (UndoableEditListener[]) listeners.toArray(result);
} // postEdit() }
/** /**
* getUpdateLevel * _postEdit
* @returns int * @param value0 TODO
*/ */
public int getUpdateLevel() { protected void _postEdit(UndoableEdit edit)
return 0; // TODO {
} // getUpdateLevel() UndoableEditEvent event = new UndoableEditEvent(realSource, edit);
int max = listeners.size();
/** for (int i = 0; i < max; ++i)
* beginUpdate {
*/ UndoableEditListener l
public synchronized void beginUpdate() { = (UndoableEditListener) (listeners.elementAt(i));
// TODO l.undoableEditHappened(event);
} // beginUpdate() }
}
/**
* createCompoundEdit /**
* @returns CompoundEdit * postEdit
*/ * @param value0 TODO
protected CompoundEdit createCompoundEdit() { */
return null; // TODO public synchronized void postEdit(UndoableEdit edit)
} // createCompoundEdit() {
if (compoundEdit == null)
/** compoundEdit.addEdit(edit);
* endUpdate else
*/ _postEdit(edit);
public synchronized void endUpdate() { }
// TODO
} // endUpdate() /**
* getUpdateLevel
* @returns int
} // UndoableEditSupport */
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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment