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
This commit is contained in:
Michael Koch 2003-03-31 06:30:01 +00:00 committed by Michael Koch
parent 98d3d33620
commit 2ce0d0b097
40 changed files with 649 additions and 376 deletions

View File

@ -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.

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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.*;

View File

@ -44,6 +44,8 @@ import javax.swing.event.*;
public class ButtonGroup implements Serializable
{
static final long serialVersionUID = 4259076101881721375L;
Vector v = new Vector();
ButtonModel sel;

View File

@ -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 --------------------------------------------------

View File

@ -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();

View File

@ -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 ----------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 ----------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -61,6 +61,7 @@ import javax.accessibility.*;
*/
public abstract class JComponent extends Container implements Serializable
{
static final long serialVersionUID = -5242478962609715464L;
/**
* accessibleContext
*/

View File

@ -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 ----------------------------------------------------

View File

@ -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 ----------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 ----------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -51,6 +51,8 @@ import java.beans.*;
public class UIManager implements Serializable
{
static final long serialVersionUID = -5547433830339189365L;
static class LookAndFeelInfo
{
String name, clazz;

View File

@ -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 ---------------------------------------------

View File

@ -42,6 +42,8 @@ import java.awt.*;
public abstract class AbstractBorder implements Border, Serializable
{
static final long serialVersionUID = -545885975315191844L;
AbstractBorder()
{
}

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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
{

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 ----------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 --------------------------------------------------

View File

@ -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 {
public class AbstractUndoableEdit implements UndoableEdit, Serializable
{
static final long serialVersionUID = 580150227676302096L;
//-------------------------------------------------------------
// Constants --------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Constants --------------------------------------------------
//-------------------------------------------------------------
/**
* String returned by getRedoPresentationName()
*/
protected static String RedoName = "Redo";
/**
* String returned by getRedoPresentationName()
*/
protected static final String RedoName = "Redo";
/**
* String returned by getUndoPresentationName()
*/
protected static String UndoName = "Undo";
/**
* String returned by getUndoPresentationName()
*/
protected static final String UndoName = "Undo";
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* TODO
*/
private boolean hasBeenDone = false;
/**
* TODO
*/
private boolean hasBeenDone = false;
/**
* The edit is alive
*/
private boolean alive = true;
/**
* The edit is alive
*/
private boolean alive = true;
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Create new AbstractUndoableEdit
*/
public AbstractUndoableEdit() {
} // AbstractUndoableEdit()
/**
* Create new AbstractUndoableEdit
*/
public AbstractUndoableEdit()
{
} // AbstractUndoableEdit()
//-------------------------------------------------------------
// Interface: UndoableEdit ------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Interface: UndoableEdit ------------------------------------
//-------------------------------------------------------------
/**
* addEdit
* @param anEdit TODO
* @returns TODO
*/
public boolean addEdit(UndoableEdit anEdit) {
return false;
} // addEdit()
/**
* 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()
/**
* 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;
} // if
return false;
} // canUndo()
/**
* 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()
/**
* die
*/
public void die()
{
alive = false;
} // die()
/**
* getPresentation
* @returns TODO
*/
public String getPresentationName() {
return "";
} // getPresentationName()
/**
* 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()
/**
* getRedoPresentationName
* @returns TODO
*/
public String getRedoPresentationName()
{
if (getPresentationName().equals(""))
return RedoName;
return RedoName + " " + getPresentationName();
} // getRedoPresentationName()
/**
* getUndoPresentationName
* @returns TODO
*/
public String getUndoPresentationName() {
if (getPresentationName().equals("") == true) {
return UndoName;
} else {
return UndoName + " " + getPresentationName();
}
} // getUndoPresentationName()
/**
* getUndoPresentationName
* @returns TODO
*/
public String getUndoPresentationName()
{
if (getPresentationName().equals(""))
return UndoName;
return UndoName + " " + getPresentationName();
} // getUndoPresentationName()
/**
* isSignificant
* @returns true
*/
public boolean isSignificant() {
return true;
} // isSignificant()
/**
* 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()
/**
* 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 null; // TODO
} // toString()
/**
* undo
* @throws CannotUndoException TODO
*/
public void undo() throws CannotUndoException {
if (canUndo() == false) {
throw new CannotUndoException();
}
hasBeenDone = false;
} // undo()
/**
* 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

View File

@ -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 {
public class StateEdit extends AbstractUndoableEdit
{
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* RCSID
*/
protected static final String RCSID = ""; // TODO
/**
* RCSID
*/
protected static final String RCSID = ""; // TODO
/**
* object
*/
protected StateEditable object;
/**
* object
*/
protected StateEditable object;
/**
* preState
*/
protected Hashtable preState;
/**
* preState
*/
protected Hashtable preState;
/**
* postState
*/
protected Hashtable postState;
/**
* postState
*/
protected Hashtable postState;
/**
* undoRedoName
*/
protected String undoRedoName;
/**
* undoRedoName
*/
protected String undoRedoName;
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor StateEdit
* @param value0 TODO
*/
public StateEdit(StateEditable value0) {
// TODO
} // StateEdit()
/**
* Constructor StateEdit
* @param obj Object to edit
*/
public StateEdit(StateEditable obj)
{
init(obj, null);
}
/**
* Constructor StateEdit
* @param value0 TODO
* @param value1 TODO
*/
public StateEdit(StateEditable value0, String value1) {
// TODO
} // StateEdit()
/**
* Constructor StateEdit
* @param obj Object to edit
* @param name Presentation name
*/
public StateEdit(StateEditable obj, String name)
{
init(obj, name);
}
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/**
* init
* @param value0 TODO
* @param value1 TODO
*/
protected void init(StateEditable value0, String value1) {
// TODO
} // init()
/**
* 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);
}
/**
* end
*/
public void end() {
// TODO
} // end()
/**
* Indicate that all edits are finished, and update this object
* with final state.
*/
public void end()
{
object.storeState(postState);
removeRedundantState();
}
/**
* undo
*/
public void undo() {
// TODO
} // undo()
/**
* Undo this edit by applying the initial state to the edited object.
*/
public void undo()
{
object.restoreState(preState);
}
/**
* redo
*/
public void redo() {
// TODO
} // redo()
/**
* Undo this edit by applying the final state to the edited object.
*/
public void redo()
{
object.restoreState(postState);
}
/**
* getPresentationName
* @returns String
*/
public String getPresentationName() {
return null; // TODO
} // getPresentationName()
/**
* Return the presentation name of this object.
* @returns The name, or null if not set
*/
public String getPresentationName()
{
return undoRedoName;
}
/**
* removeRedundantState
*/
protected void removeRedundantState() {
// TODO
} // removeRedundantState()
} // StateEdit
/**
* 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);
}
}
}
}
}

View File

@ -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

View File

@ -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 {
public class UndoableEditSupport
{
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* updateLevel
*/
protected int updateLevel;
/**
* updateLevel
*/
protected int updateLevel;
/**
* compoundEdit
*/
protected CompoundEdit compoundEdit;
/**
* compoundEdit
*/
protected CompoundEdit compoundEdit;
/**
* listeners
*/
protected Vector listeners = new Vector();
/**
* listeners
*/
protected Vector listeners = new Vector();
/**
* realSource
*/
protected Object realSource;
/**
* realSource
*/
protected Object realSource;
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor UndoableEditSupport
*/
public UndoableEditSupport() {
// TODO
} // UndoableEditSupport()
/**
* Constructor UndoableEditSupport
*/
public UndoableEditSupport()
{
}
/**
* Constructor UndoableEditSupport
* @param object TODO
*/
public UndoableEditSupport(Object object) {
realSource = object;
} // UndoableEditSupport()
/**
* Constructor UndoableEditSupport
* @param object TODO
*/
public UndoableEditSupport(Object object)
{
realSource = object;
}
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/**
* toString
* @returns String
*/
public String toString() {
return null; // TODO
} // toString()
/**
* toString
* @returns String
*/
public String toString()
{
return (super.toString() + " realSource: " + realSource
+ " updateLevel: " + updateLevel);
}
/**
* addUndoableEditListener
* @param value0 TODO
*/
public synchronized void addUndoableEditListener(UndoableEditListener value0) {
// TODO
} // addUndoableEditListener()
/**
* Add a listener.
* @param val the listener
*/
public synchronized void addUndoableEditListener(UndoableEditListener val)
{
listeners.add(val);
}
/**
* removeUndoableEditListener
* @param value0 TODO
*/
public synchronized void removeUndoableEditListener(UndoableEditListener value0) {
// TODO
} // removeUndoableEditListener()
/**
* Remove a listener.
* @param val the listener
*/
public synchronized void removeUndoableEditListener(UndoableEditListener val)
{
listeners.removeElement(val);
}
/**
* _postEdit
* @param value0 TODO
*/
protected void _postEdit(UndoableEdit value0) {
// TODO
} // _postEdit()
/**
* 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
*/
public synchronized void postEdit(UndoableEdit value0) {
// TODO
} // postEdit()
/**
* _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);
}
}
/**
* getUpdateLevel
* @returns int
*/
public int getUpdateLevel() {
return 0; // TODO
} // getUpdateLevel()
/**
* postEdit
* @param value0 TODO
*/
public synchronized void postEdit(UndoableEdit edit)
{
if (compoundEdit == null)
compoundEdit.addEdit(edit);
else
_postEdit(edit);
}
/**
* beginUpdate
*/
public synchronized void beginUpdate() {
// TODO
} // beginUpdate()
/**
* getUpdateLevel
* @returns int
*/
public int getUpdateLevel()
{
return updateLevel;
}
/**
* createCompoundEdit
* @returns CompoundEdit
*/
protected CompoundEdit createCompoundEdit() {
return null; // TODO
} // createCompoundEdit()
/**
* beginUpdate
*/
public synchronized void beginUpdate()
{
if (compoundEdit != null)
{
// FIXME: what? We can't push a new one. This isn't even
// documented anyway.
endUpdate();
}
/**
* endUpdate
*/
public synchronized void endUpdate() {
// TODO
} // endUpdate()
compoundEdit = createCompoundEdit();
++updateLevel;
}
/**
* createCompoundEdit
* @returns CompoundEdit
*/
protected CompoundEdit createCompoundEdit()
{
return new CompoundEdit();
}
} // UndoableEditSupport
/**
* endUpdate
*/
public synchronized void endUpdate()
{
// FIXME: assert updateLevel == 1;
compoundEdit.end();
CompoundEdit c = compoundEdit;
compoundEdit = null;
--updateLevel;
_postEdit(c);
}
}