diff options
Diffstat (limited to 'libjava/classpath/javax/swing/event')
44 files changed, 4327 insertions, 0 deletions
diff --git a/libjava/classpath/javax/swing/event/AncestorEvent.java b/libjava/classpath/javax/swing/event/AncestorEvent.java new file mode 100644 index 00000000000..d06c6e39612 --- /dev/null +++ b/libjava/classpath/javax/swing/event/AncestorEvent.java @@ -0,0 +1,100 @@ +/* AncestorEvent.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.awt.AWTEvent; +import java.awt.Container; + +import javax.swing.JComponent; + +/** + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public class AncestorEvent extends AWTEvent +{ + private static final long serialVersionUID = -8079801679695605002L; + + public static final int ANCESTOR_ADDED = 1; + public static final int ANCESTOR_REMOVED = 2; + public static final int ANCESTOR_MOVED = 3; + + private JComponent sourceComponent; + private Container ancestor; + private Container ancestorParent; + + /** + * @param source Source component + * @param id ID + * @param ancestor ancestor + * @param ancestorParent parent ancestor + */ + public AncestorEvent(JComponent source, int id, Container ancestor, + Container ancestorParent) + { + super(source, id); + this.sourceComponent = source; + this.ancestor = ancestor; + this.ancestorParent = ancestorParent; + } + + /** + * Returns the ancestor of this event. + */ + public Container getAncestor() + { + return ancestor; + } + + /** + * Returns the ancester parent of this event. + */ + public Container getAncestorParent() + { + return ancestorParent; + } + + /** + * Returns the source of this event. + */ + public JComponent getComponent() + { + return sourceComponent; + } +} diff --git a/libjava/classpath/javax/swing/event/AncestorListener.java b/libjava/classpath/javax/swing/event/AncestorListener.java new file mode 100644 index 00000000000..61d5aedb7c9 --- /dev/null +++ b/libjava/classpath/javax/swing/event/AncestorListener.java @@ -0,0 +1,69 @@ +/* AncestorListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * AncestorListener Interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public interface AncestorListener extends EventListener { + + /** + * Ancestor Added + * @param event Ancestor Event + */ + void ancestorAdded(AncestorEvent event); + + /** + * Ancestor Removed + * @param event Ancestor Event + */ + void ancestorRemoved(AncestorEvent event); + + /** + * Ancestor Moved + * @param event Ancestor Event + */ + void ancestorMoved(AncestorEvent event); + + +} // AncestorListener diff --git a/libjava/classpath/javax/swing/event/CaretEvent.java b/libjava/classpath/javax/swing/event/CaretEvent.java new file mode 100644 index 00000000000..c4870a8008f --- /dev/null +++ b/libjava/classpath/javax/swing/event/CaretEvent.java @@ -0,0 +1,79 @@ +/* CaretEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventObject; + +/** + * CaretEvent + * @author Andrew Selkirk + */ +public abstract class CaretEvent extends EventObject { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * CaretEvent constructor + * @param source Source object + */ + public CaretEvent(Object source) { + super(source); + } // CaretEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * Get caret location + * @returns the dot + */ + public abstract int getDot(); + + /** + * Get mark + * @returns the mark + */ + public abstract int getMark(); + + +} // CaretEvent diff --git a/libjava/classpath/javax/swing/event/CaretListener.java b/libjava/classpath/javax/swing/event/CaretListener.java new file mode 100644 index 00000000000..aeee434e50b --- /dev/null +++ b/libjava/classpath/javax/swing/event/CaretListener.java @@ -0,0 +1,56 @@ +/* CaretListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * CaretListener public interface + * @author Andrew Selkirk + */ +public interface CaretListener extends EventListener { + + /** + * Caret position has been updated + * @param event Caret Event + */ + void caretUpdate(CaretEvent event); + + +} // CaretListener diff --git a/libjava/classpath/javax/swing/event/CellEditorListener.java b/libjava/classpath/javax/swing/event/CellEditorListener.java new file mode 100644 index 00000000000..d2dd5bab8ec --- /dev/null +++ b/libjava/classpath/javax/swing/event/CellEditorListener.java @@ -0,0 +1,62 @@ +/* CellEditorListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * CellEditorListener public interface + * @author Andrew Selkirk + */ +public interface CellEditorListener extends EventListener { + + /** + * Editing has been canceled + * @param event Change Event + */ + void editingCanceled(ChangeEvent event); + + /** + * Editing has been stopped + * @param event Change Event + */ + void editingStopped(ChangeEvent event); + + +} // CellEditorListener diff --git a/libjava/classpath/javax/swing/event/ChangeEvent.java b/libjava/classpath/javax/swing/event/ChangeEvent.java new file mode 100644 index 00000000000..f75c15aac83 --- /dev/null +++ b/libjava/classpath/javax/swing/event/ChangeEvent.java @@ -0,0 +1,59 @@ +/* ChangeEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventObject; + +/** + * ChangeEvent + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public class ChangeEvent extends EventObject { + + /** + * ChangeEvent constructor + * @param source Source object + */ + public ChangeEvent(Object source) { + super(source); + } // ChangeEvent() + + +} // ChangeEvent diff --git a/libjava/classpath/javax/swing/event/ChangeListener.java b/libjava/classpath/javax/swing/event/ChangeListener.java new file mode 100644 index 00000000000..1e58b1d82d9 --- /dev/null +++ b/libjava/classpath/javax/swing/event/ChangeListener.java @@ -0,0 +1,57 @@ +/* ChangeListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * ChangeListener interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public interface ChangeListener extends EventListener { + + /** + * State changed + * @param event Change Event + */ + void stateChanged(ChangeEvent event); + + +} // ChangeListener diff --git a/libjava/classpath/javax/swing/event/DocumentEvent.java b/libjava/classpath/javax/swing/event/DocumentEvent.java new file mode 100644 index 00000000000..6a005ea7a5b --- /dev/null +++ b/libjava/classpath/javax/swing/event/DocumentEvent.java @@ -0,0 +1,166 @@ +/* DocumentEvent.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import javax.swing.text.Document; +import javax.swing.text.Element; + +/** + * DocumentEvent public interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public interface DocumentEvent { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * ElementChange public interface + */ + public interface ElementChange { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getIndex + * @returns int + */ + int getIndex(); + + /** + * getElement + * @returns Element + */ + Element getElement(); + + /** + * getChildrenRemoved + * @returns Element[] + */ + Element[] getChildrenRemoved(); + + /** + * getChildrenAdded + * @returns Element[] + */ + Element[] getChildrenAdded(); + + + } // ElementChange + + /** + * EventType + */ + class EventType + { + /** + * INSERT + */ + public static final EventType INSERT = new EventType("INSERT"); // TODO + + /** + * REMOVE + */ + public static final EventType REMOVE = new EventType("REMOVE"); // TODO + + /** + * CHANGE + */ + public static final EventType CHANGE = new EventType("CHANGE"); // TODO + + /** + * typeString + */ + private String type; + + /** + * Constructor EventType + * @param type TODO + */ + private EventType(String type) + { + this.type = type; + } + + /** + * toString + * @returns String + */ + public String toString() + { + return type; + } + } + + /** + * getType + * @returns EventType + */ + EventType getType(); + + /** + * getOffset + * @returns int + */ + int getOffset(); + + /** + * getLength + * @returns int + */ + int getLength(); + + /** + * getDocument + * @returns Document + */ + Document getDocument(); + + /** + * getChange + * @param element TODO + * @returns ElementChange + */ + ElementChange getChange(Element element); + + +} // DocumentEvent diff --git a/libjava/classpath/javax/swing/event/DocumentListener.java b/libjava/classpath/javax/swing/event/DocumentListener.java new file mode 100644 index 00000000000..df5e784e40f --- /dev/null +++ b/libjava/classpath/javax/swing/event/DocumentListener.java @@ -0,0 +1,68 @@ +/* DocumentListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventListener; + +/** + * DocumentListener public interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public interface DocumentListener extends EventListener { + + /** + * Changed update + * @param event Document Event + */ + void changedUpdate(DocumentEvent event); + + /** + * Insert update + * @param event Document Event + */ + void insertUpdate(DocumentEvent event); + + /** + * Remove update + * @param event Document Event + */ + void removeUpdate(DocumentEvent event); + + +} // DocumentListener diff --git a/libjava/classpath/javax/swing/event/EventListenerList.java b/libjava/classpath/javax/swing/event/EventListenerList.java new file mode 100644 index 00000000000..ea14d4d1474 --- /dev/null +++ b/libjava/classpath/javax/swing/event/EventListenerList.java @@ -0,0 +1,302 @@ +/* EventListenerList.java -- + Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.io.Serializable; +import java.lang.reflect.Array; +import java.util.EventListener; + + +/** + * A utility class for keeping track of {@link EventListener}s. + * + * <p><b>Example for using this class:</b> + * + * <blockquote><pre> import java.util.EventListener; + * import javax.swing.event.EventListenerList; + * + * class Foo + * { + * protected final EventListenerList listeners = new EventListenerList(); + * protected BarClosedEvent barClosedEvent = null; + * + * public void addBarListener(BarListener l) + * { + * listeners.<a href="#add(java.lang.Class, java.util.EventListener)" + * >add</a>(BarListener.class, l); + * } + * + * public void removeBarListener(BarListener l) + * { + * listeners.<a href="#remove(java.lang.Class, java.util.EventListener)" + * >remove</a>(BarListener.class, l); + * } + * + * protected void fireBarClosedEvent() + * { + * Object[] l = listeners.<a href="#getListenerList()" + * >getListenerList()</a>; + * + * for (int i = l.length - 2; i >= 0; i -= 2) + * if (l[i] == BarListener.class) + * { + * // Create the event on demand, when it is needed the first time. + * if (barClosedEvent == null) + * barClosedEvent = new BarClosedEvent(this); + * + * ((BarClosedListener) l[i + 1]).barClosed(barClosedEvent); + * } + * } + * }</pre></blockquote> + * + * @author Andrew Selkirk (aselkirk@sympatico.ca) + * @author Sascha Brawer (brawer@dandelis.ch) + */ +public class EventListenerList + implements Serializable +{ + /** + * An ID for serializing instances of this class; verified with the + * serialver tool of Sun J2SE 1.4.1_01. + */ + static final long serialVersionUID = -5677132037850737084L; + + + /** + * An empty array that is shared by all instances of this class that + * have no listeners. + */ + private static final Object[] NO_LISTENERS = new Object[0]; + + + /** + * An array with all currently registered listeners. The array has + * twice as many elements as there are listeners. For an even + * integer <code>i</code>, <code>listenerList[i]</code> indicates + * the registered class, and <code>listenerList[i+1]</code> is the + * listener. + */ + protected transient Object[] listenerList = NO_LISTENERS; + + + /** + * EventListenerList constructor + */ + public EventListenerList() + { + } + + + /** + * Registers a listener of a specific type. + * + * @param t the type of the listener. + * + * @param listener the listener to add, which must be an instance of + * <code>t</code>, or of a subclass of <code>t</code>. + * + * @throws IllegalArgumentException if <code>listener</code> is not + * an instance of <code>t</code> (or a subclass thereof). + * + * @throws Exception if <code>t</code> is <code>null</code>. + */ + public void add(Class t, EventListener listener) + { + int oldLength; + Object[] newList; + + if (listener == null) + return; + + if (!t.isInstance(listener)) + throw new IllegalArgumentException(); + + oldLength = listenerList.length; + newList = new Object[oldLength + 2]; + if (oldLength > 0) + System.arraycopy(listenerList, 0, newList, 0, oldLength); + + newList[oldLength] = t; + newList[oldLength + 1] = listener; + listenerList = newList; + } + + + /** + * Determines the number of listeners. + */ + public int getListenerCount() + { + return listenerList.length / 2; + } + + + /** + * Determines the number of listeners of a particular class. + * + * @param t the type of listeners to be counted. In order to get + * counted, a subscribed listener must be exactly of class + * <code>t</code>. Thus, subclasses of <code>t</code> will not be + * counted. + */ + public int getListenerCount(Class t) + { + int result = 0; + for (int i = 0; i < listenerList.length; i += 2) + if (t == listenerList[i]) + ++result; + + return result; + } + + + /** + * Get a list of listenerType/listener pairs + * @returns Listener list + */ + public Object[] getListenerList() + { + return listenerList; + } + + + /** + * Retrieves the currently subscribed listeners of a particular + * type. For a listener to be returned, it must have been + * registered with exactly the type <code>c</code>; subclasses are + * not considered equal. + * + * <p>The returned array can always be cast to <code>c[]</code>. + * Since it is a newly allocated copy, the caller may arbitrarily + * modify the array. + * + * @param c the class which was passed to {@link #add}. + * + * @throws ClassCastException if <code>c</code> does not implement + * the {@link EventListener} interface. + * + * @throws NullPointerException if <code>c</code> is + * <code>null</code>. + * + * @returns an array of <code>c</code> whose elements are the + * currently subscribed listeners of the specified type. If there + * are no such listeners, an empty array is returned. + * + * @since 1.3 + */ + public EventListener[] getListeners(Class c) + { + int count, f; + EventListener[] result; + + count = getListenerCount(c); + result = (EventListener[]) Array.newInstance(c, count); + f = 0; + for (int i = 0; i < listenerList.length; i += 2) + if (listenerList[i] == c) + result[f++] = (EventListener) listenerList[i + 1]; + + return result; + } + + + /** + * Removes a listener of a specific type. + * + * @param t the type of the listener. + * + * @param listener the listener to remove, which must be an instance + * of <code>t</code>, or of a subclass of <code>t</code>. + * + * @throws IllegalArgumentException if <code>listener</code> is not + * an instance of <code>t</code> (or a subclass thereof). + * + * @throws Exception if <code>t</code> is <code>null</code>. + */ + public void remove(Class t, EventListener listener) + { + Object[] oldList, newList; + int oldLength; + + if (listener == null) + return; + + if (!t.isInstance(listener)) + throw new IllegalArgumentException(); + + oldList = listenerList; + oldLength = oldList.length; + for (int i = 0; i < oldLength; i += 2) + if (oldList[i] == t && oldList[i + 1] == listener) + { + if (oldLength == 2) + newList = NO_LISTENERS; + else + { + newList = new Object[oldLength - 2]; + if (i > 0) + System.arraycopy(oldList, 0, newList, 0, i); + if (i < oldLength - 2) + System.arraycopy(oldList, i + 2, newList, i, + oldLength - 2 - i); + } + listenerList = newList; + return; + } + } + + + /** + * Returns a string representation of this object that may be useful + * for debugging purposes. + */ + public String toString() + { + StringBuffer buf = new StringBuffer("EventListenerList: "); + buf.append(listenerList.length / 2); + buf.append(" listeners: "); + for (int i = 0; i < listenerList.length; i += 2) + { + buf.append(" type "); + buf.append(((Class) listenerList[i]).getName()); + buf.append(" listener "); + buf.append(listenerList[i + 1]); + } + return buf.toString(); + } +} diff --git a/libjava/classpath/javax/swing/event/HyperlinkEvent.java b/libjava/classpath/javax/swing/event/HyperlinkEvent.java new file mode 100644 index 00000000000..4afa009f4f9 --- /dev/null +++ b/libjava/classpath/javax/swing/event/HyperlinkEvent.java @@ -0,0 +1,162 @@ +/* HyperlinkEvent.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.net.URL; +import java.util.EventObject; + +import javax.swing.text.Element; + +/** + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public class HyperlinkEvent extends EventObject +{ + public static final class EventType + { + public static final EventType ENTERED = new EventType("ENTERED"); // TODO + public static final EventType EXITED = new EventType("EXITED"); // TODO + public static final EventType ACTIVATED = new EventType("ACTIVATED"); // TODO + + private String type; + + /** + * Creates a new Event type. + * + * @param type String representing the event type. + */ + private EventType(String type) + { + this.type = type; + } + + /** + * Returns a <code>String</code> of this object. + */ + public String toString() + { + return type; + } + } + + private static final long serialVersionUID = -2054640811732867012L; + + private EventType type; + private URL url; + private String description; + private Element element; + + /** + * Creates a new <code>HyperlinkEvent</code> with the given arguments. + * + * @param source The object this link is associated to. + * @param type The type of event. + * @param url The URL this link pointing too. + */ + public HyperlinkEvent(Object source, EventType type, URL url) + { + this (source, type, url, null, null); + } + + /** + * Creates a new <code>HyperlinkEvent</code> with the given arguments. + * + * @param source The object this link is associated to. + * @param type The type of event. + * @param url The URL this link pointing too. + * @param description The description for this link. + */ + public HyperlinkEvent(Object source, EventType type, URL url, + String description) + { + this (source, type, url, description, null); + } + + /** + * Creates a new <code>HyperlinkEvent</code> with the given arguments. + * + * @param source The object this link is associated to. + * @param type The type of event. + * @param url The URL this link pointing too. + * @param description The description for this link. + * @param element The element in the document representing the anchor. + */ + public HyperlinkEvent(Object source, EventType type, URL url, + String description, Element element) + { + super(source); + this.type = type; + this.url = url; + this.description = description; + this.element = element; + } + + /** + * Returns the element of the document repesenting this anchor. + */ + public Element getSourceElement() + { + return element; + } + + /** + * Returns the URL of this event. + */ + public URL getURL() + { + return url; + } + + /** + * Returns the type of this event. + */ + public EventType getEventType() + { + return type; + } + + /** + * Returns the description of this event. + */ + public String getDescription() + { + return description; + } +} diff --git a/libjava/classpath/javax/swing/event/HyperlinkListener.java b/libjava/classpath/javax/swing/event/HyperlinkListener.java new file mode 100644 index 00000000000..5dede993fc0 --- /dev/null +++ b/libjava/classpath/javax/swing/event/HyperlinkListener.java @@ -0,0 +1,57 @@ +/* HyperlinkListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * HyperlinkListener + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public interface HyperlinkListener extends EventListener { + + /** + * Hyperlink updated + * @param event Hyperlink Event + */ + void hyperlinkUpdate(HyperlinkEvent event); + + +} // HyperlinkListener diff --git a/libjava/classpath/javax/swing/event/InternalFrameAdapter.java b/libjava/classpath/javax/swing/event/InternalFrameAdapter.java new file mode 100644 index 00000000000..a2878e76e79 --- /dev/null +++ b/libjava/classpath/javax/swing/event/InternalFrameAdapter.java @@ -0,0 +1,113 @@ +/* InternalFrameAdapter.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +/** + * InternalFrameAdapter + * @author Andrew Selkirk + */ +public abstract class InternalFrameAdapter implements InternalFrameListener +{ + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * InternalFrameAdapter constructor + */ + public InternalFrameAdapter() { + } // InternalFrameAdapter() + + + //------------------------------------------------------------- + // Interface: InternalFrameListener --------------------------- + //------------------------------------------------------------- + + /** + * Internal frame activated + * @param event Internal frame event + */ + public void internalFrameActivated(InternalFrameEvent event) { + } // internalFrameActivated() + + /** + * Internal frame closed + * @param event Internal frame event + */ + public void internalFrameClosed(InternalFrameEvent event) { + } // internalFrameClosed() + + /** + * Internal frame closing + * @param event Internal frame event + */ + public void internalFrameClosing(InternalFrameEvent event) { + } // internalFrameClosing() + + /** + * Internal frame deactivated + * @param event Internal frame event + */ + public void internalFrameDeactivated(InternalFrameEvent event) { + } // internalFrameDeactivated() + + /** + * Internal frame deiconified + * @param event Internal frame event + */ + public void internalFrameDeiconified(InternalFrameEvent event) { + } // internalFrameDeiconified() + + /** + * Internal frame iconified + * @param event Internal frame event + */ + public void internalFrameIconified(InternalFrameEvent event) { + } // internalFrameIconified() + + /** + * Internal frame opened + * @param event Internal frame event + */ + public void internalFrameOpened(InternalFrameEvent event) { + } // internalFrameOpened() + + +} // InternalFrameAdapter diff --git a/libjava/classpath/javax/swing/event/InternalFrameEvent.java b/libjava/classpath/javax/swing/event/InternalFrameEvent.java new file mode 100644 index 00000000000..badfa80aca7 --- /dev/null +++ b/libjava/classpath/javax/swing/event/InternalFrameEvent.java @@ -0,0 +1,115 @@ +/* InternalFrameEvent.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.awt.AWTEvent; + +import javax.swing.JInternalFrame; + +/** + * @author Andrew Selkirk + */ +public class InternalFrameEvent extends AWTEvent +{ + private static final long serialVersionUID = -5204823611874873183L; + + /** + * Internal frame activated event + */ + public static final int INTERNAL_FRAME_ACTIVATED = 25554; + + /** + * Internal frame closed event + */ + public static final int INTERNAL_FRAME_CLOSED = 25551; + + /** + * Internal frame closing event + */ + public static final int INTERNAL_FRAME_CLOSING = 25550; + + /** + * Internal frame deactivated event + */ + public static final int INTERNAL_FRAME_DEACTIVATED = 25555; + + /** + * Internal frame deiconifed event + */ + public static final int INTERNAL_FRAME_DEICONIFIED = 25553; + + /** + * Internal frame frame first event + */ + public static final int INTERNAL_FRAME_FIRST = 25549; + + /** + * Internal frame iconified event + */ + public static final int INTERNAL_FRAME_ICONIFIED = 25552; + + /** + * Internal frame last event + */ + public static final int INTERNAL_FRAME_LAST = 25555; + + /** + * Internal frame opened event + */ + public static final int INTERNAL_FRAME_OPENED = 25549; + + /** + * Creates a <code>JInternalFrameEvent</code> object. + * + * @param source The source of this event. + * @param id Then event ID of this event. + */ + public InternalFrameEvent(JInternalFrame source, int id) + { + super(source, id); + } + + /** + * Returns the <code>JInternalFrame</code> object stored in this event. + */ + public JInternalFrame getInternalFrame() + { + return (JInternalFrame) source; + } +} diff --git a/libjava/classpath/javax/swing/event/InternalFrameListener.java b/libjava/classpath/javax/swing/event/InternalFrameListener.java new file mode 100644 index 00000000000..d1b2812a86f --- /dev/null +++ b/libjava/classpath/javax/swing/event/InternalFrameListener.java @@ -0,0 +1,92 @@ +/* InternalFrameListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * InternalFrameListener public interface + * @author Andrew Selkirk + */ +public interface InternalFrameListener extends EventListener { + + /** + * Internal frame activated + * @param event Internal Frame Event + */ + void internalFrameActivated(InternalFrameEvent event); + + /** + * Internal frame closed + * @param event Internal Frame Event + */ + void internalFrameClosed(InternalFrameEvent event); + + /** + * Internal frame closing + * @param event Internal Frame Event + */ + void internalFrameClosing(InternalFrameEvent event); + + /** + * Internal frame deactivated + * @param event Internal Frame Event + */ + void internalFrameDeactivated(InternalFrameEvent event); + + /** + * Internal frame deiconified + * @param event Internal Frame Event + */ + void internalFrameDeiconified(InternalFrameEvent event); + + /** + * Internal frame iconified + * @param event Internal Frame Event + */ + void internalFrameIconified(InternalFrameEvent event); + + /** + * Internal frame opened + * @param event Internal Frame Event + */ + void internalFrameOpened(InternalFrameEvent event); + + +} // InternalFrameListener diff --git a/libjava/classpath/javax/swing/event/ListDataEvent.java b/libjava/classpath/javax/swing/event/ListDataEvent.java new file mode 100644 index 00000000000..2a6e6dbe9f0 --- /dev/null +++ b/libjava/classpath/javax/swing/event/ListDataEvent.java @@ -0,0 +1,98 @@ +/* ListDataEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventObject; + +/** + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public class ListDataEvent extends EventObject +{ + private static final long serialVersionUID = 2510353260071004774L; + + public static final int CONTENTS_CHANGED = 0; + public static final int INTERVAL_ADDED = 1; + public static final int INTERVAL_REMOVED = 2; + + private int type = 0; + private int index0 = 0; + private int index1 = 0; + + /** + * Creates a <code>ListDataEvent</code> object. + * + * @param source The source of the event. + * @param type The type of the event + * @param index0 Bottom of range + * @param index1 Top of range + */ + public ListDataEvent(Object source, int type, int index0, int index1) + { + super(source); + this.type = type; + this.index0 = index0; + this.index1 = index1; + } + + /** + * Returns the bottom index. + */ + public int getIndex0() + { + return index0; + } + + /** + * Returns the top index. + */ + public int getIndex1() + { + return index1; + } + + /** + * Returns the type of this event. + */ + public int getType() + { + return type; + } +} diff --git a/libjava/classpath/javax/swing/event/ListDataListener.java b/libjava/classpath/javax/swing/event/ListDataListener.java new file mode 100644 index 00000000000..7ce17d86fa6 --- /dev/null +++ b/libjava/classpath/javax/swing/event/ListDataListener.java @@ -0,0 +1,69 @@ +/* ListDataListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * ListDataListener public interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public interface ListDataListener extends EventListener { + + /** + * Contents Changed + * @param event ListDataEvent Event + */ + void contentsChanged(ListDataEvent event); + + /** + * Interval Added + * @param event ListDataEvent Event + */ + void intervalAdded(ListDataEvent event); + + /** + * Interval Removed + * @param event ListDataEvent Event + */ + void intervalRemoved(ListDataEvent event); + + +} // ListDataListener diff --git a/libjava/classpath/javax/swing/event/ListSelectionEvent.java b/libjava/classpath/javax/swing/event/ListSelectionEvent.java new file mode 100644 index 00000000000..e5e4c33bad9 --- /dev/null +++ b/libjava/classpath/javax/swing/event/ListSelectionEvent.java @@ -0,0 +1,126 @@ +/* ListSelectionEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventObject; + +/** + * ListSelectionEvent + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public class ListSelectionEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * firstIndex + */ + private int firstIndex = 0; + + /** + * lastIndex + */ + private int lastIndex = 0; + + /** + * isAdjusting + */ + private boolean isAdjusting = false; + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ListSelectionEvent + * @param source Source + * @param firstIndex First index + * @param lastIndex Last index + * @param isAdjusting Is Adjusting? + */ + public ListSelectionEvent(Object source, int firstIndex, + int lastIndex, boolean isAdjusting) { + super(source); + this.firstIndex = firstIndex; + this.lastIndex = lastIndex; + this.isAdjusting = isAdjusting; + } // ListSelectionEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getFirstIndex + * @returns firstIndex + */ + public int getFirstIndex() { + return firstIndex; + } // getFirstIndex() + + /** + * getLastIndex + * @returns lastIndex + */ + public int getLastIndex() { + return lastIndex; + } // getLastIndex() + + /** + * getValueIsAdjusting + * @returns isAdjusting + */ + public boolean getValueIsAdjusting() { + return isAdjusting; + } // getValueIsAdjusting() + + /** + * String representation + * @returns String representation + */ + public String toString() { + return null; // TODO + } // toString() + + +} // ListSelectionEvent diff --git a/libjava/classpath/javax/swing/event/ListSelectionListener.java b/libjava/classpath/javax/swing/event/ListSelectionListener.java new file mode 100644 index 00000000000..4ebf5830432 --- /dev/null +++ b/libjava/classpath/javax/swing/event/ListSelectionListener.java @@ -0,0 +1,57 @@ +/* ListSelectionListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * ListSelectionListener public interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public interface ListSelectionListener extends EventListener { + + /** + * Value changed + * @param event List Selection Event + */ + void valueChanged(ListSelectionEvent event); + + +} // ListSelectionListener diff --git a/libjava/classpath/javax/swing/event/MenuDragMouseEvent.java b/libjava/classpath/javax/swing/event/MenuDragMouseEvent.java new file mode 100644 index 00000000000..99761670629 --- /dev/null +++ b/libjava/classpath/javax/swing/event/MenuDragMouseEvent.java @@ -0,0 +1,115 @@ +/* MenuDragMouseEvent.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.awt.Component; +import java.awt.event.MouseEvent; + +import javax.swing.MenuElement; +import javax.swing.MenuSelectionManager; + +/** + * MenuDragMouseEvent + * @author Andrew Selkirk + */ +public class MenuDragMouseEvent extends MouseEvent { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * path + */ + private MenuElement[] path = null; + + /** + * manager + */ + private MenuSelectionManager manager = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor MenuDragMouseEvent + * @param source Source + * @param id MouseEvent type + * @param when Time + * @param modifiers Key modifiers + * @param x Horizontal position + * @param y Vertical position + * @param clickCount Click count + * @param popupTrigger Popup trigger? + * @param path Path + * @param manager MenuSelectionManager + */ + public MenuDragMouseEvent(Component source, int id, long when, int modifiers, + int x, int y, int clickCount, boolean popupTrigger, + MenuElement[] path, MenuSelectionManager manager) { + super(source, id, when, modifiers, x, y, clickCount, popupTrigger); + this.path = path; + this.manager = manager; + } // MenuDragMouseEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * Get path + * @returns path + */ + public MenuElement[] getPath() { + return path; + } // getPath() + + /** + * Get menu selection manager + * @returns manager + */ + public MenuSelectionManager getMenuSelectionManager() { + return manager; + } // getMenuSelectionManager() + + +} // MenuDragMouseEvent diff --git a/libjava/classpath/javax/swing/event/MenuDragMouseListener.java b/libjava/classpath/javax/swing/event/MenuDragMouseListener.java new file mode 100644 index 00000000000..bfca315e333 --- /dev/null +++ b/libjava/classpath/javax/swing/event/MenuDragMouseListener.java @@ -0,0 +1,74 @@ +/* MenuDragMouseListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * MenuDragMouseListener public interface + * @author Andrew Selkirk + */ +public interface MenuDragMouseListener extends EventListener { + + /** + * Menu drag mouse dragged + * @param event Menu Drag Mouse Event + */ + void menuDragMouseDragged(MenuDragMouseEvent event); + + /** + * Menu drag mouse entered + * @param event Menu Drag Mouse Event + */ + void menuDragMouseEntered(MenuDragMouseEvent event); + + /** + * Menu drag mouse exited + * @param event Menu Drag Mouse Event + */ + void menuDragMouseExited(MenuDragMouseEvent event); + + /** + * Menu drag mouse released + * @param event Menu Drag Mouse Event + */ + void menuDragMouseReleased(MenuDragMouseEvent event); + + +} // MenuDragMouseListener diff --git a/libjava/classpath/javax/swing/event/MenuEvent.java b/libjava/classpath/javax/swing/event/MenuEvent.java new file mode 100644 index 00000000000..35bb5b97b43 --- /dev/null +++ b/libjava/classpath/javax/swing/event/MenuEvent.java @@ -0,0 +1,59 @@ +/* MenuEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventObject; + +/** + * MenuEvent + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public class MenuEvent extends EventObject { + + /** + * Constructor MenuEvent + * @param source Source object + */ + public MenuEvent(Object source) { + super(source); + } // MenuEvent() + + +} // MenuEvent diff --git a/libjava/classpath/javax/swing/event/MenuKeyEvent.java b/libjava/classpath/javax/swing/event/MenuKeyEvent.java new file mode 100644 index 00000000000..48fcb45b5b3 --- /dev/null +++ b/libjava/classpath/javax/swing/event/MenuKeyEvent.java @@ -0,0 +1,113 @@ +/* MenuKeyEvent.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.awt.Component; +import java.awt.event.KeyEvent; + +import javax.swing.MenuElement; +import javax.swing.MenuSelectionManager; + +/** + * MenuKeyEvent + * @author Andrew Selkirk + */ +public class MenuKeyEvent extends KeyEvent { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * path + */ + private MenuElement[] path = null; + + /** + * manager + */ + private MenuSelectionManager manager = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor MenuKeyEvent + * @param source Source + * @param id KeyEvent ID + * @param when Time + * @param modifiers Modifier keys + * @param keyCode Key code + * @param keyhar Key char + * @param path Path + * @param manager MenuSelectionManager + */ + public MenuKeyEvent(Component source, int id, long when, int modifiers, + int keyCode, char keyChar, MenuElement[] path, + MenuSelectionManager manager) { + super(source, id, when, modifiers, keyCode, keyChar); + this.path = path; + this.manager = manager; + } // MenuKeyEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getPath + * @returns path + */ + public MenuElement[] getPath() { + return path; + } // getPath() + + /** + * getMenuSelectionManager + * @returns MenuSelectionManager + */ + public MenuSelectionManager getMenuSelectionManager() { + return manager; + } // getMenuSelectionManager() + + +} // MenuKeyEvent diff --git a/libjava/classpath/javax/swing/event/MenuKeyListener.java b/libjava/classpath/javax/swing/event/MenuKeyListener.java new file mode 100644 index 00000000000..7a1eb89b428 --- /dev/null +++ b/libjava/classpath/javax/swing/event/MenuKeyListener.java @@ -0,0 +1,68 @@ +/* MenuKeyListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * MenuKeyListener public interface + * @author Andrew Selkirk + */ +public interface MenuKeyListener extends EventListener { + + /** + * Menu key pressed + * @param event Menu Key Event + */ + void menuKeyPressed(MenuKeyEvent event); + + /** + * Menu key released + * @param event Menu Key Event + */ + void menuKeyReleased(MenuKeyEvent event); + + /** + * Menu key typed + * @param event Menu Key Event + */ + void menuKeyTyped(MenuKeyEvent event); + + +} // MenuKeyListener diff --git a/libjava/classpath/javax/swing/event/MenuListener.java b/libjava/classpath/javax/swing/event/MenuListener.java new file mode 100644 index 00000000000..dba704a8ee1 --- /dev/null +++ b/libjava/classpath/javax/swing/event/MenuListener.java @@ -0,0 +1,68 @@ +/* MenuListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * MenuListener public interface + * @author Andrew Selkirk + */ +public interface MenuListener extends EventListener { + + /** + * Menu canceled + * @param event Menu Event + */ + void menuCanceled(MenuEvent event); + + /** + * Menu deselected + * @param event Menu Event + */ + void menuDeselected(MenuEvent event); + + /** + * Menu selected + * @param event Menu Event + */ + void menuSelected(MenuEvent event); + + +} // MenuListener diff --git a/libjava/classpath/javax/swing/event/MouseInputAdapter.java b/libjava/classpath/javax/swing/event/MouseInputAdapter.java new file mode 100644 index 00000000000..2da5543eb91 --- /dev/null +++ b/libjava/classpath/javax/swing/event/MouseInputAdapter.java @@ -0,0 +1,119 @@ +/* MouseInputAdapter.java -- + Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.awt.event.MouseEvent; + +/** + * MouseInputAdapter + * @author Andrew Selkirk + */ +public abstract class MouseInputAdapter implements MouseInputListener +{ + /** + * Constructor MouseInputAdapter + */ + public MouseInputAdapter() + { + // Do nothing here. + } + + /** + * Mouse clicked + * @param event Mouse event + */ + public void mouseClicked(MouseEvent event) + { + // Do nothing by default. + } + + /** + * Mouse dragged + * @param event Mouse event + */ + public void mouseDragged(MouseEvent event) + { + // Do nothing by default. + } + + /** + * Mouse entered + * @param event Mouse event + */ + public void mouseEntered(MouseEvent event) + { + // Do nothing by default. + } + + /** + * Mouse exited + * @param event Mouse event + */ + public void mouseExited(MouseEvent event) + { + // Do nothing by default. + } + + /** + * Mouse moved + * @param event Mouse event + */ + public void mouseMoved(MouseEvent event) + { + // Do nothing by default. + } + + /** + * Mouse pressed + * @param event Mouse event + */ + public void mousePressed(MouseEvent event) + { + // Do nothing by default. + } + + /** + * Mouse released + * @param event Mouse event + */ + public void mouseReleased(MouseEvent event) + { + // Do nothing by default. + } +} diff --git a/libjava/classpath/javax/swing/event/MouseInputListener.java b/libjava/classpath/javax/swing/event/MouseInputListener.java new file mode 100644 index 00000000000..3c3ca2347fe --- /dev/null +++ b/libjava/classpath/javax/swing/event/MouseInputListener.java @@ -0,0 +1,52 @@ +/* MouseInputListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + +/** + * MouseInputListener public interface + * @author Andrew Selkirk + */ +public interface MouseInputListener extends MouseListener, + MouseMotionListener { + +} // MouseInputListener + diff --git a/libjava/classpath/javax/swing/event/PopupMenuEvent.java b/libjava/classpath/javax/swing/event/PopupMenuEvent.java new file mode 100644 index 00000000000..055555086ef --- /dev/null +++ b/libjava/classpath/javax/swing/event/PopupMenuEvent.java @@ -0,0 +1,58 @@ +/* PopupMenuEvent.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventObject; + +/** + * PopupMenuEvent + * @author Andrew Selkirk + */ +public class PopupMenuEvent extends EventObject { + + /** + * Constructor PopupMenuEvent + * @param source Source + */ + public PopupMenuEvent(Object source) { + super(source); + } // PopupMenuEvent() + + +} // PopupMenuEvent diff --git a/libjava/classpath/javax/swing/event/PopupMenuListener.java b/libjava/classpath/javax/swing/event/PopupMenuListener.java new file mode 100644 index 00000000000..dc917d2414c --- /dev/null +++ b/libjava/classpath/javax/swing/event/PopupMenuListener.java @@ -0,0 +1,68 @@ +/* PopupMenuListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * PopupMenuListener public interface + * @author Andrew Selkirk + */ +public interface PopupMenuListener extends EventListener { + + /** + * Popup Menu Canceled + * @param event Popup Menu Event + */ + void popupMenuCanceled(PopupMenuEvent event); + + /** + * Popup Menu will become invisible + * @param event Popup Menu Event + */ + void popupMenuWillBecomeInvisible(PopupMenuEvent event); + + /** + * Popup Menu will become visible + * @param event Popup Menu Event + */ + void popupMenuWillBecomeVisible(PopupMenuEvent event); + + +} // PopupMenuListener diff --git a/libjava/classpath/javax/swing/event/SwingPropertyChangeSupport.java b/libjava/classpath/javax/swing/event/SwingPropertyChangeSupport.java new file mode 100644 index 00000000000..ddbb4865883 --- /dev/null +++ b/libjava/classpath/javax/swing/event/SwingPropertyChangeSupport.java @@ -0,0 +1,255 @@ +/* SwingPropertyChangeSupport.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.EventListener; +import java.util.Hashtable; + +/** + * SwingPropertyChangeSupport + * @author Andrew Selkirk +*/ +public final class SwingPropertyChangeSupport + extends PropertyChangeSupport { + + private static final long serialVersionUID = 7162625831330845068L; + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * listeners + */ + private transient EventListenerList listeners; + + /** + * propertyListeners + */ + private Hashtable propertyListeners; + + /** + * source + */ + private Object source; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor SwingPropertyChangeSupport + * @param source TODO + */ + public SwingPropertyChangeSupport(Object source) { + super(source); + this.source = source; + this.listeners = new EventListenerList(); + this.propertyListeners = new Hashtable(); + } // SwingPropertyChangeSupport() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * readObject + * @param stream TODO + * @exception ClassNotFoundException TODO + * @exception IOException TODO + */ + private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException { + // TODO + } // readObject() + + /** + * addPropertyChangeListener + * @param listener TODO + */ + public synchronized void addPropertyChangeListener(PropertyChangeListener listener) { + listeners.add(PropertyChangeListener.class, listener); + } // addPropertyChangeListener() + + /** + * addPropertyChangeListener + * @param propertyName TODO + * @param listener TODO + */ + public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + + // Variables + EventListenerList list; + + // Get Listener list + list = (EventListenerList) propertyListeners.get(propertyName); + if (list == null) { + list = new EventListenerList(); + propertyListeners.put(propertyName, list); + } // if + + // Add Listeners + list.add(PropertyChangeListener.class, listener); + + } // addPropertyChangeListener() + + /** + * removePropertyChangeListener + * @param listener TODO + */ + public synchronized void removePropertyChangeListener(PropertyChangeListener listener) { + listeners.remove(PropertyChangeListener.class, listener); + } // removePropertyChangeListener() + + /** + * removePropertyChangeListener + * @param propertyName TODO + * @param listener TODO + */ + public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + + // Variables + EventListenerList list; + + // Get Listener list + list = (EventListenerList) propertyListeners.get(propertyName); + if (list == null) { + return; + } // if + + // Remove Listeners + list.remove(PropertyChangeListener.class, listener); + + // Clean up propertyListeners + if (list.getListenerCount() == 0) { + propertyListeners.remove(propertyName); + } // if + + } // removePropertyChangeListener() + + /** + * firePropertyChange + * @param propertyName TODO + * @param oldValue TODO + * @param newValue TODO + */ + public void firePropertyChange(String propertyName, Object oldValue, Object newValue) { + + // Variables + PropertyChangeEvent event; + + // Create Property Change Event + event = new PropertyChangeEvent(source, propertyName, oldValue, newValue); + + // Fire Event + firePropertyChange(event); + + } // firePropertyChange() + + /** + * firePropertyChange + * @param event TODO + */ + public void firePropertyChange(PropertyChangeEvent event) { + + // Variables + EventListenerList list; + EventListener[] listenerList; + int index; + PropertyChangeListener listener; + + // Check Values if they are equal + if (event.getOldValue() == null && event.getNewValue() == null || + (event.getOldValue() != null && event.getNewValue() != null && + event.getOldValue().equals(event.getNewValue()))) { + return; + } // if + + // Process Main Listener List + listenerList = listeners.getListeners(PropertyChangeListener.class); + for (index = 0; index < listenerList.length; index++) { + listener = (PropertyChangeListener) listenerList[index]; + listener.propertyChange(event); + } // for + + // Process Property Listener List + list = (EventListenerList) propertyListeners.get(event.getPropertyName()); + if (list != null) { + listenerList = list.getListeners(PropertyChangeListener.class); + for (index = 0; index < listenerList.length; index++) { + listener = (PropertyChangeListener) listenerList[index]; + listener.propertyChange(event); + } // for + } // if + + } // firePropertyChange() + + /** + * hasListeners + * @param propertyName TODO + * @returns boolean + */ + public synchronized boolean hasListeners(String propertyName) { + + // Get Listener list + if (propertyListeners.get(propertyName) == null) { + return false; + } // if + + return true; + + } // hasListeners() + + +} // SwingPropertyChangeSupport diff --git a/libjava/classpath/javax/swing/event/TableColumnModelEvent.java b/libjava/classpath/javax/swing/event/TableColumnModelEvent.java new file mode 100644 index 00000000000..2ca4148aadb --- /dev/null +++ b/libjava/classpath/javax/swing/event/TableColumnModelEvent.java @@ -0,0 +1,105 @@ +/* TableColumnModelEvent.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventObject; + +import javax.swing.table.TableColumnModel; + +/** + * TableColumnModelEvent + * @author Andrew Selkirk + */ +public class TableColumnModelEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * fromIndex + */ + protected int fromIndex = 0; + + /** + * toIndex + */ + protected int toIndex = 0; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TableColumnModelEvent + * @param source Source TableColumnModel + * @param from From index + * @param to To index + */ + public TableColumnModelEvent(TableColumnModel source, + int from, int to) { + super(source); + fromIndex = from; + toIndex = to; + } // TableColumnModelEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getFromIndex. + * @returns From index + */ + public int getFromIndex() { + return fromIndex; + } // getFromIndex() + + /** + * getToIndex. + * @returns To index + */ + public int getToIndex() { + return toIndex; + } // getToIndex() + + +} // TableColumnModelEvent diff --git a/libjava/classpath/javax/swing/event/TableColumnModelListener.java b/libjava/classpath/javax/swing/event/TableColumnModelListener.java new file mode 100644 index 00000000000..90e1b29cc57 --- /dev/null +++ b/libjava/classpath/javax/swing/event/TableColumnModelListener.java @@ -0,0 +1,80 @@ +/* TableColumnModelListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * TableColumnModelListener public interface + * @author Andrew Selkirk + */ +public interface TableColumnModelListener extends EventListener { + + /** + * Column added + * @param event Table Column Model Event + */ + void columnAdded(TableColumnModelEvent event); + + /** + * Column margin changed + * @param event Change Event + */ + void columnMarginChanged(ChangeEvent event); + + /** + * Column moved + * @param event Table Column Model Event + */ + void columnMoved(TableColumnModelEvent event); + + /** + * Column removed + * @param event Table Column Model Event + */ + void columnRemoved(TableColumnModelEvent event); + + /** + * Column selection changed + * @param event List Selection Event + */ + void columnSelectionChanged(ListSelectionEvent event); + + +} // TableColumnModelListener diff --git a/libjava/classpath/javax/swing/event/TableModelEvent.java b/libjava/classpath/javax/swing/event/TableModelEvent.java new file mode 100644 index 00000000000..e15174cc6c2 --- /dev/null +++ b/libjava/classpath/javax/swing/event/TableModelEvent.java @@ -0,0 +1,220 @@ +/* TableModelEvent.java -- + Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventObject; + +import javax.swing.table.TableModel; + +/** + * An event that describes changes to a {@link TableModel}. + * + * @see javax.swing.event.TableModelListener + * + * @author Andrew Selkirk + */ +public class TableModelEvent extends EventObject +{ + private static final long serialVersionUID = -7849342674552212824L; + + /** A column index representing all columns. */ + public static final int ALL_COLUMNS = -1; + + /** + * An event type indicating that one or more rows have been deleted from the + * model. + */ + public static final int DELETE = -1; + + /** A row index representing the header row. */ + public static final int HEADER_ROW = -1; + + /** + * An event type indicating that one or more rows have been inserted into the + * model. + */ + public static final int INSERT = 1; + + /** An event type indicating that data has been updated in the model. */ + public static final int UPDATE = 0; + + /** The column in the table model that the event relates to. */ + protected int column = 0; + + /** The first row in the table model that the event relates to. */ + protected int firstRow = 0; + + /** The last row in the table model that the event relates to. */ + protected int lastRow = 0; + + /** + * The event type (one of {@link #UPDATE}, {@link #INSERT}, {@link #DELETE}). + */ + protected int type = 0; + + /** + * Creates a new <code>TableModelEvent</code> indicating an {@link #UPDATE} + * to the data in all columns and rows. + * + * @param source the source object (<code>null</code> not permitted). + * + * @throws IllegalArgumentException if <code>source</code> is + * <code>null</code>. + */ + public TableModelEvent(TableModel source) + { + this(source, 0, Integer.MAX_VALUE, ALL_COLUMNS, UPDATE); + } + + /** + * Creates a new <code>TableModelEvent</code> indicating an {@link #UPDATE} + * to the data in a single row across all columns. + * + * @param source the source object (<code>null</code> not permitted). + * @param row the updated row. + * + * @throws IllegalArgumentException if <code>source</code> is + * <code>null</code>. + */ + public TableModelEvent(TableModel source, int row) + { + this(source, row, row, ALL_COLUMNS, UPDATE); + } + + /** + * Creates a new <code>TableModelEvent</code> indicating an {@link #UPDATE} + * to the data in the specified rows across all columns. + * + * @param source the source object (<code>null</code> not permitted). + * @param firstRow the first row of update. + * @param lastRow the last row of update. + * + * @throws IllegalArgumentException if <code>source</code> is + * <code>null</code>. + */ + public TableModelEvent(TableModel source, int firstRow, int lastRow) + { + this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE); + } + + /** + * Creates a new <code>TableModelEvent</code> indicating an {@link #UPDATE} + * to the data in the specified rows and column. Use {@link #ALL_COLUMNS} + * for the <code>column</code> argument to indicate all columns. + * + * @param source the source object (<code>null</code> not permitted). + * @param firstRow the first row of update. + * @param lastRow the last row of update. + * @param column the affected column. + * + * @throws IllegalArgumentException if <code>source</code> is + * <code>null</code>. + */ + public TableModelEvent(TableModel source, int firstRow, int lastRow, + int column) + { + this(source, firstRow, lastRow, column, UPDATE); + } + + /** + * Creates a new <code>TableModelEvent</code> indicating an operation of + * the specified <code>type</code> on the data in the specified rows and + * column. The event type is usually one of {@link #UPDATE}, {@link #INSERT}, + * and {@link #DELETE}. + * + * @param source the source object (<code>null</code> not permitted). + * @param firstRow the first row of update. + * @param lastRow the last row of update. + * @param column the affected column. + * @param type the type of change. + * + * @throws IllegalArgumentException if <code>source</code> is + * <code>null</code>. + */ + public TableModelEvent(TableModel source, int firstRow, int lastRow, + int column, int type) + { + super(source); + this.firstRow = firstRow; + this.lastRow = lastRow; + this.column = column; + this.type = type; + } + + /** + * Returns the affected column of this event. + * + * @return The column index. + */ + public int getColumn() + { + return column; + } + + /** + * Returns the first affected row of this event. + * + * @return The row index. + */ + public int getFirstRow() + { + return firstRow; + } + + /** + * Returns the last affected row of this event. + * + * @return The row index. + */ + public int getLastRow() + { + return lastRow; + } + + /** + * Returns the type of change indicated by this event (usually one of + * {@link #UPDATE}, {@link #INSERT}, {@link #DELETE}). + * + * @return The type. + */ + public int getType() + { + return type; + } +} diff --git a/libjava/classpath/javax/swing/event/TableModelListener.java b/libjava/classpath/javax/swing/event/TableModelListener.java new file mode 100644 index 00000000000..c8d6e8f8dbc --- /dev/null +++ b/libjava/classpath/javax/swing/event/TableModelListener.java @@ -0,0 +1,55 @@ +/* TableModelListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventListener; + +/** + * TableModelListener public interface + * @author Andrew Selkirk + */ +public interface TableModelListener extends EventListener { + + /** + * Table changed + * @param event Table Model Event + */ + void tableChanged(TableModelEvent event); + + +} // TableModelListener diff --git a/libjava/classpath/javax/swing/event/TreeExpansionEvent.java b/libjava/classpath/javax/swing/event/TreeExpansionEvent.java new file mode 100644 index 00000000000..c4b33134694 --- /dev/null +++ b/libjava/classpath/javax/swing/event/TreeExpansionEvent.java @@ -0,0 +1,89 @@ +/* TreeExpansionEvent.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventObject; + +import javax.swing.tree.TreePath; + +/** + * TreeExpansionEvent + * @author Andrew Selkirk + */ +public class TreeExpansionEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * path + */ + protected TreePath path = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TreeExpansionEvent + * @param source Source object + * @param path Path + */ + public TreeExpansionEvent(Object source, TreePath path) { + super(source); + this.path = path; + } // TreeExpansionEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getPath + * @returns Tree path + */ + public TreePath getPath() { + return path; + } // getPath() + + +} // TreeExpansionEvent diff --git a/libjava/classpath/javax/swing/event/TreeExpansionListener.java b/libjava/classpath/javax/swing/event/TreeExpansionListener.java new file mode 100644 index 00000000000..08507a0ffe9 --- /dev/null +++ b/libjava/classpath/javax/swing/event/TreeExpansionListener.java @@ -0,0 +1,62 @@ +/* TreeExpansionListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * TreeExpansionListener public interface + * @author Andrew Selkirk + */ +public interface TreeExpansionListener extends EventListener { + + /** + * Tree collapsed + * @param event Tree Expansion Event + */ + void treeCollapsed(TreeExpansionEvent event); + + /** + * Tree expanded + * @param event Tree Expansion Event + */ + void treeExpanded(TreeExpansionEvent event); + + +} // TreeExpansionListener diff --git a/libjava/classpath/javax/swing/event/TreeModelEvent.java b/libjava/classpath/javax/swing/event/TreeModelEvent.java new file mode 100644 index 00000000000..a217e3b4053 --- /dev/null +++ b/libjava/classpath/javax/swing/event/TreeModelEvent.java @@ -0,0 +1,171 @@ +/* TreeModelEvent.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventObject; + +import javax.swing.tree.TreePath; + +/** + * TreeModelEvent + * @author Andrew Selkirk + */ +public class TreeModelEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * childIndices + */ + protected int[] childIndices = new int[0]; + + /** + * children + */ + protected Object[] children = new Object[0]; + + /** + * path + */ + protected TreePath path = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path + */ + public TreeModelEvent(Object source, Object[] path) { + super(source); + this.path = new TreePath(path); + } // TreeModelEvent() + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path path + * @param childIndices Child indices + * @param children Children + */ + public TreeModelEvent(Object source, Object[] path, + int[] childIndices, Object[] children) { + super(source); + this.path = new TreePath(path); + this.childIndices = childIndices; + this.children = children; + } // TreeModelEvent() + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path Path + */ + public TreeModelEvent(Object source, TreePath path) { + super(source); + this.path = path; + } // TreeModelEvent() + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path Path + * @param childIndices Child indices + * @param children Children + */ + public TreeModelEvent(Object source, TreePath path, + int[] childIndices, Object[] children) { + super(source); + this.path = path; + this.childIndices = childIndices; + this.children = children; + } // TreeModelEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getChildIndices + * @returns child indices + */ + public int[] getChildIndices() { + return childIndices; + } // getChildIndices() + + /** + * getChildren + * @returns children + */ + public Object[] getChildren() { + return children; + } // getChildren() + + /** + * getPath + * @returns path + */ + public Object[] getPath() { + return path.getPath(); + } // getPath() + + /** + * getTreePath + * @returns TreePath + */ + public TreePath getTreePath() { + return path; + } // getTreePath() + + /** + * String representation + * @returns String representation + */ + public String toString() { + return null; // TODO + } // toString() + + +} // TreeModelEvent diff --git a/libjava/classpath/javax/swing/event/TreeModelListener.java b/libjava/classpath/javax/swing/event/TreeModelListener.java new file mode 100644 index 00000000000..57b5c511b8b --- /dev/null +++ b/libjava/classpath/javax/swing/event/TreeModelListener.java @@ -0,0 +1,74 @@ +/* TreeModelListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * TreeModelListener public interface + * @author Andrew Selkirk + */ +public interface TreeModelListener extends EventListener { + + /** + * Tree nodes changed + * @param event Tree Model Event + */ + void treeNodesChanged(TreeModelEvent event); + + /** + * Tree nodes inserted + * @param event Tree Model Event + */ + void treeNodesInserted(TreeModelEvent event); + + /** + * Tree nodes removed + * @param event Tree Model Event + */ + void treeNodesRemoved(TreeModelEvent event); + + /** + * Tree structured changed + * @param event Tree Model Event + */ + void treeStructureChanged(TreeModelEvent event); + + +} // TreeModelListener diff --git a/libjava/classpath/javax/swing/event/TreeSelectionEvent.java b/libjava/classpath/javax/swing/event/TreeSelectionEvent.java new file mode 100644 index 00000000000..df4e0ff9128 --- /dev/null +++ b/libjava/classpath/javax/swing/event/TreeSelectionEvent.java @@ -0,0 +1,199 @@ +/* TreeSelectionEvent.java -- + Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventObject; + +import javax.swing.tree.TreePath; + +/** + * TreeSelectionEvent + * @author Andrew Selkirk + * @version 1.0 + */ +public class TreeSelectionEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * paths + */ + protected TreePath[] paths; + + /** + * areNew + */ + protected boolean[] areNew; + + /** + * oldLeadSelectionPath + */ + protected TreePath oldLeadSelectionPath; + + /** + * newLeadSelectionPath + */ + protected TreePath newLeadSelectionPath; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TreeSelectionEvent + * @param source TODO + * @param paths TODO + * @param areNew TODO + * @param oldLeadSelectionPath TODO + * @param newLeadSelectionPath TODO + */ + public TreeSelectionEvent(Object source, TreePath[] paths, + boolean[] areNew, TreePath oldLeadSelectionPath, + TreePath newLeadSelectionPath) + { + super(source); + this.paths = paths; + this.areNew = areNew; + this.oldLeadSelectionPath = oldLeadSelectionPath; + this.newLeadSelectionPath = newLeadSelectionPath; + } // TreeSelectionEvent() + + /** + * Constructor TreeSelectionEvent + * @param source TODO + * @param paths TODO + * @param areNew TODO + * @param oldLeadSelectionPath TODO + * @param newLeadSelectionPath TODO + */ + public TreeSelectionEvent(Object source, TreePath path, + boolean isNew, TreePath oldLeadSelectionPath, + TreePath newLeadSelectionPath) + { + super(source); + this.paths = new TreePath[]{path}; + this.areNew = new boolean[]{isNew}; + this.oldLeadSelectionPath = oldLeadSelectionPath; + this.newLeadSelectionPath = newLeadSelectionPath; + } // TreeSelectionEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * @returns the first path element + */ + public TreePath getPath() + { + return paths[0]; + } // getPath() + + /** + * + * @returns the paths with selection changed + */ + public TreePath[] getPaths() + { + return (TreePath[]) paths.clone(); + } // getPaths() + + /** + * @return true if the first path is added to the selection, false otherwise + */ + public boolean isAddedPath() + { + return areNew[0]; + } // isAddedPath() + + /** + * @param path the path to check + * @return true if the path is added to the selection, false otherwise + */ + public boolean isAddedPath(TreePath path) + { + for (int i = paths.length - 1; i >= 0; i--) + if (paths[i].equals(path)) + return areNew[i]; + + return false; + } // isAddedPath() + + /** + * @param index the index'th path + * @return true if the path is added to the selection, false otherwise + */ + public boolean isAddedPath(int index) + { + return areNew[index]; + } // isAddedPath() + + /** + * @return the previous lead selection path + */ + public TreePath getOldLeadSelectionPath() + { + return oldLeadSelectionPath; + } // getOldLeadSelectionPath() + + /** + * @returns the current lead selection path + */ + public TreePath getNewLeadSelectionPath() + { + return newLeadSelectionPath; + } // getNewLeadSelectionPath() + + /** + * @param source the new event source + * @return a cloned event with another event source + */ + public Object cloneWithSource(Object source) + { + return new TreeSelectionEvent (source, paths, areNew, + oldLeadSelectionPath, + newLeadSelectionPath); + } // cloneWithSource() + + +} // TreeSelectionEvent diff --git a/libjava/classpath/javax/swing/event/TreeSelectionListener.java b/libjava/classpath/javax/swing/event/TreeSelectionListener.java new file mode 100644 index 00000000000..b844a6e0b51 --- /dev/null +++ b/libjava/classpath/javax/swing/event/TreeSelectionListener.java @@ -0,0 +1,56 @@ +/* TreeSelectionListener.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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +// Imports +import java.util.EventListener; + +/** + * TreeSelectionListener public interface + * @author Andrew Selkirk + */ +public interface TreeSelectionListener extends EventListener { + + /** + * Value changed + * @param event Tree Selection Event + */ + void valueChanged(TreeSelectionEvent event); + + +} // TreeSelectionListener diff --git a/libjava/classpath/javax/swing/event/TreeWillExpandListener.java b/libjava/classpath/javax/swing/event/TreeWillExpandListener.java new file mode 100644 index 00000000000..89d3764f3bd --- /dev/null +++ b/libjava/classpath/javax/swing/event/TreeWillExpandListener.java @@ -0,0 +1,65 @@ +/* TreeWillExpandListener.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventListener; + +import javax.swing.tree.ExpandVetoException; + +/** + * @author Andrew Selkirk + */ +public interface TreeWillExpandListener extends EventListener +{ + /** + * Invoked whenever a node in the tree is about to be collapsed. + * + * @param event The tree expansion Event + */ + void treeWillCollapse(TreeExpansionEvent event) + throws ExpandVetoException; + + /** + * Invoked whenever a node in the tree is about to be expanded. + * + * @param event The tree expansion Event + */ + void treeWillExpand(TreeExpansionEvent event) + throws ExpandVetoException; +} diff --git a/libjava/classpath/javax/swing/event/UndoableEditEvent.java b/libjava/classpath/javax/swing/event/UndoableEditEvent.java new file mode 100644 index 00000000000..147c2e5b1c5 --- /dev/null +++ b/libjava/classpath/javax/swing/event/UndoableEditEvent.java @@ -0,0 +1,92 @@ +/* UndoableEditEvent.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventObject; + +import javax.swing.undo.UndoableEdit; + +/** + * UndoableEditEvent + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public class UndoableEditEvent extends EventObject { + + private static final long serialVersionUID = 4418044561759134484L; + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * edit + */ + private UndoableEdit edit; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor UndoableEditEvent + * @param source TODO + * @param edit TODO + */ + public UndoableEditEvent(Object source, UndoableEdit edit) { + super(source); + this.edit = edit; + } // UndoableEditEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getEdit + * @returns UndoableEdit + */ + public UndoableEdit getEdit() { + return edit; + } // getEdit() + + +} // UndoableEditEvent diff --git a/libjava/classpath/javax/swing/event/UndoableEditListener.java b/libjava/classpath/javax/swing/event/UndoableEditListener.java new file mode 100644 index 00000000000..13eecf51afb --- /dev/null +++ b/libjava/classpath/javax/swing/event/UndoableEditListener.java @@ -0,0 +1,56 @@ +/* UndoableEditListener.java -- + Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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.event; + +import java.util.EventListener; + + +/** + * UndoableEditListener public interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ +public interface UndoableEditListener extends EventListener +{ + /** + * Undoable edit has happened + * + * @param event Undoable Edit Event + */ + void undoableEditHappened(UndoableEditEvent event); +} diff --git a/libjava/classpath/javax/swing/event/package.html b/libjava/classpath/javax/swing/event/package.html new file mode 100644 index 00000000000..faef7e15a85 --- /dev/null +++ b/libjava/classpath/javax/swing/event/package.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - describes classes in javax.swing.event package. + Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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. --> + +<html> +<head><title>GNU Classpath - javax.swing.event</title></head> + +<body> +<p>Provides events and listeners used by components in the +<code>javax.swing</code> package.</p> + +</body> +</html> |